diff --git a/common/pom.xml b/common/pom.xml index 735b599..0986213 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -272,11 +272,11 @@ - - org.apache.velocity - velocity-engine-core - ${velocity.version} - + + + + + diff --git a/common/src/main/java/com/huoran/common/bo/TokenInfoBO.java b/common/src/main/java/com/huoran/common/bo/TokenInfoBO.java new file mode 100644 index 0000000..44b6d61 --- /dev/null +++ b/common/src/main/java/com/huoran/common/bo/TokenInfoBO.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ +package com.huoran.common.bo; + + +import lombok.Data; + +/** + * token信息,该信息存在redis中 + * + * @author 菠萝凤梨 + * @date 2022/3/25 17:33 + */ +@Data +public class TokenInfoBO { + + /** + * 保存在token信息里面的用户信息 + */ + private UserInfoInTokenBO userInfoInToken; + + private String accessToken; + + private String refreshToken; + + /** + * 在多少秒后过期 + */ + private Integer expiresIn; + +} diff --git a/common/src/main/java/com/huoran/common/bo/UserInfoInTokenBO.java b/common/src/main/java/com/huoran/common/bo/UserInfoInTokenBO.java new file mode 100644 index 0000000..53a3b76 --- /dev/null +++ b/common/src/main/java/com/huoran/common/bo/UserInfoInTokenBO.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ +package com.huoran.common.bo; + +import lombok.Data; + +import java.util.Set; + +/** + * 保存在token信息里面的用户信息 + * + * @author 菠萝凤梨 + * @date 2022/3/25 17:33 + */ +@Data +public class UserInfoInTokenBO { + + /** + * 用户在自己系统的用户id + */ + private String userId; + + /** + * 租户id (商家id) + */ + private Long shopId; + + /** + * 昵称 + */ + private String nickName; + + /** + * 系统类型 + */ + private Integer sysType; + + /** + * 是否是管理员 + */ + private Integer isAdmin; + + private String bizUserId; + + /** + * 权限列表 + */ + private Set perms; + + /** + * 状态 1 正常 0 无效 + */ + private Boolean enabled; + + /** + * 其他Id + */ + private Long otherId; + +} diff --git a/common/src/main/java/com/huoran/common/exception/YamiShopBindException.java b/common/src/main/java/com/huoran/common/exception/YamiShopBindException.java new file mode 100644 index 0000000..b4afdc1 --- /dev/null +++ b/common/src/main/java/com/huoran/common/exception/YamiShopBindException.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.common.exception; + + +import com.huoran.common.response.ResponseEnum; +import com.huoran.common.response.ServerResponseEntity; +import lombok.Getter; + +/** + * @author lanhai + */ +@Getter +public class YamiShopBindException extends RuntimeException{ + + /** + * + */ + private static final long serialVersionUID = -4137688758944857209L; + + /** + * http状态码 + */ + private String code; + + private Object object; + + private ServerResponseEntity serverResponseEntity; + + public YamiShopBindException(ResponseEnum responseEnum) { + super(responseEnum.getMsg()); + this.code = responseEnum.value(); + } + /** + * @param responseEnum + */ + public YamiShopBindException(ResponseEnum responseEnum, String msg) { + super(msg); + this.code = responseEnum.value(); + } + + public YamiShopBindException(ServerResponseEntity serverResponseEntity) { + this.serverResponseEntity = serverResponseEntity; + } + + + public YamiShopBindException(String msg) { + super(msg); + this.code = ResponseEnum.SHOW_FAIL.value(); + } + + public YamiShopBindException(String msg, Object object) { + super(msg); + this.code = ResponseEnum.SHOW_FAIL.value(); + this.object = object; + } + +} diff --git a/common/src/main/java/com/huoran/common/response/ResponseCode.java b/common/src/main/java/com/huoran/common/response/ResponseCode.java new file mode 100644 index 0000000..bb49e82 --- /dev/null +++ b/common/src/main/java/com/huoran/common/response/ResponseCode.java @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ +package com.huoran.common.response; + +/** + * @author lanhai + */ +public interface ResponseCode { + + int SUCCESS = 1; + int FAIL = -1; +} diff --git a/common/src/main/java/com/huoran/common/response/ResponseEnum.java b/common/src/main/java/com/huoran/common/response/ResponseEnum.java new file mode 100644 index 0000000..f628815 --- /dev/null +++ b/common/src/main/java/com/huoran/common/response/ResponseEnum.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ +package com.huoran.common.response; + +/** + * @author FrozenWatermelon + * @date 2020/7/9 + */ +public enum ResponseEnum { + + /** + * ok + */ + OK("200", "ok"), + SHOW_FAIL("A00001", ""), + + /** + * 用于直接显示提示用户的错误,内容由输入内容决定 + */ + + /** + * 用于直接显示提示系统的成功,内容由输入内容决定 + */ + SHOW_SUCCESS("A00002", ""), + + /** + * 未授权 + */ + UNAUTHORIZED("A00004", "Unauthorized"), + + /** + * 服务器出了点小差 + */ + EXCEPTION("A00005", "服务器出了点小差"), + /** + * 方法参数没有校验,内容由输入内容决定 + */ + METHOD_ARGUMENT_NOT_VALID("A00014", "方法参数没有校验"); + + private final String code; + + private final String msg; + + public String value() { + return code; + } + + public String getMsg() { + return msg; + } + + ResponseEnum(String code, String msg) { + this.code = code; + this.msg = msg; + } + + @Override + public String toString() { + return "ResponseEnum{" + "code='" + code + '\'' + ", msg='" + msg + '\'' + "} " + super.toString(); + } + +} diff --git a/common/src/main/java/com/huoran/common/response/ServerResponse.java b/common/src/main/java/com/huoran/common/response/ServerResponse.java new file mode 100644 index 0000000..538a7e6 --- /dev/null +++ b/common/src/main/java/com/huoran/common/response/ServerResponse.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.common.response; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Objects; + +/** + * @author lanhai + */ +@Data +public class ServerResponse implements Serializable { + + + private int code; + + private String msg; + + private T obj; + + public boolean isSuccess(){ + return Objects.equals(ResponseCode.SUCCESS, this.code); + } + + +} diff --git a/common/src/main/java/com/huoran/common/response/ServerResponseEntity.java b/common/src/main/java/com/huoran/common/response/ServerResponseEntity.java new file mode 100644 index 0000000..51befd1 --- /dev/null +++ b/common/src/main/java/com/huoran/common/response/ServerResponseEntity.java @@ -0,0 +1,198 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.common.response; + +import lombok.extern.slf4j.Slf4j; + +import java.io.Serializable; +import java.util.Objects; + +/** + * @author lanhai + */ +@Slf4j +public class ServerResponseEntity implements Serializable { + + /** + * 状态码 + */ + private String code; + + /** + * 信息 + */ + private String msg; + + /** + * 数据 + */ + private T data; + + /** + * 版本 + */ +// private String version; + + /** + * 时间 + */ + private Long timestamp; + + private String sign; + + public String getSign() { + return sign; + } + + public void setSign(String sign) { + this.sign = sign; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public T getData() { + return data; + } + + public ServerResponseEntity setData(T data) { + this.data = data; + return this; + } + +// public String getVersion() { +// return version; +// } +// +// public void setVersion(String version) { +// this.version = version; +// } + + public Long getTimestamp() { + return timestamp; + } + + public void setTimestamp(Long timestamp) { + this.timestamp = timestamp; + } + + public boolean isSuccess() { + return Objects.equals(ResponseEnum.OK.value(), this.code); + } + public boolean isFail() { + return !Objects.equals(ResponseEnum.OK.value(), this.code); + } + +// public ServerResponseEntity() { +// // 版本号 +// this.version = "mall4j.v230424"; +// } + + public static ServerResponseEntity success(T data) { + ServerResponseEntity serverResponseEntity = new ServerResponseEntity<>(); + serverResponseEntity.setData(data); + serverResponseEntity.setCode(ResponseEnum.OK.value()); + return serverResponseEntity; + } + + public static ServerResponseEntity success() { + ServerResponseEntity serverResponseEntity = new ServerResponseEntity<>(); + serverResponseEntity.setCode(ResponseEnum.OK.value()); + serverResponseEntity.setMsg(ResponseEnum.OK.getMsg()); + return serverResponseEntity; + } + + public static ServerResponseEntity success(Integer code, T data) { + return success(String.valueOf(code), data); + } + + public static ServerResponseEntity success(String code, T data) { + ServerResponseEntity serverResponseEntity = new ServerResponseEntity<>(); + serverResponseEntity.setCode(code); + serverResponseEntity.setData(data); + return serverResponseEntity; + } + + /** + * 前端显示失败消息 + * @param msg 失败消息 + * @return + */ + public static ServerResponseEntity showFailMsg(String msg) { + log.error(msg); + ServerResponseEntity serverResponseEntity = new ServerResponseEntity<>(); + serverResponseEntity.setMsg(msg); + serverResponseEntity.setCode(ResponseEnum.SHOW_FAIL.value()); + return serverResponseEntity; + } + + public static ServerResponseEntity fail(ResponseEnum responseEnum) { + log.error(responseEnum.toString()); + ServerResponseEntity serverResponseEntity = new ServerResponseEntity<>(); + serverResponseEntity.setMsg(responseEnum.getMsg()); + serverResponseEntity.setCode(responseEnum.value()); + return serverResponseEntity; + } + + public static ServerResponseEntity fail(ResponseEnum responseEnum, T data) { + log.error(responseEnum.toString()); + ServerResponseEntity serverResponseEntity = new ServerResponseEntity<>(); + serverResponseEntity.setMsg(responseEnum.getMsg()); + serverResponseEntity.setCode(responseEnum.value()); + serverResponseEntity.setData(data); + return serverResponseEntity; + } + + public static ServerResponseEntity fail(String code, String msg, T data) { + log.error(msg); + ServerResponseEntity serverResponseEntity = new ServerResponseEntity<>(); + serverResponseEntity.setMsg(msg); + serverResponseEntity.setCode(code); + serverResponseEntity.setData(data); + return serverResponseEntity; + } + + public static ServerResponseEntity fail(String code, String msg) { + return fail(code, msg, null); + } + + public static ServerResponseEntity fail(Integer code, T data) { + ServerResponseEntity serverResponseEntity = new ServerResponseEntity<>(); + serverResponseEntity.setCode(String.valueOf(code)); + serverResponseEntity.setData(data); + return serverResponseEntity; + } + + @Override + public String toString() { + return "ServerResponseEntity{" + + "code='" + code + '\'' + + ", msg='" + msg + '\'' + + ", data=" + data + +// ", version='" + version + '\'' + + ", timestamp=" + timestamp + + ", sign='" + sign + '\'' + + '}'; + } +} diff --git a/common/src/main/java/com/huoran/common/utils/JwtUtils.java b/common/src/main/java/com/huoran/common/utils/JwtUtils.java index 7ad49da..3f0fcd7 100644 --- a/common/src/main/java/com/huoran/common/utils/JwtUtils.java +++ b/common/src/main/java/com/huoran/common/utils/JwtUtils.java @@ -15,7 +15,7 @@ public class JwtUtils { public static final long EXPIRE = 1000 * 60 * 600 * 24;//失效时间 public static final String APP_SECRET = "HuoRan2021chenHS25666";//hs256对称加密算法 - public static String getJwtToken(String id){ + public static String getJwtToken(String accountId,Long shopId,Integer platformId){ String JwtToken = Jwts.builder() .setHeaderParam("typ", "JWT") @@ -23,7 +23,9 @@ public class JwtUtils { .setSubject("user") .setIssuedAt(new Date()) .setExpiration(new Date(System.currentTimeMillis() + EXPIRE)) - .claim("accountId", id) + .claim("accountId", accountId) + .claim("shopId", shopId) + .claim("platformId", platformId) .signWith(SignatureAlgorithm.HS256, APP_SECRET) .compact(); @@ -31,7 +33,7 @@ public class JwtUtils { } public static void main(String[] args) { - String jwtToken = getJwtToken("108"); + String jwtToken = getJwtToken("1",1L,1); System.out.println(jwtToken); // boolean jwtToken = checkToken("\n" + diff --git a/common/src/main/java/com/huoran/common/utils/TokenUtils.java b/common/src/main/java/com/huoran/common/utils/TokenUtils.java index 758fe34..6ca1a49 100644 --- a/common/src/main/java/com/huoran/common/utils/TokenUtils.java +++ b/common/src/main/java/com/huoran/common/utils/TokenUtils.java @@ -46,6 +46,26 @@ public class TokenUtils { return (String)claims.get("accountId"); } + public static Integer getShopIdByJwtToken(HttpServletRequest request) { + String jwtToken = request.getHeader("token"); + if(StringUtils.isEmpty(jwtToken)) { + return 0; + } + Jws claimsJws = Jwts.parser().setSigningKey(APP_SECRET).parseClaimsJws(jwtToken); + Claims claims = claimsJws.getBody(); + return (Integer)claims.get("shopId"); + } + + public static Integer getPlatformIdByJwtToken(HttpServletRequest request) { + String jwtToken = request.getHeader("token"); + if(StringUtils.isEmpty(jwtToken)) { + return 0; + } + Jws claimsJws = Jwts.parser().setSigningKey(APP_SECRET).parseClaimsJws(jwtToken); + Claims claims = claimsJws.getBody(); + return (Integer)claims.get("platformId"); + } + /** * 根据token获取账号id */ diff --git a/nakadai/pom.xml b/nakadai/pom.xml index dfe5eee..6c6b0ba 100644 --- a/nakadai/pom.xml +++ b/nakadai/pom.xml @@ -129,7 +129,7 @@ easypoi-annotation - + nakadai-1.0.0 diff --git a/nakadai/src/main/java/com/huoran/nakadai/config/AdminBeanConfig.java b/nakadai/src/main/java/com/huoran/nakadai/config/AdminBeanConfig.java new file mode 100644 index 0000000..8df899a --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/config/AdminBeanConfig.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.config; + +import cn.hutool.core.lang.Snowflake; +import lombok.AllArgsConstructor; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * @author lanhai + */ +@Configuration +@AllArgsConstructor +public class AdminBeanConfig { + + private final AdminConfig adminConfig; + + @Bean + public Snowflake snowflake() { + return new Snowflake(adminConfig.getWorkerId(), adminConfig.getDatacenterId()); + } +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/config/AdminConfig.java b/nakadai/src/main/java/com/huoran/nakadai/config/AdminConfig.java new file mode 100644 index 0000000..089db71 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/config/AdminConfig.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.config; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.PropertySource; +import org.springframework.stereotype.Component; + + +/** + * 商城配置文件 + * @author lgh + */ +@Data +@Component +@PropertySource("classpath:admin.properties") +@ConfigurationProperties(prefix = "admin") +public class AdminConfig { + + /** + * 数据中心ID + */ + private Integer datacenterId; + + /** + * 终端ID + */ + private Integer workerId; + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/AppletsCustomerController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/AppletsCustomerController.java deleted file mode 100644 index 7173acb..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/AppletsCustomerController.java +++ /dev/null @@ -1,132 +0,0 @@ - package com.huoran.nakadai.controller; - - import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; - import com.huoran.common.constant.DelConstant; - import com.huoran.common.exception.ExceptionEnum; - import com.huoran.common.response.R; - import com.huoran.common.utils.PageUtils; - import com.huoran.common.utils.TokenUtils; - import com.huoran.nakadai.entity.*; - import com.huoran.nakadai.entity.req.CustomerListReq; - import com.huoran.nakadai.entity.req.CustomerReq; - import com.huoran.nakadai.entity.req.ListOfClientCommercialManagersReq; - import com.huoran.nakadai.entity.res.*; - import com.huoran.nakadai.mapper.CustomerMapper; - import com.huoran.nakadai.mapper.HrStaffMapper; - import com.huoran.nakadai.service.*; - import io.swagger.annotations.Api; - import io.swagger.annotations.ApiOperation; - import io.swagger.annotations.ApiParam; - import org.springframework.beans.factory.annotation.Autowired; - import org.springframework.web.bind.annotation.*; - - import javax.servlet.http.HttpServletRequest; - import javax.validation.Valid; - import java.util.ArrayList; - import java.util.List; - import java.util.UUID; - import java.util.concurrent.ExecutionException; - - - @Api(value = "小程序-客户管理", tags = "小程序-客户管理") - @RestController - @RequestMapping("/nakadai/applets/customer") - public class AppletsCustomerController { - - @Autowired - private ICustomerService iCustomerService; - - @Autowired - private PartnerAccountService partnerAccountService; - - - @Autowired - private PartnerTeamService partnerTeamService; - - - @Autowired - private PartnerClassificationService partnerClassificationService; - - - - @ApiOperation(value = "我的客户/团队全部客户",response = AppletsMyClientsForBusinessResp.class) - @PostMapping("/customerList") - public R allClientsOfTheTeam(@RequestBody ListOfClientCommercialManagersReq req) { - return iCustomerService.getCustomerListBasedOnBusinessManagerId(req); - } - - - - - - /* @ApiOperation(value = "根据商务经理id获取客户列表", notes = "根据商务经理id获取客户列表",response = AppletsMyClientsForBusinessResp.class) - @PostMapping("/getCustomerListBasedOnBusinessManagerId") - public R getCustomerListBasedOnBusinessManagerId(@RequestBody ListOfClientCommercialManagersReq req) { - return iCustomerService.getCustomerListBasedOnBusinessManagerId(req); - } - - - @ApiOperation(value = "团队全部客户", notes = "团队全部客户所需参数:(businessManagerIds、keywords、customerType及分页参数)",response = AppletsMyClientsForBusinessResp.class) - @PostMapping("/allClientsOfTheTeam") - public R allClientsOfTheTeam(@RequestBody ListOfClientCommercialManagersReq req) { - //根据团队id获取团队下所有成员的商务经理id - List getMembersUnderTheSameTeam = partnerTeamService.getMembersUnderTheSameTeam(req.getClassificationId()); - req.setBusinessManagerIds(getMembersUnderTheSameTeam); - - return iCustomerService.getCustomerListBasedOnBusinessManagerId(req); - }*/ - - - @ApiOperation(value = "根据token获取当前用户的团队信息", notes = "根据token获取当前用户的团队信息",response = PartnerAccountResp.class) - @PostMapping("/getTeamsByAccountId") - public R getTeamsByAccountId(HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - if (accountId.equals("")){ - return R.error("Token不存在"); - } - return partnerAccountService.getTeamsByAccountId(Integer.valueOf(accountId)); - } - - /*@ApiOperation("依据团队id查询团队下的全部商务经理(集合)") - @PostMapping("/getTheBusinessManagerIdsUnderTheTeam") - public List selectCategoryChildById(Integer id) { - List businessManagerIds = new ArrayList<>(); - //1 创建list集合,用于封装所有删除菜单id值 - List idList = new ArrayList<>(); - //2 向idList集合设置删除菜单id - this.selectCategoryChildById(id + "", idList);//找到当前菜单的子菜单 把结果id封装到idlist里面去 - //把当前id封装到list里面 - idList.add(id);//现在把当前id封装进去 之前都是子菜单的id - String str = ""; - for (Integer idstr : idList) { - str += idstr + ","; - } - - if (!str.equals("")){ - //依据团队id查询商务经理id(集合) - businessManagerIds = partnerClassificationService.queryBusinessManagerIdBasedOnTeamId(str.substring(0,str.length()-1)); - } - return businessManagerIds; - } - - //2 根据当前菜单id,查询菜单里面子菜单id,封装到list集合 - public void selectCategoryChildById(String id, List idList) { - //查询菜单里面子菜单id - QueryWrapper wrapper = new QueryWrapper(); - wrapper.eq("parent_id", id); - wrapper.eq("is_del", 0); - wrapper.eq("is_team", 0); - wrapper.select("id");//我们只想查询id 所以只需要查询指定列的值 - List childIdList = partnerClassificationService.list(wrapper);//当前菜单的所有子菜单 - //把childIdList里面菜单id值获取出来,封装idList里面,做递归查询 - childIdList.stream().forEach(item -> {//遍历集合得到每一个对象item - //封装idList里面 - idList.add(item.getId()); - //递归查询 - this.selectCategoryChildById(item.getId() + "", idList); - }); - }*/ - - - - } diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/AppletsOrderController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/AppletsOrderController.java deleted file mode 100644 index 4c556f8..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/AppletsOrderController.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.huoran.nakadai.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.huoran.common.response.R; -import com.huoran.nakadai.entity.Order; -import com.huoran.nakadai.entity.req.DeleteIds; -import com.huoran.nakadai.entity.req.ListOfClientCommercialManagersReq; -import com.huoran.nakadai.entity.req.OrderListReq; -import com.huoran.nakadai.entity.req.OrderRecordParametersReq; -import com.huoran.nakadai.entity.res.AppletsMyClientsForBusinessResp; -import com.huoran.nakadai.entity.res.ExportSubscribedRecordsResp; -import com.huoran.nakadai.entity.vo.OrderVo; -import com.huoran.nakadai.service.IOrderService; -import com.huoran.nakadai.service.PartnerTeamService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import java.util.HashMap; -import java.util.List; -import java.util.concurrent.ExecutionException; - - -@Api(value = "小程序-订单", tags = "小程序-订单") -@RestController -@RequestMapping("/nakadai/applets/order") -public class AppletsOrderController { - - @Autowired - private IOrderService orderService; - - @Autowired - private PartnerTeamService partnerTeamService; - - - @ApiOperation(value = "我的订单/团队订单",response = Order.class) - @PostMapping("/orderList") - public R allTeamOrders(@RequestBody ListOfClientCommercialManagersReq req) { - return orderService.getOrderBasedOnBusinessManagerId(req); - } - - - @ApiOperation(value = "小程序订单记录",response = Order.class) - @PostMapping("/miniProgramOrderRecord") - public R miniProgramOrderRecord(@RequestBody OrderRecordParametersReq req) { - return orderService.miniProgramOrderRecord(req); - } - -} diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/AppletsPartnerController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/AppletsPartnerController.java deleted file mode 100644 index 7e89bbb..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/AppletsPartnerController.java +++ /dev/null @@ -1,118 +0,0 @@ -package com.huoran.nakadai.controller; - -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.nakadai.entity.PartnerArticleFile; -import com.huoran.nakadai.entity.PartnerArticleManagement; -import com.huoran.nakadai.entity.PartnerArticleStatistic; -import com.huoran.nakadai.entity.req.SalesProgressReq; -import com.huoran.nakadai.entity.res.AnnualOperatingAnalysisResp; -import com.huoran.nakadai.service.*; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.data.redis.core.ValueOperations; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; - - -@Api(value = "小程序-合伙人", tags = "小程序-合伙人") -@RestController -@RequestMapping("/nakadai/applets/partner") -public class AppletsPartnerController { - - @Autowired - private ICustomerService iCustomerService; - - @Autowired - private PartnerAccountService partnerAccountService; - - - @Autowired - private PartnerTeamService partnerTeamService; - - @Autowired - public PartnerArticleManagementService articleManagementService; - @Autowired - public PartnerArticleFileService fileService; - - @Autowired - public PartnerArticleLabelService labelService; - - - @Autowired - public PartnerArticleStatisticService articleStatisticService; - - @Autowired - public PartnerArticleClassificationService articleClassificationService; - - @Autowired - private StringRedisTemplate redisTemplate; - @Autowired - private PartnerClassificationService partnerClassificationService; - - @ApiOperation(value = "销售进展") - @PostMapping("/salesProgress") - public R salesProgress(@RequestBody SalesProgressReq req) { - - //customerType 客户类型(1、正式 2、试用 3、到期 - req.setCustomerType(2); - //试用产品 - Integer trialProduct = iCustomerService.newProductAddedToOrder(req); - //试用用户 - Integer trialUser = iCustomerService.newCustomerOnOrder(req); - req.setCustomerType(1); - //正式用户 - Integer regularUser = iCustomerService.newCustomerOnOrder(req); - //正式产品 - Integer officialProduct = iCustomerService.newProductAddedToOrder(req); - - return R.ok().put("trialUser", trialUser). - put("regularUser", regularUser). - put("trialProduct", trialProduct). - put("officialProduct", officialProduct); - } - - - @ApiOperation(value = "预览学习(增加浏览次数)") - @PostMapping("/browse") - public R browse(@ApiParam(name = "contentId", value = "文章id", required = true) @RequestParam Integer contentId, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - List fileList = fileService.getFileByContentId(contentId); - PartnerArticleManagement partnerArticleManagement = articleManagementService.getById(contentId); - partnerArticleManagement.setFileList(fileList); - partnerArticleManagement.setClassificationNameList(articleClassificationService.categoryIdsQueriesCategoryInformation(partnerArticleManagement.getClassificationId() + "")); - partnerArticleManagement.setLabelNameList((labelService.idsQueriesLabelInformation(partnerArticleManagement.getLableId() + ""))); - partnerArticleManagement.setTotalBrowsing(articleStatisticService.statisticsOfVisitors(contentId)); - - //存浏览的文章 用于返回上次浏览的文章 - ValueOperations opsForString = redisTemplate.opsForValue(); - String key = "browse:accountId=" + accountId; - //将数据存入缓存 - opsForString.set(key, contentId + ""); - - //增加浏览记录 - PartnerArticleStatistic statistic = new PartnerArticleStatistic(); - statistic.setAccountId(Integer.valueOf(accountId)); - statistic.setContentId(contentId); - //判断是否存在浏览记录过 返回true表示可新增 需求:已学习人数即一个用户点多次只算一次,不重复计算 - boolean flag = articleStatisticService.checkForExistence(statistic); - if (flag) { - articleStatisticService.save(statistic); - } - return R.ok(partnerArticleManagement); - } - - - @ApiOperation(value = "年度经营分析", response = AnnualOperatingAnalysisResp.class) - @PostMapping("/annualOperatingAnalysis") - public R annualOperatingAnalysis(@RequestBody SalesProgressReq req, HttpServletRequest request) { - String jwtToken = request.getHeader("token"); - System.out.println("token:{}{}{}{}{}"+jwtToken); - return R.ok().put("data", iCustomerService.annualOperatingAnalysis(req)); - } -} diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/CategoryController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/CategoryController.java new file mode 100644 index 0000000..29d3b0e --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/controller/CategoryController.java @@ -0,0 +1,159 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.controller; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.huoran.common.exception.YamiShopBindException; +import com.huoran.common.response.ServerResponseEntity; +import com.huoran.common.utils.TokenUtils; +import com.huoran.nakadai.entity.app.dto.CategoryDto; +import com.huoran.nakadai.entity.model.Category; +import com.huoran.nakadai.entity.model.Product; +import com.huoran.nakadai.service.CategoryService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import java.util.Date; +import java.util.List; +import java.util.Objects; + +/** + * @author lanhai + */ +@RestController +@RequestMapping("/category") +@Api(tags = "商品分类管理") +public class CategoryController { + + @Autowired + private CategoryService categoryService; + + + /** + * 分类信息列表接口 + */ + @GetMapping("/categoryInfo") + @ApiOperation(value = "根据父id查询分类列表") + public ServerResponseEntity> categoryInfo( + @RequestParam(value = "parentId", defaultValue = "0") Long parentId) { + List categories = categoryService.listByParentId(parentId); + List categoryDtos = BeanUtil.copyToList(categories, CategoryDto.class); + return ServerResponseEntity.success(categoryDtos); + } + + + /** + * 获取菜单页面的表 + * @return + */ + @GetMapping("/list") + @ApiOperation(value = "获取店铺所有分类列表") + public ServerResponseEntity> table(HttpServletRequest request){ + List categoryMenuList = categoryService.tableCategory(TokenUtils.getShopIdByJwtToken(request)); + return ServerResponseEntity.success(categoryMenuList); + } + + /** + * 获取分类信息 + */ + @GetMapping("/info") + @ApiOperation(value = "获取分类信息") + public ServerResponseEntity info(@RequestParam("categoryId") Long categoryId){ + Category category = categoryService.getById(categoryId); + return ServerResponseEntity.success(category); + } + + + + /** + * 保存分类 + */ + @PostMapping("/save") + @ApiOperation(value = "保存分类信息") + public ServerResponseEntity save(@RequestBody Category category,HttpServletRequest request){ + category.setShopId(TokenUtils.getShopIdByJwtToken(request)); + category.setRecTime(new Date()); + Category categoryName = categoryService.getOne(new LambdaQueryWrapper().eq(Category::getCategoryName,category.getCategoryName()) + .eq(Category::getShopId,category.getShopId())); + if(categoryName != null){ + throw new YamiShopBindException("类目名称已存在!"); + } + categoryService.saveCategory(category); + return ServerResponseEntity.success(); + } + + /** + * 更新分类 + */ + @PostMapping("/update") + @ApiOperation(value = "更新分类信息") + public ServerResponseEntity update(@RequestBody Category category,HttpServletRequest request){ + category.setShopId(TokenUtils.getShopIdByJwtToken(request)); + if (Objects.equals(category.getParentId(),category.getCategoryId())) { + return ServerResponseEntity.showFailMsg("分类的上级不能是自己本身"); + } + Category categoryName = categoryService.getOne(new LambdaQueryWrapper().eq(Category::getCategoryName,category.getCategoryName()) + .eq(Category::getShopId,category.getShopId()).ne(Category::getCategoryId,category.getCategoryId())); + if(categoryName != null){ + throw new YamiShopBindException("类目名称已存在!"); + } + Category categoryDb = categoryService.getById(category.getCategoryId()); + // 如果从下线改成正常,则需要判断上级的状态 + if (Objects.equals(categoryDb.getStatus(),0) && Objects.equals(category.getStatus(),1) && !Objects.equals(category.getParentId(),0L)){ + Category parentCategory = categoryService.getOne(new LambdaQueryWrapper().eq(Category::getCategoryId, category.getParentId())); + if(Objects.isNull(parentCategory) || Objects.equals(parentCategory.getStatus(),0)){ + // 修改失败,上级分类不存在或者不为正常状态 + throw new YamiShopBindException("修改失败,上级分类不存在或者不为正常状态"); + } + } + categoryService.updateCategory(category); + return ServerResponseEntity.success(); + } + + /** + * 删除分类 + */ + @PostMapping("/delete") + @ApiOperation(value = "删除分类信息") + public ServerResponseEntity delete(@RequestParam("categoryId") Long categoryId){ + if (categoryService.count(new LambdaQueryWrapper().eq(Category::getParentId,categoryId)) >0) { + return ServerResponseEntity.showFailMsg("请删除子分类,再删除该分类"); + } + categoryService.deleteCategory(categoryId); + return ServerResponseEntity.success(); + } + + /** + * 所有的 + */ + @GetMapping("/listCategory") + public ServerResponseEntity> listCategory(HttpServletRequest request){ + return ServerResponseEntity.success(categoryService.list(new LambdaQueryWrapper() + .le(Category::getGrade, 2) + .eq(Category::getShopId, TokenUtils.getShopIdByJwtToken(request)) + .orderByAsc(Category::getSeq))); + } + + /** + * 所有的产品分类 + */ + @GetMapping("/listProdCategory") + public ServerResponseEntity> listProdCategory(HttpServletRequest request){ + List categories = categoryService.treeSelect(TokenUtils.getShopIdByJwtToken(request),2); + return ServerResponseEntity.success(categories); + } + + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/CommentController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/CommentController.java deleted file mode 100644 index 9949790..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/CommentController.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.huoran.nakadai.controller; - - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.api.UserClient; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.nakadai.config.filter.SensitiveFilter; -import com.huoran.nakadai.entity.Comment; -import com.huoran.nakadai.entity.Notify; -import com.huoran.nakadai.entity.res.CommentRes; -import com.huoran.nakadai.service.CommentService; -import com.huoran.nakadai.service.NotifyService; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.io.IOException; - -/** - *

- * 课程评论回复表 前端控制器 - *

- * - * @author chen - * @since 2023-05-25 - */ -@Api(value = "C-课程评论回复管理", tags = "C-课程评论回复管理") -@RestController -@RequestMapping("/comment") -public class CommentController { - - @Autowired - private CommentService commentService; - - @Autowired - private NotifyService notifyService; - -// @Autowired -// private WebsocketService webSocketService; - - @Autowired - private UserClient userClient; - - @ApiOperation(value = "课程评论树列表", response = CommentRes.class) - @GetMapping("/commentTreeList") - public R commentTreeList( - @ApiParam(name = "mallId", value = "商品id", required = true) - @RequestParam Integer mallId, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - return commentService.commentTreeList(mallId,schoolId,accountId); - } - - @ApiOperation(value = "添加课程评论") - @PostMapping("/addComment") - public R addComment( - @ApiParam(name = "comment", value = "评论内容", required = true) - @RequestBody Comment comment, HttpServletRequest request) throws IOException { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - comment.setSchoolId(schoolId); - comment.setCreateAccountId(Integer.valueOf(accountId)); - SensitiveFilter filter = SensitiveFilter.getInstance(); - //需要过滤则用“”替换,如果需要屏蔽,则用“*”替换 - String content = filter.replaceSensitiveWord(comment.getContent(), 2, "*"); - comment.setContent(content); - boolean save = commentService.save(comment); - - if (save && comment.getReplyAccountId()!=null && !comment.getReplyAccountId().equals(Integer.valueOf(accountId))){ - //添加回复通知 - if (comment.getStatus()==2){ - //同一条评论消息未读,再次评论不通知 - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("is_read",0); - wrapper.eq("comment_id",comment.getReplyCommentId()); - wrapper.eq("account_id",comment.getReplyAccountId()); - wrapper.eq("comment_account_id",Integer.valueOf(accountId)); - Notify one = notifyService.getOne(wrapper); - if (ObjectUtil.isNull(one)){ - Notify notify = new Notify(); - notify.setType(2); - notify.setAccountId(comment.getReplyAccountId()); - notify.setCommentId(comment.getReplyCommentId()); - notify.setCommentAccountId(Integer.valueOf(accountId)); - notifyService.save(notify); - } - } - } - - // 发送webSocket消息 -// if (comment.getReplyAccountId()!=null){ -// WebsocketMsgDTO websocketMsgDTO = new WebsocketMsgDTO(); -// websocketMsgDTO.setForm(accountId); -// websocketMsgDTO.setUsername(accountId); -// websocketMsgDTO.setTo(comment.getReplyAccountId().toString()); -// websocketMsgDTO.setContent(comment.getContent()); -// websocketMsgDTO.setExtras(null); -// webSocketService.send(websocketMsgDTO); -// } - - return save ? R.ok() : R.error(); - } - - - @ApiOperation(value = "删除评论") - @PostMapping("/deleteAComment") - public R deleteAComment( - @ApiParam(name = "commentId", value = "评论id", required = true) - @RequestParam Integer commentId) { - return commentService.removeChildById(commentId); - } - - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/CommentLikeController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/CommentLikeController.java deleted file mode 100644 index 4482491..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/CommentLikeController.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.huoran.nakadai.controller; - - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.nakadai.entity.Comment; -import com.huoran.nakadai.entity.CommentLike; -import com.huoran.nakadai.entity.Notify; -import com.huoran.nakadai.service.CommentLikeService; -import com.huoran.nakadai.service.CommentService; -import com.huoran.nakadai.service.NotifyService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import javax.servlet.http.HttpServletRequest; - -/** - *

- * 课程评论点赞表 前端控制器 - *

- * - * @author chen - * @since 2023-05-25 - */ -@Api(value = "C-课程评论点赞管理", tags = "C-课程评论点赞管理") -@RestController -@RequestMapping("/commentLike") -public class CommentLikeController { - - @Autowired - private CommentLikeService commentLikeService; - - @Autowired - private CommentService commentService; - - @Autowired - private NotifyService notifyService; - - @ApiOperation(value = "评论点赞") - @PostMapping("/commentAndLike") - public R commentAndLike( - @ApiParam(name = "commentId", value = "评论id", required = true) - @RequestParam Integer commentId, HttpServletRequest request) { - CommentLike commentLike = new CommentLike(); - commentLike.setCommentId(commentId); - String accountId = TokenUtils.getIdByJwtToken(request); - commentLike.setAccountId(Integer.valueOf(accountId)); - boolean save = commentLikeService.save(commentLike); - - if (save){ - Comment comment = commentService.getById(commentId); - //添加点赞通知 - Notify notify = new Notify(); - notify.setType(1); - notify.setAccountId(comment.getCreateAccountId()); - notify.setCommentId(comment.getCommentId()); - notify.setCommentAccountId(Integer.valueOf(accountId)); - notifyService.save(notify); - - } - return save ? R.ok() : R.error(); - } - - @ApiOperation(value = "取消点赞") - @PostMapping("/unlike") - public R unlike( - @ApiParam(name = "commentId", value = "评论id", required = true) - @RequestParam Integer commentId, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - boolean remove = commentLikeService.remove(new QueryWrapper().eq("comment_id", commentId). - eq("account_id", accountId)); - - //删除点赞通知 - notifyService.remove(new QueryWrapper().eq("comment_id", commentId). - eq("comment_account_id", accountId)); - return remove ? R.ok() : R.error(); - } - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/CurriculumChapterController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/CurriculumChapterController.java deleted file mode 100644 index 88310c8..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/CurriculumChapterController.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.huoran.nakadai.controller; - - -import com.huoran.common.response.R; -import com.huoran.nakadai.entity.CurriculumChapter; -import com.huoran.nakadai.entity.vo.ChapterVO; -import com.huoran.nakadai.entity.vo.SortVO; -import com.huoran.nakadai.service.CurriculumChapterService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.Date; -import java.util.List; - -/** - *

- * 企业课程章节表 前端控制器 - *

- * - * @author lr - * @since 2021-09-26 - */ -@Api(description = "课程章节管理", tags = "课程章节管理") -@RestController -@RequestMapping("/nakadai/curriculum/chapter") -public class CurriculumChapterController { - @Autowired - private CurriculumChapterService curriculumChapterService; - - @ApiOperation(value = "根据课程id查询章节小节,树状结构") - @GetMapping("/queryChaptersAndSubsections/{courseId}") - public R queryChaptersAndSubsections( - @ApiParam(name = "courseId", value = "课程ID", required = true) - @PathVariable String courseId) { - List chapterList = curriculumChapterService.getChapterTree(courseId); - return R.ok().put("chapterList", chapterList); - } - - @ApiOperation(value = "编辑排序") - @PostMapping("/reorder") - public R chapterReorder( - @ApiParam(name = "sortVO", value = "章节小节重排序对象", required = true) - @RequestBody SortVO sortVO) { - boolean update = curriculumChapterService.updateSort(sortVO); - return update ? R.ok() : R.error(); - - } - - @ApiOperation(value = "添加章节") - @PostMapping("/addChapter") - public R addChapter( - @ApiParam(name = "courseChapter", value = "章节对象", required = true) - @RequestBody CurriculumChapter chapter) { - //判重 - boolean isRepeat = curriculumChapterService.repeat(chapter); - if (isRepeat) { - return R.error("章节已存在"); - } - boolean save = curriculumChapterService.saveChapter(chapter); - return save ? R.ok() : R.error(); - } - - @ApiOperation(value = "修改章节") - @PutMapping("/editChapter") - public R editChapter( - @ApiParam(name = "courseChapter", value = "章节对象", required = true) - @RequestBody CurriculumChapter chapter) { - boolean update = curriculumChapterService.updateById(chapter); - return update ? R.ok() : R.error(); - } - - @ApiOperation(value = "根据id删除章节") - @DeleteMapping("/deleteChapter/{chapterId}") - public R deleteChapter( - @ApiParam(name = "chapterId", value = "章节ID", required = true) - @PathVariable Integer chapterId) { - boolean remove = curriculumChapterService.removeChapter(chapterId); - return remove ? R.ok() : R.error(); - } -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/CurriculumController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/CurriculumController.java deleted file mode 100644 index 9679720..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/CurriculumController.java +++ /dev/null @@ -1,246 +0,0 @@ -package com.huoran.nakadai.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.api.UserClient; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.nakadai.entity.Curriculum; -import com.huoran.nakadai.entity.CurriculumConfigure; -import com.huoran.nakadai.entity.CurriculumRecentUse; -import com.huoran.nakadai.entity.req.AddCurriculumReq; -import com.huoran.nakadai.entity.req.ModifyCurriculumReq; -import com.huoran.nakadai.entity.req.PageCurriculumRecentUseReq; -import com.huoran.nakadai.entity.req.PageCurriculumReq; -import com.huoran.nakadai.service.CurriculumRecentUseService; -import com.huoran.nakadai.service.ICurriculumConfigureService; -import com.huoran.nakadai.service.ICurriculumService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.apache.ibatis.annotations.Param; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import java.util.Date; -import java.util.List; - -/** - * @描述:课程管理控制类 - * @作者: Rong - * @日期: 2021-09-16 - */ -@RestController -@RequestMapping("/nakadai/curriculum") -@Api(value = "API - 课程管理", tags = "课程管理") -public class CurriculumController { - - @Autowired - public ICurriculumService service; - - @Autowired - public ICurriculumConfigureService configureService; - - @Autowired - private UserClient userClient; - - @Autowired - private CurriculumRecentUseService restoreUseService; - - /** - * @Description: 创建课程 - * @auther: Rong - * @date: 2021/9/17 10:42 - */ - @PostMapping("/createCurriculum") - @ApiOperation(value = "创建课程", response = Curriculum.class) - public R createCurriculum(@RequestBody @Valid AddCurriculumReq curriculum, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - curriculum.setAccountId(Integer.valueOf(accountId)); - curriculum.setSchoolId(schoolId); - return service.createCurriculum(curriculum); - } - - /** - * @Description: 编辑课程 - * @auther: Rong - * @date: 2021/9/22 14:54 - */ - @PostMapping("/modifyCourse") - @ApiOperation(value = "编辑课程", response = Curriculum.class) - public R modifyCourse(@RequestBody @Valid ModifyCurriculumReq curriculum, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - curriculum.setAccountId(Integer.valueOf(accountId)); - return service.modifyCourse(curriculum); - } - - - @PostMapping("/isDisable") - @ApiOperation(value = "禁启用课程", response = Curriculum.class) - public R isDisable(@RequestParam @Param(value = "课程id") Integer cid, @RequestParam @Param(value = "是否启用(0启用,1未启用)") Integer isEnable, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - boolean ret = service.updateById(new Curriculum().setIsEnable(isEnable).setCid(cid)); - return ret ? R.ok() : R.error(); - } - - @PostMapping("/isShelves") - @ApiOperation(value = "上下架课程", response = Curriculum.class) - public R isShelves(@RequestParam @Param(value = "课程id") Integer cid, @RequestParam @Param(value = "上下架(0下架 1上架 默认 1)") Integer isShelves, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - boolean ret = service.updateById(new Curriculum().setIsShelves(isShelves).setCid(cid)); - return ret ? R.ok() : R.error(); - } - - /** - * @Description: 删除课程 - * @auther: Rong - * @date: 2021/9/22 14:54 - */ - @PostMapping("/delCourse") - @ApiOperation(value = "单个、批量删除课程", response = Curriculum.class) - public R delCourse(@RequestParam List cids, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - return service.delCourse(cids); - } - - @PostMapping("/deleteCoursePrompt") - @ApiOperation(value = "删除课程提示", response = Curriculum.class) - public R deleteCoursePrompt(@RequestParam List cids) { - return service.deleteCoursePrompt(cids); - } - - @PostMapping("/curriculumList") - @ApiOperation(value = "课程列表", response = Curriculum.class) - public R createCourse(@RequestBody @Valid PageCurriculumReq req, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - req.setAccountId(Integer.valueOf(accountId)); - req.setSchoolId(schoolId); - return service.curriculumList(req); - } - - - @PostMapping("/curriculumListForBeforeLogin") - @ApiOperation(value = "课程列表", response = Curriculum.class) - public R curriculumListForBeforeLogin(@RequestBody @Valid PageCurriculumReq req) { - return service.curriculumList(req); - } - - @GetMapping("/schoolCourse") - @ApiOperation(value = "获取学校购买订单后的课程", response = Curriculum.class) - public R schoolCourse(HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - return service.schoolCourse(schoolId); - } - - - @GetMapping("/getSchoolEffectiveCourse") - @ApiOperation(value = "获取学校有效期内购买订单后的课程(变更后为产品)", response = Curriculum.class) - public R getSchoolEffectiveCourse(HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - return service.getSchoolEffectiveCourse(schoolId); - } - - @GetMapping("/schoolCourseByAchievement") - @ApiOperation(value = "仅用于教师端成绩管理及学生端实验记录下拉框-获取学校购买订单后的课程", response = Curriculum.class) - public R schoolCourseByAchievement(HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - return service.schoolCourseByAchievement(schoolId); - } - - /** - * - * @param request - * @param mallId - * @return - */ - @GetMapping("/whetherToRenewTheFee") - @ApiOperation(value = "根据商品id查询是否要续费(原:根据课程id查询是否要续费)", response = Curriculum.class) - public R whetherToRenewTheFee(HttpServletRequest request, @RequestParam @Param(value = "商品id(mallId)") Integer mallId) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - return service.whetherToRenewTheFee(schoolId, mallId); - } - - @GetMapping("/projectListByCourseId") - @ApiOperation(value = "根据课程id获取实训项目列表", response = Curriculum.class) - public R projectListByCourseId(@RequestParam @Param(value = "课程id(cid)") Integer cid, - @RequestParam @Param(value = "项目权限(0、练习 1、考核)") Integer permissions, - @RequestParam(required = false) @Param(value = "项目名称") String projectName, - HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - return configureService.projectListByCourseId(cid, permissions, projectName); - } - - @PostMapping("/curriculumDetail") - @ApiOperation(value = "课程详情", response = Curriculum.class) - public R curriculumDetail(@RequestParam @Param(value = "课程id(cid)") Integer cid, - @RequestParam(required = false) Integer mallId, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - - return service.curriculumDetail(cid, mallId); - } - - @GetMapping("/getSystemIdByCustomerId") - @ApiOperation("得到客户所有的系统id openfeign") - public List getSystemIdByCustomerId(@RequestParam Integer customerId) { - return service.getSystemIdByCustomerId(customerId); - } - - @GetMapping("/getSchoolCourse") - @ApiOperation(value = "获取学校购买订单下的产品所绑定的课程(该接口为远程调用接口)", response = Curriculum.class) - public String getSchoolCourse(@RequestParam @Param(value = "schoolId") Integer schoolId) { - return service.getSchoolCourse(schoolId); - } - - @GetMapping("/checkConfig") - @ApiOperation(value = "校验某个项目是否包含在课程配置中", response = CurriculumConfigure.class) - public R checkConfig(@RequestParam @Param(value = "projectId") Integer projectId) { - return configureService.checkConfig(projectId); - } - - - @PostMapping("/recordRecentUsage") - @ApiOperation(value = "记录最近使用", response = CurriculumRecentUse.class) - public R recordRecentUsage(@RequestParam("mallId") @ApiParam(value = "商品id", required = true) @NotNull(message = "商品id不能为空") Integer mallId, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("mall_id", mallId); - queryWrapper.eq("account_id", accountId); - CurriculumRecentUse details = restoreUseService.getOne(queryWrapper); - - if (details == null) { - //新增 - CurriculumRecentUse recentUse = new CurriculumRecentUse(); - recentUse.setEntryTime(new Date()); - recentUse.setMallId(mallId); - recentUse.setAccountId(Integer.valueOf(accountId)); - restoreUseService.save(recentUse); - } else { - details.setEntryTime(new Date()); - restoreUseService.updateById(details); - } - return R.ok(); - } - - @PostMapping("/recentUse") - @ApiOperation(value = "实验台最近使用", response = CurriculumRecentUse.class) - public R recentUse(@RequestBody PageCurriculumRecentUseReq req, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - req.setAccountId(Integer.valueOf(accountId)); - req.setSchoolId(schoolId); - return restoreUseService.recentUse(req); - } -} - - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/CurriculumLearningProgressController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/CurriculumLearningProgressController.java deleted file mode 100644 index 6ef2b19..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/CurriculumLearningProgressController.java +++ /dev/null @@ -1,157 +0,0 @@ -package com.huoran.nakadai.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.api.OccupationlabClient; -import com.huoran.api.UserClient; -import com.huoran.common.entity.ProjectManage; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.nakadai.entity.CurriculumLearningProgress; -import com.huoran.nakadai.entity.vo.ChapterVO; -import com.huoran.nakadai.service.CurriculumChapterService; -import com.huoran.nakadai.service.CurriculumLearningProgressService; -import com.huoran.nakadai.service.ICurriculumConfigureService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.math.BigDecimal; -import java.util.List; - - -/** - * @描述:课程学习进度控制类 - * @作者: Rong - * @日期: 2023-04-25 - */ -@RestController -@RequestMapping("/nakadai/curriculum/learning/progressprogress") -@Api(value = "R-课程学习进度", tags = "R-课程学习进度") -public class CurriculumLearningProgressController { - - @Autowired - private CurriculumChapterService curriculumChapterService; - - @Autowired - public CurriculumLearningProgressService service; - - @Autowired - private UserClient userClient; - @Autowired - public ICurriculumConfigureService configureService; - - - @Autowired - public OccupationlabClient occupationlabClient; - - @ApiOperation(value = "根据课程id查询课程下的项目(含当前用户学习进度)", response = ChapterVO.class) - @PostMapping("/courseLearningProgress") - public R courseLearningProgress(@ApiParam(name = "courseId", value = "课程ID", required = true) @RequestParam String courseId, - @ApiParam(name = "systemId", value = "系统ID", required = true) @RequestParam String systemId, - @ApiParam(name = "mallId", value = "商品id", required = true) @RequestParam Integer mallId - , HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); -// List chapterList = curriculumChapterService.getChapterTree(courseId); - - - //查询课程下绑定的全部项目 (根据课程id获取实训项目列表) String systemId, Integer accountId, Integer permissions, Integer cId, Integer mallId,Integer schoolId - List courseList = configureService.getProjectBySystemIdRemoteCall(systemId, Integer.valueOf(accountId), 0, Integer.valueOf(courseId), mallId, schoolId); - //统计本课程下全部项目数量 - double statisticalSummary = 0; - if (courseList != null) { - statisticalSummary = courseList.size(); - } - - - //统计已经记录的本课程下的项目数量 - double learningQuantity = 0; - - //查询本人学习当前课程下已经学习的项目学习记录 - List curriculumLearningProgresses = service.curriculumLearningProgresses(Integer.valueOf(accountId), courseId); - for (ProjectManage infoRes : courseList) { - if (curriculumLearningProgresses.size() > 0) { - for (CurriculumLearningProgress programProgress : curriculumLearningProgresses) { - if (infoRes.getProjectId().equals(programProgress.getProjectId())) { - //是否学习(0未学习 1已学习) - infoRes.setWhetherToStudyOrNot(1); - infoRes.setLearningProgressId(programProgress.getId()); - learningQuantity++; - - } - - - } - } - } - double schedule = 0.0; - if (learningQuantity != 0.0 && statisticalSummary != 0.0) { - schedule = (learningQuantity / statisticalSummary) * 100; - } - - BigDecimal bg = new BigDecimal(schedule); - double f1 = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); - return R.ok(courseList).put("schedule", f1 + "%").put("plan", (int) learningQuantity + "/" + (int) statisticalSummary); - } - - - @PostMapping("/findById") - @ApiOperation(value = "查询详情", response = CurriculumLearningProgress.class) - public R findById(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { - CurriculumLearningProgress curriculumLearningProgress = service.getById(id); - return R.ok().put("data", curriculumLearningProgress); - } - - - @PostMapping("/save") - @ApiOperation(value = "新增", response = CurriculumLearningProgress.class) - public R save(@RequestBody @ApiParam(name = "课程学习进度对象", value = "传入json格式", required = true) CurriculumLearningProgress curriculumLearningProgress, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - curriculumLearningProgress.setSchoolId(schoolId); - curriculumLearningProgress.setAccountId(Integer.valueOf(accountId)); - - QueryWrapper qwrap = new QueryWrapper<>(); - qwrap.eq("cid", curriculumLearningProgress.getCid()); - /*qwrap.eq("chapter_id", curriculumLearningProgress.getChapterId()); - qwrap.eq("subsection_id", curriculumLearningProgress.getSubsectionId());*/ - qwrap.eq("project_id", curriculumLearningProgress.getProjectId()); - qwrap.eq("account_id", accountId); - qwrap.eq("school_id", schoolId); - - List list = service.list(qwrap); - if (list.size() > 0) { - return R.error("当前项目已被勾选!请刷新重试"); - } - - - boolean addState = service.save(curriculumLearningProgress); - return addState ? R.ok() : R.error("新增失败"); - } - - - @PostMapping("/update") - @ApiOperation(value = "修改", response = CurriculumLearningProgress.class) - public R update(@RequestBody @ApiParam(name = "课程学习进度对象", value = "传入json格式", required = true) CurriculumLearningProgress curriculumLearningProgress, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - curriculumLearningProgress.setSchoolId(schoolId); - curriculumLearningProgress.setAccountId(Integer.valueOf(accountId)); - boolean updateState = service.updateById(curriculumLearningProgress); - return updateState ? R.ok() : R.error("编辑失败"); - } - - - @PostMapping("/delete") - @ApiOperation(value = "删除", response = CurriculumLearningProgress.class) - public R delete(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { - boolean delState = service.removeById(id); - return delState ? R.ok() : R.error("删除失败"); - } - - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/CurriculumNotesController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/CurriculumNotesController.java deleted file mode 100644 index ef16a58..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/CurriculumNotesController.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.huoran.nakadai.controller; - - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.nakadai.entity.CurriculumNotes; -import com.huoran.nakadai.service.CurriculumNotesService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -/** - *

- * 课程笔记表 前端控制器 - *

- * - * @author chen - * @since 2023-05-04 - */ -@Api(value = "课程笔记管理", tags = "课程笔记管理") -@RestController -@RequestMapping("/curriculumNotes") -public class CurriculumNotesController { - - @Autowired - private CurriculumNotesService curriculumNotesService; - - @ApiOperation(value = "添加笔记") - @PostMapping("/addNote") - public R addNote( - @ApiParam(name = "notes", value = "笔记内容", required = true) - @RequestBody CurriculumNotes notes, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - //名称判重 - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("note_name",notes.getNoteName()); - queryWrapper.eq("account_id",accountId); - queryWrapper.eq("cid",notes.getCid()); - CurriculumNotes one = curriculumNotesService.getOne(queryWrapper); - if (ObjectUtil.isNotNull(one)){ - return R.error("笔记名称已存在!"); - } - //新增笔记 - notes.setAccountId(Integer.valueOf(accountId)); - boolean save = curriculumNotesService.save(notes); - return save ? R.ok() : R.error(); - } - - @ApiOperation(value = "更新笔记") - @PostMapping("/updateNote") - public R updateNote( - @ApiParam(name = "notes", value = "笔记内容", required = true) - @RequestBody CurriculumNotes notes) { - boolean update = curriculumNotesService.updateById(notes); - return update ? R.ok() : R.error(); - } - - @ApiOperation(value = "课程笔记列表") - @GetMapping("/curriculumNoteList") - public R curriculumNoteList( - @ApiParam(name = "search", value = "查询条件",required = false) - @RequestParam(required = false) String search, - @ApiParam(name = "cid", value = "课程id") - @RequestParam Integer cid, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("account_id",accountId); - queryWrapper.eq("cid",cid); - queryWrapper.orderByDesc("create_time"); - if (search!=null){ - queryWrapper.like("note_name",search); - } - List curriculumNotes = curriculumNotesService.list(queryWrapper); - return R.ok().put("curriculumNotes",curriculumNotes); - } - - @ApiOperation(value = "删除课程笔记") - @PostMapping("/deleteNotes") - public R deleteNotes( - @ApiParam(name = "noteId", value = "课程笔记id", required = true) - @RequestParam Integer noteId) { - boolean remove = curriculumNotesService.removeById(noteId); - return remove ? R.ok() : R.error(); - } - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/CurriculumSubsectionController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/CurriculumSubsectionController.java deleted file mode 100644 index 3b9f652..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/CurriculumSubsectionController.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.huoran.nakadai.controller; - - -import com.aliyuncs.exceptions.ClientException; -import com.huoran.common.response.R; -import com.huoran.nakadai.entity.CurriculumSubsection; -import com.huoran.nakadai.service.CurriculumSubsectionService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.Date; - -/** - *

- * 企业课程小节表 前端控制器 - *

- * - * @author lr - * @since 2021-09-26 - */ -@RestController -@Api(description = "课程小节管理", tags = "课程小节管理") -@RequestMapping("/nakadai/curriculum/subsection") -public class CurriculumSubsectionController { - @Autowired - private CurriculumSubsectionService curriculumSubsectionService; - - @ApiOperation(value = "添加小节") - @PostMapping("/addSubsection") - public R addSubsection( - @ApiParam(name = "courseSubsection", value = "小节对象", required = true) - @RequestBody CurriculumSubsection curriculumSubsection) { - //判重 - boolean isRepeat = curriculumSubsectionService.repeat(curriculumSubsection); - if (isRepeat) { - return R.error("小节已存在"); - } - boolean save = curriculumSubsectionService.saveSubsection(curriculumSubsection); - return save ? R.ok() : R.error(); - } - - @ApiOperation(value = "修改小节") - @PutMapping("/editSubsection") - public R editSubsection( - @ApiParam(name = "courseSubsection", value = "小节对象", required = true) - @RequestBody CurriculumSubsection courseSubsection) { - boolean update = curriculumSubsectionService.updateById(courseSubsection); - return update ? R.ok() : R.error(); - } - - @ApiOperation(value = "根据id删除小节") - @DeleteMapping("/deleteSubsection/{subsectionId}") - public R deleteSubsection( - @ApiParam(name = "subsectionId", value = "小节ID", required = true) - @PathVariable String subsectionId) throws ClientException { - boolean remove = curriculumSubsectionService.removeSubsection(subsectionId); - return remove ? R.ok() : R.error(); - } - - @ApiOperation(value = "根据小节id获取预览文件地址") - @GetMapping("/getSubsection/{subsectionId}") - public R getSubsection( - @ApiParam(name = "subsectionId", value = "小节ID", required = true) - @PathVariable String subsectionId) { - String officeUrl = "https://view.officeapps.live.com/op/view.aspx?src="; - // String xDocUrl = "http://view.xdocin.com/xdoc?_xdoc="; - CurriculumSubsection courseSubsection = curriculumSubsectionService.getById(subsectionId); - if (courseSubsection != null) { - String fileUrl = courseSubsection.getFileUrl(); - String previewUrl = officeUrl + fileUrl; - return R.ok().put("previewUrl", previewUrl); - } else { - return R.error(); - } - } - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/CustomerController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/CustomerController.java deleted file mode 100644 index ac1a907..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/CustomerController.java +++ /dev/null @@ -1,358 +0,0 @@ -package com.huoran.nakadai.controller; - -import cn.afterturn.easypoi.excel.ExcelExportUtil; -import cn.afterturn.easypoi.excel.entity.ExportParams; -import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.api.NakadaiClient; -import com.huoran.api.UserClient; -import com.huoran.common.constant.DelConstant; -import com.huoran.common.exception.ExceptionEnum; -import com.huoran.common.response.R; -import com.huoran.common.utils.PageUtils; -import com.huoran.common.utils.TokenUtils; -import com.huoran.nakadai.entity.*; -import com.huoran.nakadai.entity.req.CustomerListReq; -import com.huoran.nakadai.entity.req.CustomerReq; -import com.huoran.nakadai.entity.req.GetTheSystemUnderTheProductReq; -import com.huoran.nakadai.entity.req.ListOfClientCommercialManagersReq; -import com.huoran.nakadai.entity.res.BusinessManagerOrderResp; -import com.huoran.nakadai.entity.res.CustomerDetailRes; -import com.huoran.nakadai.entity.res.CustomerListRes; -import com.huoran.nakadai.entity.res.ListOfClientCommercialManagersResp; -import com.huoran.nakadai.mapper.CustomerMapper; -import com.huoran.nakadai.mapper.HrStaffMapper; -import com.huoran.nakadai.service.ICustomerService; -import com.huoran.nakadai.service.IOrderService; -import com.huoran.nakadai.utils.ExcelStyleUtil; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.apache.ibatis.annotations.Param; -import org.apache.poi.ss.usermodel.Workbook; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import java.net.URLEncoder; -import java.util.List; -import java.util.UUID; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.ThreadPoolExecutor; - -/** - *

- * 客户表 前端控制器 - *

- * - * @author huoran - * @since 2021-06-28 - */ -@Api(value = "客户管理", tags = "客户管理") -@RestController -@RequestMapping("/nakadai/customer") -public class CustomerController { - - @Autowired - private ICustomerService iCustomerService; - - @Autowired - private CustomerMapper mapper; - - @Autowired - private HrStaffMapper staffMapper; - - @Autowired - private IOrderService orderService; - - @Autowired - private UserClient userClient; - - - @Autowired - private NakadaiClient nakadaiClient; - - /** - * 客户登录次数补充 - */ - @ApiOperation(value = "客户登录次数补充", notes = "客户登录次数补充") - @PostMapping("/supplementaryCustomerLogins") - public R supplementaryCustomerLogins() { - List list = iCustomerService.list(new QueryWrapper()); - for (Customer customer : list) { - UserAccount userAccount = mapper.selectCustomerAccount(customer.getCustomerId()); - - if (userAccount != null) { - //添加客户默认用户信息 - com.huoran.nakadai.entity.UserInfo userInfo = new UserInfo(); - // userInfo.setUserName();用户姓名默认为空 - userInfo.setUniqueIdentification(UUID.randomUUID().toString()); - staffMapper.addUserInfo(userInfo); - - userAccount.setUserId(userInfo.getUserId()); - - mapper.updateAccountCustomer(userAccount); - } - - } - return R.ok(); - } - - /** - * 添加客户 - * - * @return - */ - @ApiOperation(value = "添加客户", notes = "添加客户") - @PostMapping("/addCustomer") - public R addCustomer(@RequestBody @Valid CustomerReq customerReq) { - int result = 0; - try { - result = iCustomerService.addCustomer(customerReq); - } catch (ExecutionException | InterruptedException e) { - e.printStackTrace(); - } - return result > 0 ? R.ok().put("customerId", customerReq.getCustomerId()).put("schoolId", customerReq.getSchoolId()) : R.error(); - } - - /** - * 查询客户管理列表 - * - * @param customerListReq - * @return - */ - @ApiOperation(value = "查询客户管理列表", notes = "查询客户管理列表") - @PostMapping("/queryCustomer") - public R queryCustomer(@RequestBody CustomerListReq customerListReq) { - PageUtils data = iCustomerService.queryPage(customerListReq.getPage(), customerListReq.getSize(), customerListReq); - return R.ok(data); - } - - - - - @ApiOperation(value = "批量导出客户(不用给分页,其余参数与列表一样)") - @PostMapping(value = "/exportClient", produces = "application/json;multipart/form-data;charset=utf-8") - public void exportProductPracticeResults( - @RequestBody CustomerListReq customerListReq, - HttpServletResponse response) throws Exception { - /*iCustomerService.exportClient(req, response);*/ - - PageUtils data = iCustomerService.queryPage(1, 10000, customerListReq); - // 告诉浏览器用什么软件可以打开此文件 - response.setHeader("content-Type", "application/vnd.ms-excel"); - - // 下载文件的默认名称 - response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("客户列表", "UTF-8") + ".xls"); - //编码 - response.setCharacterEncoding("UTF-8"); - - Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), CustomerListRes.class, data.getList()); - ExportParams exportParams = new ExportParams(null, "客户列表", ExcelType.XSSF); - exportParams.setStyle(ExcelStyleUtil.class); - workbook.write(response.getOutputStream()); - } - - /** - * 密码重置,重置密码为1122aa - */ - @ApiOperation(value = "密码重置", notes = "密码重置") - @GetMapping("/resetPwd") - public R resetPwd(@RequestParam("customerId") Integer customerId) { - int result = iCustomerService.resetPwd(customerId); - return result > 0 ? R.ok() : R.error(); - } - - /** - * 删除客户 - */ - @ApiOperation(value = "删除客户", notes = "删除客户") - @PostMapping("/delCustomer") - public R delCustomer(@RequestBody Integer customerId) { - int result = iCustomerService.delCustomer(customerId); - return result > 0 ? R.ok() : R.error(); - } - - /** - * 批量删除客户信息 - * - * @param ids - * @return - */ - @PostMapping("/delCustomers") - @ApiOperation(value = "批量删除客户信息") - public R delCustomers(@RequestBody List ids) { - int result = iCustomerService.delCustomers(ids); - return result > 0 ? R.ok("删除成功!") : R.error(); - } - - /** - * 查看客户详情 - */ - @ApiOperation(value = "查看客户详情", notes = "查看客户详情", response = CustomerDetailRes.class) - @GetMapping("/queryCustomerDetails") - public R queryCustomerDetails(@RequestParam("customerId") Integer customerId) { - CustomerDetailRes result = iCustomerService.queryCustomerDetails(customerId); - return R.ok().put("result", result); - } - - /** - * 修改课程权限启用禁用 - * @param coursePermissionsId - * @return - */ -// @ApiOperation(value = "修改课程权限启用禁用",notes = "修改课程权限启用禁用") -// @GetMapping("/updateCourseEnabled") -// public R updateCourseEnabled(@RequestParam("coursePermissionsId") Integer coursePermissionsId,@RequestParam("isEnabled") Integer isEnabled) { -// int result = iCustomerService.updateCourseEnabled(coursePermissionsId,isEnabled); -// return result>0 ? R.ok() : R.error(); -// } - - /** - * 修改数据平台权限启用禁用 - * @param dataPermissionsId - * @return - */ -// @ApiOperation(value = "修改数据平台权限启用禁用",notes = "修改数据平台权限启用禁用") -// @GetMapping("/updateDataEnabled") -// public R updateDataEnabled(@RequestParam("dataPermissionsId") Integer dataPermissionsId,@RequestParam("isEnabled") Integer isEnabled) { -// int result = iCustomerService.updateDataEnabled(dataPermissionsId,isEnabled); -// return result>0 ? R.ok() : R.error(); -// } - - /** - * 修改数据平台权限/课程权限启用禁用 - * - * @param id 主键id - * @return - */ - @ApiOperation(value = "修改数据平台权限/课程权限启用禁用", notes = "修改数据平台权限/课程权限启用禁用") - @GetMapping("/updateEnabled") - public R updateEnabled(@RequestParam("id") Integer id, @RequestParam("isEnable") @ApiParam(value = "是否开启(0不开启,1开启,发货后,默认开启)") Integer isEnable) { - int result = iCustomerService.updateEnabled(id, isEnable); - return result > 0 ? R.ok() : R.error(); - } - - /** - * 修改客户 - * - * @return - */ - @ApiOperation(value = "修改客户", notes = "修改客户") - @PostMapping("/updateCustomer") - public R updateCustomer(@RequestBody @Valid CustomerReq customerReq) { - int result = iCustomerService.updateCustomer(customerReq); - return result > 0 ? R.ok() : R.error(); - } - - /** - * 修改客户角色Id - * - * @return - */ - @ApiOperation(value = "修改客户角色Id", notes = "修改客户角色Id") - @PostMapping("/updateCustomerByRoleId") - public R updateCustomerByRoleId(@RequestParam("customerId") @ApiParam(value = "客户id") Integer customerId, - @RequestParam("roleId") @ApiParam(value = "角色id") String roleId - ) { - int result = iCustomerService.updateCustomerByRoleId(customerId, roleId); - return result > 0 ? R.ok() : R.error(); - } - - /** - * 客户判重 - * - * @param schoolId - * @return - */ - @ApiOperation(value = "查看客户是否存在", notes = "查看客户是否存在") - @GetMapping("/queryCustomerIsExists") - public R queryCustomerIsExists(@RequestParam Integer schoolId) { - int result = iCustomerService.queryCustomerIsExists(schoolId); - return result > 0 ? R.error().put("code", ExceptionEnum.EXIST_CUSTOMER.getCode()).put("message", ExceptionEnum.EXIST_CUSTOMER.getMsg()) : R.ok(); - } - - /** - * 根据学校id获取客户id - * - * @param schoolId - * @return - */ - @ApiOperation(value = "根据学校id获取客户id", notes = "根据学校id获取客户id") - @GetMapping("/getCustomerBySchoolId") - public Integer getCustomerBySchoolId(@RequestParam Integer schoolId) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("school_id", schoolId); - queryWrapper.eq("is_del", DelConstant.NOT_DEL); - Customer one = iCustomerService.getOne(queryWrapper); - if (one==null){ - return 0; - } - return one.getCustomerId(); - } - - @PostMapping("/checkEmailOrPhone") - @ApiOperation(value = "新增客户前:校验手机号或者邮箱", response = Customer.class) - public R checkEmailAndPhone(@ApiParam(name = "phone", value = "手机号(一次校验只传一个参数)") @RequestParam(required = false) String phone, - @ApiParam(name = "email", value = "邮 箱(一次校验只传一个参数)") @RequestParam(required = false) String email - , @ApiParam(name = "customerId", value = "编辑传:被编辑客户id") @RequestParam(value = "customerId", required = false) Integer customerId) { - - Customer customer = new Customer(); - - customer.setPhone(phone); - customer.setEmail(email); - if (customerId != null) { - customer.setCustomerId(customerId); - } - - List customerList = iCustomerService.checkEmailOrPhone(customer); - String msg = ""; - if (customerList.size() > 0) { - if (phone != null && !phone.equals("")) { - msg = "该手机号已存在!"; - } else if (email != null && !email.equals("")) { - msg = "该Email已存在!"; - } - - return R.error(msg); - } - return R.ok(); - } - - @ApiOperation(value = "根据客户id获取客户已订阅的产品", notes = "根据客户id获取客户已订阅的产品",response = OrderOther.class) - @GetMapping("/getProductsSubscribedByCustomers") - public R getProductsSubscribedByCustomers(@RequestParam Integer customeId) { - return orderService.getProductsSubscribedByCustomers(customeId); - } - - - @ApiOperation(value = "根据客户id获取客户绑定的商务经理列表", notes = "根据客户id获取客户绑定的商务经理列表",response = ListOfClientCommercialManagersResp.class) - @PostMapping("/getAListOfClientBusinessManagers") - public R getAListOfClientBusinessManagers(@RequestBody ListOfClientCommercialManagersReq req) { - return orderService.getAListOfClientBusinessManagers(req); - } - - @ApiOperation(value = "获取业务经理订单", notes = "获取业务经理订单",response = BusinessManagerOrderResp.class) - @PostMapping("/getBusinessManagerOrder") - public R getBusinessManagerOrder(@RequestBody ListOfClientCommercialManagersReq req) { - return orderService.getBusinessManagerOrder(req); - } - - - @ApiOperation(value = "获取客户购买的产品包含的系统", notes = "获取客户购买的产品包含的系统",response = ServiceConfiguration.class) - @PostMapping("/getSystemByCustomers") - public R getSystemByCustomers(@RequestBody GetTheSystemUnderTheProductReq req,HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - Integer customeId = nakadaiClient.getCustomerBySchoolId(schoolId); - - req.setCustomerId(customeId); - return orderService.getSystemByCustomers(req); - } - - - -} diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/CustomsPassController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/CustomsPassController.java deleted file mode 100644 index b0d3f01..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/CustomsPassController.java +++ /dev/null @@ -1,233 +0,0 @@ -package com.huoran.nakadai.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; -import com.huoran.api.UserClient; -import com.huoran.common.constant.DelConstant; -import com.huoran.common.constant.PlatformConstant; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.nakadai.entity.CustomsPass; -import com.huoran.nakadai.entity.req.PageCustomsPass; -import com.huoran.nakadai.service.CustomsPassService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.util.ObjectUtils; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.Date; -import java.util.List; - -/** - * @描述:沙盘-关卡表控制类 - * @作者: Rong - * @日期: 2023-10-26 - */ -@RestController -@RequestMapping("/nakadai/customsPass") -@Api(value = "沙盘-关卡表:CustomsPassController", tags = "沙盘-关卡表") -public class CustomsPassController { - - @Autowired - public CustomsPassService service; - - @Autowired - private UserClient userClient; - - - @PostMapping("/checkPointListByStu") - @ApiOperation(value = "学生端:关卡列表(用于学生端,需结合收藏表回显收藏id)", response = CustomsPass.class) - public R checkPointListByStu(@ApiParam(name = "projectId", value = "项目id", required = true) @RequestParam Integer projectId, - @ApiParam(name = "displayCollection", value = "显示收藏(为1表示仅展示已收藏)") @RequestParam(required = false) Integer displayCollection, - HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - return service.checkPointList(schoolId, Integer.valueOf(accountId), projectId, displayCollection); - } - - - - @PostMapping("/checkpointList") - @ApiOperation(value = "关卡列表", response = CustomsPass.class) - public R checkpointList(@RequestBody PageCustomsPass customsPass) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("is_del", DelConstant.NOT_DEL); - - - if (customsPass.getPlatformId().equals(PlatformConstant.POST_STATION)) { - //职站(前台只展示启用的关卡) - queryWrapper.eq("is_enable", DelConstant.IS_ENABLE); - } else { - //中台 - if (!ObjectUtils.isEmpty(customsPass.getCustomsPassName())) { - queryWrapper.like("customs_pass_name", customsPass.getCustomsPassName()); - } - - if (!ObjectUtils.isEmpty(customsPass.getIsEnable())) { - queryWrapper.eq("is_enable", customsPass.getIsEnable()); - } - } - - - queryWrapper.orderByAsc("serial_number"); - - List customsPassList = service.list(queryWrapper); - for (CustomsPass object : customsPassList) { - String creator = userClient.getUserName(object.getAccountId()); - object.setCreator(creator); - } - return R.ok().put("data", customsPassList); - } - - - @PostMapping("/save") - @ApiOperation(value = "新增关卡", response = CustomsPass.class) - public R save(@RequestBody @ApiParam(name = "沙盘-关卡表对象", value = "传入json格式", required = true) List customsPassList, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer sequenceNumber = service.maximumSequenceNumber(); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - - for (CustomsPass customsPass : customsPassList) { - customsPass.setAccountId(Integer.valueOf(accountId)); - customsPass.setSchoolId(Integer.valueOf(schoolId)); - customsPass.setSerialNumber(++sequenceNumber); - customsPass.setCreateTime(new Date()); - customsPass.setUpdateTime(new Date()); - service.save(customsPass); - } - - return R.ok(); - } - - - @PostMapping("/update") - @ApiOperation(value = "修改", response = CustomsPass.class) - public R update(@RequestBody @ApiParam(name = "沙盘-关卡表对象", value = "传入json格式", required = true) List customsPassList, HttpServletRequest request) { - for (CustomsPass customsPass : customsPassList) { - UpdateWrapper updateWrapper = new UpdateWrapper<>(); - if (!ObjectUtils.isEmpty(customsPass.getSerialNumber())) { - updateWrapper.set("serial_number", customsPass.getSerialNumber()); - } - - if (!ObjectUtils.isEmpty(customsPass.getCustomsPassName())) { - updateWrapper.set("customs_pass_name", customsPass.getCustomsPassName()); - } - - if (!ObjectUtils.isEmpty(customsPass.getIsEnable())) { - updateWrapper.set("is_enable", customsPass.getIsEnable()); - } - - if (!ObjectUtils.isEmpty(customsPass.getIsDel())) { - updateWrapper.set("is_del", customsPass.getIsDel()); - } - updateWrapper.set("update_time", new Date()); - - updateWrapper.eq("checkpoint_id", customsPass.getCheckpointId()); - - service.update(new CustomsPass(), updateWrapper); - } - - return R.ok(); - } - -/* @PostMapping("/update") - @ApiOperation(value = "修改",response= CustomsPass.class) - public R update(@RequestBody @ApiParam(name="沙盘-关卡表对象",value="传入json格式",required=true) CustomsPass customsPass, HttpServletRequest request){ - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - customsPass.setAccountId(Integer.valueOf(accountId)); - boolean updateState = service.updateById(customsPass); - return updateState? R.ok():R.error("编辑失败"); - }*/ - - /* @PostMapping("/sort") - @ApiOperation(value = "排序", response = CustomsPass.class) - public R sort(@RequestBody @ApiParam(name = "沙盘-关卡表对象", value = "传入json格式", required = true) List sortReqs, HttpServletRequest request) { - - for (CustomsPassSortReq req : sortReqs) { - UpdateWrapper updateWrapper = new UpdateWrapper<>(); - updateWrapper.set("serial_number", req.getSerialNumber()); - updateWrapper.eq("checkpoint_id", req.getCheckpointId()); - service.update(new CustomsPass(), updateWrapper); - } - - return R.ok(); - } -*/ - - /*@ApiOperation(value = "更新开启状态") - @PostMapping("/updateIsOpen") - public R updateIsOpen(@ApiParam(name = "checkpointId", value = "关卡id", required = true) @RequestParam Integer checkpointId, @ApiParam(name = "isEnable", value = "是否禁用(默认0:禁用,1:启用)", required = true) @RequestParam Integer isEnable, @RequestHeader String token) { - String accountId = TokenUtils.getIdByJwtToken(token); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - service.updateIsOpen(checkpointId, isEnable); - return R.ok(); - }*/ - - - /* @ApiOperation(value = "编辑关卡名") - @PostMapping("/updateByName") - public R updateByName(@ApiParam(name = "checkpointId", value = "关卡id", required = true) @RequestParam Integer checkpointId, @ApiParam(name = "customsPassName", value = "关卡名", required = true) @RequestParam String customsPassName, @RequestHeader String token) { - String accountId = TokenUtils.getIdByJwtToken(token); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - UpdateWrapper updateWrapper = new UpdateWrapper<>(); - updateWrapper.set("customs_pass_name", customsPassName); - updateWrapper.eq("checkpoint_id", checkpointId); - boolean ret = service.update(new CustomsPass(), updateWrapper); - return ret ? R.ok() : R.error(); - }*/ - - - /*@ApiOperation(value = "排序") - @PostMapping("/sort") - public R sort(@ApiParam(name = "checkpointId", value = "关卡id", required = true) @RequestParam Integer checkpointId, @ApiParam(name = "type", value = "1.上移 2下移 3置顶 4置底", required = true) @RequestParam Integer type, @RequestHeader String token) { - String accountId = TokenUtils.getIdByJwtToken(token); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - CustomsPass customsPass = service.getById(checkpointId); - - - //上移 - if (type.equals(2)) { - if (customsPass.getSerialNumber() == 1) { - return R.error("已经在最上面啦,不能移动啦~"); - } - - //查询下一条记录Id和sort - Integer nextId = service.selectNextId(customsPass); - CustomsPass nextNotice = service.getById(nextId); - //更新下一条记录的sort为当前值 - customsPass.setCheckpointId(nextId); - service.updateSortById(customsPass); - //更新当前记录的sort为下一条 - nextNotice.setCheckpointId(checkpointId); - service.updateSortById(nextNotice); - } - // 3、下移 - if (type.equals(1)) { - //查询上一条记录Id和sort - Integer previousId = service.selectPreviousId(customsPass); - CustomsPass previousNotice = service.getById(previousId); - //更新上一条记录的sort为当前值 - customsPass.setCheckpointId(previousId); - service.updateSortById(customsPass); - //更新当前记录的sort为上一条 - previousNotice.setCheckpointId(checkpointId); - service.updateSortById(previousNotice); - } - - - return R.ok(); - }*/ - - - /* @PostMapping("/batchDeletion") - @ApiOperation(value = "批量删除", response = CustomsPass.class) - public R batchDeletion(@ApiParam(name = "ids", value = "主键", required = true) @RequestBody List ids) { - boolean delState = service.removeByIds(ids); - return delState ? R.ok() : R.error("删除失败"); - }*/ -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/DataProductController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/DataProductController.java deleted file mode 100644 index 93795e9..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/DataProductController.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.huoran.nakadai.controller; - - -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.nakadai.entity.Curriculum; -import com.huoran.nakadai.entity.DataProduct; -import com.huoran.nakadai.entity.Discipline; -import com.huoran.nakadai.entity.req.AddCurriculumReq; -import com.huoran.nakadai.entity.req.MiniProgramProductsReq; -import com.huoran.nakadai.entity.res.AppletsDataProductResp; -import com.huoran.nakadai.service.ICustomerService; -import com.huoran.nakadai.service.IDataProductService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; -import java.util.List; - -/** - *

- * 数据平台产品表 前端控制器 - *

- * - * @author huoran - * @since 2021-06-28 - */ -@RestController -@RequestMapping("/nakadai/dataProduct") -@Api(value = "产品", tags = "产品") -public class DataProductController { - - - @Autowired - private IDataProductService dataProductService; - - @PostMapping("/AppletsDataProductList") - @ApiOperation(value = "小程序数据产品列表", response = AppletsDataProductResp.class) - public R AppletsDataProductList(@RequestBody MiniProgramProductsReq req) { - return dataProductService.AppletsDataProductList(req); - } -} diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/DisciplineController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/DisciplineController.java deleted file mode 100644 index 7a38ec2..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/DisciplineController.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.huoran.nakadai.controller; - - -import com.huoran.common.response.R; -import com.huoran.nakadai.entity.Discipline; -import com.huoran.nakadai.entity.Professional; -import com.huoran.nakadai.entity.ProfessionalClass; -import com.huoran.nakadai.service.IDisciplineService; -import com.huoran.nakadai.service.IProfessionalClassService; -import com.huoran.nakadai.service.IProfessionalService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import java.util.List; - -/** - * @Description: java方法作用描述 - * @auther: Rong - * @date: 2021/9/17 15:44 - */ -@RestController -@RequestMapping("/nakadai/subject") -@Api(value = "API - 课程管理三级联查", tags = "课程管理三级联查") -public class DisciplineController { - @Autowired - public IDisciplineService service; - - @Autowired - public IProfessionalClassService classService; - - @Autowired - public IProfessionalService professionalService; - - @GetMapping("/subjectCategoryCited") - @ApiOperation(value = "教师端展示引用的学科类别(三级数据)", response = Discipline.class) - public R subjectCategoryCited() { - List list = service.subjectCategoryCited(); - return R.ok().put("list", list); - } - - - @GetMapping("/courseDiscipline") - @ApiOperation(value = "课程学科类别", response = Discipline.class) - public R courseDiscipline() { - List list = service.disciplineLevel(); - return R.ok().put("list", list); - } - - - @GetMapping("/courseProfessionalClass") - @ApiOperation(value = "课程专业类", response = ProfessionalClass.class) - public R disciplineList( - @ApiParam(value = "disciplineId", required = true) - @RequestParam("disciplineId") Integer disciplineId) { - List list = classService.professionalClassLevel(disciplineId); - return R.ok().put("list", list); - } - - - @GetMapping("/courseProfessional") - @ApiOperation(value = "课程专业", response = Professional.class) - public R courseProfessional( - @ApiParam(value = "professionalClassId", required = true) - @RequestParam("professionalClassId") Integer professionalClassId) { - List list = professionalService.professionalLevel(professionalClassId); - return R.ok().put("list", list); - } -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/DisciplineLevelController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/DisciplineLevelController.java deleted file mode 100644 index 1c5a505..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/DisciplineLevelController.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.huoran.nakadai.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RestController; - -/** - *

- * 学科层次 前端控制器 - *

- * - * @author huoran - * @since 2021-07-09 - */ -@RestController -@RequestMapping("/nakadai/disciplineLevel") -public class DisciplineLevelController { - -} diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/EduCurriculumChapterController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/EduCurriculumChapterController.java deleted file mode 100644 index ab36809..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/EduCurriculumChapterController.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.huoran.nakadai.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; - -/** - *

- * 课程章节 前端控制器 - *

- * - * @author lr - * @since 2021-09-26 - */ -@RestController -@RequestMapping("/nakadai/edu-curriculum-chapter") -public class EduCurriculumChapterController { - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/EnterpriseCertificationController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/EnterpriseCertificationController.java index d7d59d2..b44ae94 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/EnterpriseCertificationController.java +++ b/nakadai/src/main/java/com/huoran/nakadai/controller/EnterpriseCertificationController.java @@ -45,12 +45,6 @@ public class EnterpriseCertificationController { @Autowired public EnterpriseCertificationService service; - /* @Autowired - public IHrUserAccountService userAccountService; - - @Autowired - public IHrUserInfoService userInfoService;*/ - /** * 由前台申请认证后才有后台认证记录,认证状态有 待审核、已通过、未驳回三种状态,没有未提交这种状态 @@ -106,8 +100,6 @@ public class EnterpriseCertificationController { @PostMapping("/update") @ApiOperation(value = "修改", response = EnterpriseCertification.class) public R update(@RequestBody @ApiParam(name = "企业实名认证信息记录对象", value = "传入json格式", required = true) EnterpriseCertification enterpriseCertification, HttpServletRequest request) { - /* String accountId = TokenUtils.getIdByJwtToken(request); - enterpriseCertification.setAccountId(Integer.valueOf(accountId));*/ boolean updateState = service.updateById(enterpriseCertification); return updateState ? R.ok() : R.error("编辑失败"); } diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/HrContractInformationController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/HrContractInformationController.java deleted file mode 100644 index 05e70b6..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/HrContractInformationController.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.huoran.nakadai.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; - -/** - *

- * 合同信息表 前端控制器 - *

- * - * @author huoran - * @since 2021-06-28 - */ -@RestController -@RequestMapping("/nakadai/contractInformation") -public class HrContractInformationController { - -} diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/HrCoursePermissionsController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/HrCoursePermissionsController.java deleted file mode 100644 index 0a5bfd0..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/HrCoursePermissionsController.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.huoran.nakadai.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; - -/** - *

- * 课程权限表 前端控制器 - *

- * - * @author huoran - * @since 2021-06-28 - */ -@RestController -@RequestMapping("/nakadai/coursePermissions") -public class HrCoursePermissionsController { - -} diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/HrDataPermissionsController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/HrDataPermissionsController.java deleted file mode 100644 index 7a8fd7d..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/HrDataPermissionsController.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.huoran.nakadai.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; - -/** - *

- * 数据平台权限表 前端控制器 - *

- * - * @author huoran - * @since 2021-06-28 - */ -@RestController -@RequestMapping("/nakadai/dataPermissions") -public class HrDataPermissionsController { - -} diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/HrLogController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/HrLogController.java deleted file mode 100644 index e0da36c..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/HrLogController.java +++ /dev/null @@ -1,276 +0,0 @@ -package com.huoran.nakadai.controller; - - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.nakadai.entity.HrLog; -import com.huoran.nakadai.entity.LogContent; -import com.huoran.nakadai.entity.vo.LogManagementListVo; -import com.huoran.nakadai.entity.vo.OrderVo; -import com.huoran.nakadai.service.HrLogService; -import com.huoran.nakadai.service.LogContentService; -import com.huoran.nakadai.utils.CollectionUtil; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.redis.core.RedisTemplate; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Date; -import java.util.List; - -/** - *

- * 前端控制器 - *

- * - * @author chen - * @since 2022-03-04 - */ -@Api(tags = "日志管理") -@RestController -@RequestMapping("/nakadai/log") -public class HrLogController { - - @Autowired - private HrLogService logService; - - @Autowired - private LogContentService logContentService; - - @Autowired - private RedisTemplate redisTemplate; - - - @ApiOperation(value = "名称查重") - @GetMapping("/checkRepeat") - public R logManagementList( - @ApiParam(name = "versionName", value = "名称") @RequestParam String versionName, - @ApiParam(name = "platformId", value = "平台id") @RequestParam String platformId) { - //名称判重 - QueryWrapper logQueryWrapper = new QueryWrapper<>(); - logQueryWrapper.eq("version_name",versionName). - eq("platform_id",platformId); - HrLog hrLog = logService.getOne(logQueryWrapper); - if (ObjectUtil.isNotNull(hrLog)){ - return R.error("版本名称已存在!"); - } - return R.ok(); - } - - @ApiOperation(value = "日志通知") - @GetMapping("/logNotification") - public R logNotification( - @ApiParam(name = "platformId", value = "平台id") - String platformId,HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - String notification = redisTemplate.opsForValue().get(accountId+platformId); - //读取完该用户删除通知标识 - redisTemplate.delete(accountId+platformId); - return R.ok().put("notification",notification); - } - - @ApiOperation(value = "日志撤回") - @GetMapping("/logWithdrawal") - public R logWithdrawal( - @ApiParam(name = "platformId", value = "平台id") - Integer platformId, - @ApiParam(name = "logId", value = "日志id") - Integer logId) { - HrLog log = new HrLog(); - log.setLogId(logId); - log.setOpen(1); - log.setWithdraw(1); - log.setWithdrawNum(1); - //禁用日志 - logService.updateById(log); - - //获取平台所有存在用户,清空该平台所有通知对象 - List accountIds = logService.queryAllAccount(platformId); - accountIds.forEach(accountId -> { - if (redisTemplate.hasKey(accountId.toString() + platformId)){ - //存在删除该用户通知标识 - redisTemplate.delete(accountId.toString()+platformId); - } - }); - return R.ok(); - } - - @ApiOperation(value = "添加日志") - @PostMapping("/add") - public R add( - @ApiParam(name = "log", value = "日志数据", required = true) - @RequestBody @Valid HrLog log) { - //发布状态判断 - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("draft",1).eq("platform_id",log.getPlatformId()); - HrLog one = logService.getOne(queryWrapper); - if (ObjectUtil.isNotNull(one)){ - return R.error("还有未发布的更新日志,请发布后进行新增!"); - } - //名称判重 - QueryWrapper logQueryWrapper = new QueryWrapper<>(); - logQueryWrapper.eq("version_name",log.getVersionName()). - eq("platform_id",log.getPlatformId()); - HrLog hrLog = logService.getOne(logQueryWrapper); - if (ObjectUtil.isNotNull(hrLog)){ - return R.error("版本名称已存在!"); - } - if (log.getDraft()==0){ - log.setDraftTime(new Date()); - log.setVersion(1); - } - boolean save = logService.save(log); - //发布状态,通知该平台所有存在用户 - if (log.getDraft()==0){ - List accountIds = logService.queryAllAccount(log.getPlatformId()); - accountIds.forEach(accountId -> { - redisTemplate.opsForValue().set(accountId.toString()+log.getPlatformId(),"true"); - }); - } - if (save){ - //新增内容 - List logContents = log.getLogContents(); - logContents.forEach(logContent -> { - logContent.setLogId(log.getLogId()); - logContentService.save(logContent); - }); - } - return save ? R.ok() : R.error(); - } - - @ApiOperation(value = "日志管理列表",response = LogManagementListVo.class) - @GetMapping("/logManagementList") - public R logManagementList( - @ApiParam(name = "search", value = "查询条件") - @RequestParam String search) { - List logManagementListVo = logService.managementList(search); - return R.ok().put("logManagementListVo",logManagementListVo); - } - - @ApiOperation(value = "平台日志列表",response = HrLog.class) - @GetMapping("/platformLogList") - public R platformLogList( - @ApiParam(name = "versionName", value = "版本查询", required = true) - @RequestParam String versionName, - @ApiParam(name = "port", value = "分端查询,前台查看传值1,只查询开启日志") - Integer port, - @ApiParam(name = "platformId", value = "平台id") Integer platformId) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.like("version_name",versionName). - eq("platform_id",platformId). - orderByDesc("create_time"); - //前台查看传值1,只查询开启日志 - if (port!=null && port==1){ - queryWrapper.eq("open",0); - } - List logList = logService.list(queryWrapper); - - logList.forEach(log -> { - QueryWrapper logContentQueryWrapper = new QueryWrapper<>(); - logContentQueryWrapper.eq("log_id",log.getLogId()); - List list = logContentService.list(logContentQueryWrapper); - log.setLogContents(list); - }); - return R.ok().put("logList",logList); - } - - - @ApiOperation(value = "日志详情",response = OrderVo.class) - @GetMapping("/get") - public R get( - @ApiParam(name = "logId", value = "日志id", required = true) - @RequestParam @Valid @NotNull Integer logId) { - HrLog log = logService.getById(logId); - - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("log_id",logId); - List list = logContentService.list(queryWrapper); - log.setLogContents(list); - return R.ok().put("log",log); - } - - @ApiOperation(value = "删除日志") - @PostMapping("/delete") - public R delete( - @ApiParam(name = "logId", value = "日志id", required = true) - @RequestParam Integer logId) { - - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("log_id",logId); - logContentService.remove(queryWrapper); - - boolean remove = logService.removeById(logId); - - return remove ? R.ok() : R.error(); - } - - @ApiOperation(value = "更新日志") - @PostMapping("/update") - public R update( - @ApiParam(name = "log", value = "日志数据", required = true) - @RequestBody HrLog log) { - - if (log.getLogContents()!=null){ - ArrayList before = new ArrayList<>(); - ArrayList after = new ArrayList<>(); - //获取该平台最新数据 - HrLog one = logService.getOne(new QueryWrapper(). - eq("platform_id", log.getPlatformId()). - orderByDesc("log_id").last("limit 1")); - - //更新之前查询日志数据 - List contentList = logContentService. - list(new QueryWrapper().eq("log_id", log.getLogId())); - for (LogContent logContent : contentList) { - before.add(logContent.getId()); - } - - //更新内容 - List logContents = log.getLogContents(); - logContents.forEach(logContent -> { - if (logContent.getId()!=null){ - logContentService.updateById(logContent); - after.add(logContent.getId()); - }else { - logContent.setLogId(log.getLogId()); - logContentService.save(logContent); - } - }); - //长度变化,表示有删减 - if (before.size()!=after.size()){ - Collection differentNoDuplicate = CollectionUtil.getDifferentNoDuplicate(before, after); - logContentService.removeByIds(differentNoDuplicate); - } - - HrLog byId = logService.getById(log.getLogId()); - if (log.getDraft()==0 && byId.getVersion()<1){ - log.setDraftTime(new Date()); - log.setVersion(1); - } - - //更新为发布状态且之前状态为撤回且之前版本更新不通知,通知该平台所有存在用户 - if (log.getDraft()==0 & log.getLogId().equals(one.getLogId()) & one.getWithdraw()==1){ - //重新发布允许撤回该日志 - log.setWithdrawNum(0); - List accountIds = logService.queryAllAccount(log.getPlatformId()); - accountIds.forEach(accountId -> { - redisTemplate.opsForValue().set(accountId.toString()+log.getPlatformId(),"true"); - }); - } - } - - boolean update = logService.updateById(log); - return update ? R.ok() : R.error(); - } - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/HrMallMarketingPromotionController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/HrMallMarketingPromotionController.java deleted file mode 100644 index 0dd8c1d..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/HrMallMarketingPromotionController.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.huoran.nakadai.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.huoran.api.UserClient; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.nakadai.entity.HrMallMarketingPromotion; -import com.huoran.nakadai.entity.PartnerArticleManagement; -import com.huoran.nakadai.entity.req.MarketingPromotionPageReq; -import com.huoran.nakadai.service.HrMallMarketingPromotionService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; - - -/** - * @描述:控制类 - * @作者: Rong - * @日期: 2023-04-25 - */ -@RestController -@RequestMapping("/nakadai/mall/marketing/promotion") -@Api(value = ":HrMallMarketingPromotionController", tags = "R-营销推广管理") - -public class HrMallMarketingPromotionController { - - @Autowired - public HrMallMarketingPromotionService service; - @Autowired - private UserClient userClient; - - @PostMapping("/pagingQueryList") - @ApiOperation(value = "分页查询", response = HrMallMarketingPromotion.class) - public R pagingQueryList(@RequestBody MarketingPromotionPageReq req) { - Page page = new Page(req.getPageNum(), req.getPageSize()); - - QueryWrapper queryWrapper = new QueryWrapper<>(); - if (req.getTitle() != null && !req.getTitle().equals("")) { - queryWrapper.like("title", req.getTitle()); - } - - if (req.getIsOpen() != null && !req.getIsOpen().equals("")) { - queryWrapper.eq("is_open", req.getIsOpen()); - } - queryWrapper.orderByDesc("create_time"); - IPage pagingQueryList = service.page(page, queryWrapper); - return R.ok().put("page", pagingQueryList); - } - - - @PostMapping("/findById") - @ApiOperation(value = "查询详情", response = HrMallMarketingPromotion.class) - public R findById(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { - HrMallMarketingPromotion hrMallMarketingPromotion = service.getById(id); - return R.ok().put("data", hrMallMarketingPromotion); - } - - - @PostMapping("/save") - @ApiOperation(value = "新增", response = HrMallMarketingPromotion.class) - public R save(@RequestBody @ApiParam(name = "对象", value = "传入json格式", required = true) HrMallMarketingPromotion hrMallMarketingPromotion, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - hrMallMarketingPromotion.setAccountId(Integer.valueOf(accountId)); - boolean addState = service.save(hrMallMarketingPromotion); - return addState ? R.ok() : R.error("新增失败"); - } - - - @PostMapping("/update") - @ApiOperation(value = "修改", response = HrMallMarketingPromotion.class) - public R update(@RequestBody @ApiParam(name = "对象", value = "传入json格式", required = true) HrMallMarketingPromotion hrMallMarketingPromotion, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - hrMallMarketingPromotion.setAccountId(Integer.valueOf(accountId)); - boolean updateState = service.updateById(hrMallMarketingPromotion); - return updateState ? R.ok() : R.error("编辑失败"); - } - - - @PostMapping("/delete") - @ApiOperation(value = "删除", response = HrMallMarketingPromotion.class) - public R delete(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { - boolean delState = service.removeById(id); - return delState ? R.ok() : R.error("删除失败"); - } - - @PostMapping("/batchDeletion") - @ApiOperation(value = "批量删除", response = HrMallMarketingPromotion.class) - public R batchDeletion(@ApiParam(name = "id", value = "主键", required = true) @RequestParam List ids) { - boolean delState = service.removeByIds(ids); - return delState ? R.ok() : R.error("删除失败"); - } - - - @PostMapping("/bannerEnableOrDisable") - @ApiOperation(value = "banner启用禁用", response = PartnerArticleManagement.class) - public R bannerEnableOrDisable(@ApiParam(name = "id", value = "banner id", required = true) @RequestParam Integer id, @ApiParam(name = "isDisable", value = "是否禁用(0默认,0启用 1禁用)", required = true) @RequestParam Integer isDisable) { - UpdateWrapper updateWrapper = new UpdateWrapper(); - updateWrapper.set("is_open", isDisable); - updateWrapper.eq("id", id); - boolean ret = service.update(new HrMallMarketingPromotion(), updateWrapper); - return ret ? R.ok() : R.error("禁用/启用失败"); - } - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/HrStaffAccountArchitectureController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/HrStaffAccountArchitectureController.java deleted file mode 100644 index 67f00f7..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/HrStaffAccountArchitectureController.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.huoran.nakadai.controller; - -import com.huoran.common.response.R; -import com.huoran.nakadai.entity.HrStaffAccountArchitecture; -import com.huoran.nakadai.entity.req.ArchitectureAddReq; -import com.huoran.nakadai.service.HrStaffAccountArchitectureService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; -import java.util.*; - -/** - *

- * 中台账号组织架构 前端控制器 - *

- * - * @author chen - * @since 2022-03-22 - */ -@Api(tags = "中台账号组织架构") -@RestController -@RequestMapping("/nakadai/staffAccountArchitecture") -public class HrStaffAccountArchitectureController { - - @Autowired - public HrStaffAccountArchitectureService architectureService; - - /** - * 新增中台组织架构 - */ - @PostMapping("/save") - @ApiOperation(value = "新增中台组织架构") - public R save(@RequestBody @Valid ArchitectureAddReq architectureAddReq) { - - if (architectureAddReq.getLevel() > 6) { - return R.error("暂不支持" + architectureAddReq.getLevel() + "层级"); - } - HrStaffAccountArchitecture architecture = new HrStaffAccountArchitecture(); - BeanUtils.copyProperties(architectureAddReq, architecture); - - boolean ok = architectureService.checkRepeat(architecture); - if (ok) { - return R.error("同级下已存在相同的名称:" + architectureAddReq.getOrganizationName()); - } - boolean save = architectureService.save(architecture); - return save ? R.ok().put("id", architecture.getId()) : R.error(); - - } - - /** - * 编辑中台组织架构 - */ - @PostMapping("/update") - @ApiOperation(value = "编辑中台组织架构") - public R update(@RequestBody @Valid HrStaffAccountArchitecture architecture) { - boolean ok = architectureService.checkRepeat(architecture); - if (ok) { - return R.error("同级下已存在相同的名称:" + architecture.getOrganizationName()); - } else { - boolean update = architectureService.updateById(architecture); - return update ? R.ok() : R.error(); - } - } - - /** - * 删除组织架构 - */ - @PostMapping("/delete") - @ApiOperation(value = "删除中台组织架构") - public R delete(@ApiParam(name = "id", value = "架构id", required = true) @RequestParam Integer id) { - //级联删除子部门 - boolean remove = architectureService.removeOrganization(id); - return remove ? R.ok() : R.error(); - } - - /** - * 中台组织架构树形列表 - */ - @PostMapping("/treeList") - @ApiOperation(value = "中台组织架构树形列表", response = HrStaffAccountArchitecture.class) - public R treeList() { - List list = architectureService.treeList(); - return R.ok().put("treeList", list); - } - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/HrStaffController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/HrStaffController.java deleted file mode 100644 index 2b1f461..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/HrStaffController.java +++ /dev/null @@ -1,106 +0,0 @@ -package com.huoran.nakadai.controller; - - -import com.huoran.common.response.R; - -import com.huoran.nakadai.entity.req.StaffAddReq; -import com.huoran.nakadai.entity.req.StaffListReq; -import com.huoran.nakadai.entity.req.StaffUpdateReq; -import com.huoran.nakadai.entity.res.StaffResp; -import com.huoran.nakadai.service.HrStaffService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; - -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - *

- * 中台后台员工账号表 前端控制器 - *

- * - * @author chen - * @since 2022-03-22 - */ -@Api(tags = "中台后台员工账号") -@RestController -@RequestMapping("/nakadai/backstageStaff") -public class HrStaffController { - - @Autowired - public HrStaffService staffService; - - /** - * 新增员工 - */ - @PostMapping("/saveStaff") - @ApiOperation(value = "新增员工") - public R saveStaff(@RequestBody @Valid StaffAddReq staffReq) throws Exception { - return staffService.saveStaff(staffReq); - } - - /** - * 员工列表 - */ - @PostMapping("/staffList") - @ApiOperation(value = "员工列表", response = StaffResp.class) - public R staffList(@RequestBody @Valid StaffListReq req) { - return staffService.pageStaffList(req); - } - - /** - * 员工详情 - */ - @GetMapping("/staffDetail") - @ApiOperation(value = "员工详情", response = StaffResp.class) - public R staffDetail(@ApiParam(name = "accountId", value = "员工账号id") @RequestParam Integer accountId) { - return staffService.staffDetail(accountId); - } - - /** - * 编辑员工 - */ - @PostMapping("/modifyStaff") - @ApiOperation(value = "编辑员工") - public R modifyStaff(@RequestBody @Valid StaffUpdateReq updateReq) { - return staffService.modifyStaff(updateReq); - } - - /** - * 删除员工 - */ - @PostMapping("/delStaff") - @ApiOperation(value = "删除员工") - public R delStaff(@ApiParam(name = "accountIds", value = "要删除的账号id") @RequestParam List accountIds) { - return staffService.delStaff(accountIds); - } - - /** - * 批量导入员工 - */ - @PostMapping("/importStaff") - @ApiOperation("批量导入员工") - public R importStaff(@RequestParam(name = "file") MultipartFile file, HttpServletRequest request) throws IOException { - Map map = staffService.importStaff(file); - return R.ok().put("data", map); - } - - /** - * 批量导入员工失败数据导出 - */ - @ApiOperation(value = "批量导入员工失败数据导出") - @GetMapping("/exportFailure") - public void exportFailureRecord(HttpServletResponse response, @ApiParam(name = "exportCode", value = "importQuestion接口返回的exportCode", required = true) @RequestParam String exportCode) throws Exception { - staffService.exportFailureRecord(response, exportCode); - } -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/HrStaffDepartmentController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/HrStaffDepartmentController.java deleted file mode 100644 index 3034c8b..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/HrStaffDepartmentController.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.huoran.nakadai.controller; - - -import io.swagger.annotations.Api; -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; - -/** - *

- * 前端控制器 - *

- * - * @author chen - * @since 2022-03-23 - */ -@Api(tags = "员工部门") -@RestController -@RequestMapping("/nakadai/staffDepartment") -public class HrStaffDepartmentController { - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/LogContentController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/LogContentController.java deleted file mode 100644 index bc0d0a0..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/LogContentController.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.huoran.nakadai.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; - -/** - *

- * 前端控制器 - *

- * - * @author chen - * @since 2022-03-08 - */ -@RestController -@RequestMapping("/nakadai/log-content") -public class LogContentController { - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/MallAnnexController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/MallAnnexController.java deleted file mode 100644 index 0965ce5..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/MallAnnexController.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.huoran.nakadai.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; - -/** - *

- * 商品附件表 前端控制器 - *

- * - * @author chen - * @since 2023-05-06 - */ -@RestController -@RequestMapping("/mall-annex") -public class MallAnnexController { - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/MallClassificationController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/MallClassificationController.java deleted file mode 100644 index fd94ede..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/MallClassificationController.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.huoran.nakadai.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - *

- * 商品分类关联表 前端控制器 - *

- * - * @author chen - * @since 2023-04-25 - */ -@RestController -@RequestMapping("/mallClassification") -public class MallClassificationController { - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/MallController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/MallController.java deleted file mode 100644 index 5207e63..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/MallController.java +++ /dev/null @@ -1,215 +0,0 @@ -package com.huoran.nakadai.controller; - - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.api.UserClient; -import com.huoran.common.exception.CustomException; -import com.huoran.common.exception.ExceptionEnum; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.nakadai.entity.*; -import com.huoran.nakadai.entity.req.GoodsListReq; -import com.huoran.nakadai.entity.res.GoodsRes; -import com.huoran.nakadai.entity.vo.GoodsVo; -import com.huoran.nakadai.mapper.CurriculumMapper; -import com.huoran.nakadai.mapper.DataProductMapper; -import com.huoran.nakadai.service.MallClassificationService; -import com.huoran.nakadai.service.MallService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import java.util.Date; -import java.util.List; -import java.util.concurrent.ExecutionException; -import java.util.stream.Collectors; - -/** - *

- * 商城管理表 前端控制器 - *

- * - * @author chen - * @since 2023-04-25 - */ -@Api(value = "M-商城商品管理", tags = "M-商城商品管理") -@RestController -@RequestMapping("/mall") -public class MallController { - - @Autowired - private MallService mallService; - - @Autowired - private MallClassificationService mallClassificationService; - - @Autowired - private CurriculumMapper curriculumMapper; - - @Autowired - private DataProductMapper dataProductMapper; - - @Autowired - private UserClient userClient; - - @ApiOperation(value = "添加商品") - @PostMapping("/addGoods") - public R addGoods( - @ApiParam(name = "goodsVo", value = "商品数据", required = true) - @RequestBody @Valid GoodsVo goodsVo, HttpServletRequest request) throws ExecutionException, InterruptedException { - String accountId = TokenUtils.getIdByJwtToken(request); - goodsVo.getMall().setAccountId(accountId); - //保存上架时间 - if (goodsVo.getMall().getState()==0){ - goodsVo.getMall().setShelfTime(new Date()); - } - return mallService.addGoods(goodsVo); - } - - @ApiOperation(value = "商品列表", response = GoodsRes.class) - @PostMapping("/listOfGoods") - public R listOfGoods( - @ApiParam(name = "orderListReq", value = "查询条件", required = true) - @RequestBody GoodsListReq goodsListReq,HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - goodsListReq.setSchoolId(schoolId); - return mallService.listOfGoods(goodsListReq); - } - - @ApiOperation(value = "职站商城", response = GoodsRes.class) - @PostMapping("/stationShoppingMall") - public R stationShoppingMall( - @ApiParam(name = "orderListReq", value = "查询条件", required = true) - @RequestBody GoodsListReq goodsListReq) { - return mallService.stationShoppingMall(goodsListReq); - } - - @GetMapping("/schoolGoods") - @ApiOperation(value = "获取学校购买订单后的商品id") - public List schoolGoods(HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - return mallService.schoolGoods(schoolId); - } - - @ApiOperation(value = "商品详情") - @GetMapping("/detailsOfGoods") - public R detailsOfGoods( - @ApiParam(name = "mallId", value = "商品id", required = true) - @RequestParam @Valid @NotNull Integer mallId,@RequestHeader(required = false) String token) { - GoodsVo goodsDetails = mallService.detailsOfGoods(mallId,token); - return R.ok().put("orderDetails", goodsDetails); - } - - - @ApiOperation(value = "商品上下架") - @PostMapping("/goodsOffTheShelf") - @Transactional -// @CacheEvict(value = "n_listOfGoods", allEntries = true) - public R goodsOffTheShelf( - @ApiParam(name = "mallId", value = "商品id", required = true) - @RequestParam Integer mallId, - @ApiParam(name = "isShelves", value = "上下架(1下架 0上架 默认0)", required = true) - @RequestParam Integer isShelves, - HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Mall mall = mallService.getById(mallId); - - //关联了课程产品并上架 - if (mall.getIsAssociatedProduct()==0 && isShelves==0){ - - List classifications = mallClassificationService.list(new QueryWrapper().eq("mall_id", mallId)); - List classificationIds = classifications.stream().map(MallClassification::getClassificationId).collect(Collectors.toList()); - - if (classificationIds.contains(1)||classificationIds.contains(2)){ - //查询课程 - Curriculum curriculum = curriculumMapper.selectById(mall.getAssociatedProduct()); - if (ObjectUtil.isNull(curriculum)){ - throw new CustomException(ExceptionEnum.COURSE_PRODUCTS_HAVE_BEEN_REMOVED); - }else { - if (curriculum.getIsShelves()==0){ - throw new CustomException(ExceptionEnum.COURSE_PRODUCTS_HAVE_BEEN_REMOVED_FROM_SALE); - } - } - //关联了数据平台 - }else if (classificationIds.contains(5)){ - DataProduct dataProduct = dataProductMapper.selectById(mall.getAssociatedProduct()); - if (ObjectUtil.isNull(dataProduct)){ - throw new CustomException(ExceptionEnum.DATA_PRODUCTS_HAVE_BEEN_REMOVED); - }else { - if (dataProduct.getStatus()==0){ - throw new CustomException(ExceptionEnum.DATA_PRODUCTS_HAVE_BEEN_REMOVED_FROM_SALE); - } - } - } - } - - if (isShelves==0){ - mall.setShelfTime(new Date()); - } - - boolean ret = mallService.updateById(mall.setIsShelves(isShelves).setAccountId(accountId).setState(isShelves)); - return ret ? R.ok() : R.error(); - } - - @ApiOperation(value = "商品精选") - @PostMapping("/goodsSelection") -// @CacheEvict(value = "n_listOfGoods", allEntries = true) - public R goodsSelection( - @ApiParam(name = "mallId", value = "商品id", required = true) - @RequestParam Integer mallId, - @ApiParam(name = "selected", value = "0不精选,1为精选 默认0", required = true) - @RequestParam Integer selected, - HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Mall mall = mallService.getById(mallId); - boolean ret = mallService.updateById(mall.setSelected(selected).setAccountId(accountId)); - return ret ? R.ok() : R.error(); - } - - @ApiOperation(value = "删除商品") - @PostMapping("/deletionOfGoods") - public R deletionOfGoods( - @ApiParam(name = "mallId", value = "商品id", required = true) - @RequestBody Integer mallId) { - boolean delete = mallService.deletionOfGoods(mallId); - return delete ? R.ok() : R.error(); - } - - @ApiOperation(value = "更新商品") - @PostMapping("/renewalOfGoods") - public R renewalOfGoods( - @ApiParam(name = "goodsVo", value = "商品数据", required = true) - @RequestBody @Valid GoodsVo goodsVo,HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - goodsVo.getMall().setAccountId(accountId); - boolean update = mallService.renewalOfGoods(goodsVo); - return update ? R.ok() : R.error(); - } - - @ApiOperation(value = "解决方案分类-商品") - @GetMapping("/goodsSchemeClassification") - public R goodsSchemeClassification() { - List list = mallService.goodsSchemeClassification(); - return R.ok().put("data", list); - } - - @ApiOperation(value = "或然官网-商品列表",response = GoodsRes.class) - @PostMapping("/websiteProductList") - public R websiteProductList( - @ApiParam(name = "orderListReq", value = "查询条件", required = true) - @RequestBody GoodsListReq goodsListReq) { - return mallService.websiteProductList(goodsListReq); - } - - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/MallCourseLearningRecordController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/MallCourseLearningRecordController.java deleted file mode 100644 index d04363f..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/MallCourseLearningRecordController.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.huoran.nakadai.controller; - - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.api.UserClient; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.nakadai.entity.MallCourseLearningRecord; -import com.huoran.nakadai.service.MallCourseLearningRecordService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import javax.servlet.http.HttpServletRequest; - -/** - *

- * 商品课程学习记录 前端控制器 - *

- * - * @author chen - * @since 2023-04-26 - */ -@Api(value = "M-商品课程学习记录", tags = "M-商品课程学习记录") -@RestController -@RequestMapping("/mallCourseLearningRecord") -public class MallCourseLearningRecordController { - - @Autowired - private MallCourseLearningRecordService recordService; - - @Autowired - private UserClient userClient; - - @ApiOperation(value = "添加学习记录(进入实验调用)") - @PostMapping("/addLearningRecord") - public R addLearningRecord( - @ApiParam(name = "mallId", value = "商品id", required = true) - @RequestParam Integer mallId, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - //查询记录,进入过实验,下次进入不再记录数据 - MallCourseLearningRecord one = recordService.getOne(new QueryWrapper(). - eq("mall_id", mallId).eq("account_id", accountId)); - if (one==null){ - MallCourseLearningRecord record = new MallCourseLearningRecord(); - record.setMallId(mallId); - record.setAccountId(Integer.valueOf(accountId)); - record.setSchoolId(schoolId); - recordService.save(record); - } - return R.ok(); - } - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/MallDisciplineController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/MallDisciplineController.java deleted file mode 100644 index 0af4efb..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/MallDisciplineController.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.huoran.nakadai.controller; - - -import com.huoran.common.response.R; -import com.huoran.nakadai.service.MallDisciplineService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.multipart.MultipartFile; - -/** - *

- * 商品学科类别关联表 前端控制器 - *

- * - * @author chen - * @since 2023-04-25 - */ -@Api(value = "M-商城商品学科类别管理", tags = "M-商城商品学科类别管理") -@RestController -@RequestMapping("/mallDiscipline") -public class MallDisciplineController { - - @Autowired - private MallDisciplineService mallDisciplineService; - - /** - * 批量导入学科类别 - */ - @PostMapping("/importSubjectCategoriesInBatches") - @ApiOperation("批量导入学科类别") - public R importSubjectCategoriesInBatches(@RequestParam(name = "file") MultipartFile file) { - return mallDisciplineService.importSubjectCategoriesInBatches(file); - } - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/MallNonAssociatedLinksController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/MallNonAssociatedLinksController.java deleted file mode 100644 index d1963e7..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/MallNonAssociatedLinksController.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.huoran.nakadai.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; - -/** - *

- * 非关联产品链接 前端控制器 - *

- * - * @author chen - * @since 2023-05-15 - */ -@RestController -@RequestMapping("/mall-non-associated-links") -public class MallNonAssociatedLinksController { - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/MallPriceController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/MallPriceController.java deleted file mode 100644 index 36b2b20..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/MallPriceController.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.huoran.nakadai.controller; - - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.common.response.R; -import com.huoran.nakadai.entity.MallPrice; -import com.huoran.nakadai.service.MallPriceService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -/** - *

- * 商品价格表 前端控制器 - *

- * - * @author chen - * @since 2023-04-25 - */ -@Api(value = "M-商城商品价格管理", tags = "M-商城商品价格管理") -@RestController -@RequestMapping("/mallPrice") -public class MallPriceController { - - @Autowired - private MallPriceService mallPriceService; - - @ApiOperation(value = "查询商品所在省份城市结算价",response = MallPrice.class) - @PostMapping("/queryCitySettlementPrice") - public R queryCitySettlementPrice( - @ApiParam(name = "provinceId", value = "省份id", required = true) - @RequestParam Integer provinceId, - @ApiParam(name = "cityId", value = "城市id", required = true) - @RequestParam Integer cityId, - @ApiParam(name = "mallId", value = "商品id", required = true) - @RequestParam Integer mallId) { - QueryWrapper cityPriceQueryWrapper = new QueryWrapper<>(); - cityPriceQueryWrapper.eq("settlement_price_type",1) - .eq("mall_id",mallId) - .eq("city_id",cityId); - //查询城市价格,没有查询省份 - MallPrice one = mallPriceService.getOne(cityPriceQueryWrapper); - if (ObjectUtil.isNotNull(one)){ - return R.ok().put("mallPrice",one); - } - //查询省份价格,没有查询平台价 - QueryWrapper provinceQueryWrapper = new QueryWrapper<>(); - provinceQueryWrapper.eq("settlement_price_type",1) - .eq("mall_id",mallId) - .eq("area",provinceId); - MallPrice two = mallPriceService.getOne(provinceQueryWrapper); - if (ObjectUtil.isNotNull(two)){ - return R.ok().put("mallPrice",two); - } - //查询平台价 - QueryWrapper platformQueryWrapper = new QueryWrapper<>(); - platformQueryWrapper.eq("settlement_price_type",1) - .eq("mall_id",mallId) - .eq("area",0); - MallPrice three = mallPriceService.getOne(platformQueryWrapper); - if (ObjectUtil.isNotNull(three)){ - return R.ok().put("mallPrice",three); - }else { - return R.error("该商品还未设置平台结算价,联系管理员设置价格再下订单!"); - } - - } - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/MallSupplierController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/MallSupplierController.java deleted file mode 100644 index cdb517c..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/MallSupplierController.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.huoran.nakadai.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; - -/** - *

- * 商品供应商关联表 前端控制器 - *

- * - * @author chen - * @since 2023-04-25 - */ -@RestController -@RequestMapping("/mallSupplier") -public class MallSupplierController { - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/MallTagsController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/MallTagsController.java deleted file mode 100644 index 7b80e13..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/MallTagsController.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.huoran.nakadai.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; - -/** - *

- * 商品分类标签关联表 前端控制器 - *

- * - * @author chen - * @since 2023-04-25 - */ -@RestController -@RequestMapping("/mallTags") -public class MallTagsController { - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/MallTypeController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/MallTypeController.java deleted file mode 100644 index 02b5393..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/MallTypeController.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.huoran.nakadai.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; - -/** - *

- * 商品类型关联表 前端控制器 - *

- * - * @author chen - * @since 2023-04-25 - */ -@RestController -@RequestMapping("/mallType") -public class MallTypeController { - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/MessageController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/MessageController.java index 8d5bf34..be78c31 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/MessageController.java +++ b/nakadai/src/main/java/com/huoran/nakadai/controller/MessageController.java @@ -1,96 +1,104 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + package com.huoran.nakadai.controller; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; +import cn.hutool.core.util.StrUtil; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.huoran.common.response.ServerResponseEntity; +import com.huoran.nakadai.entity.model.Message; import com.huoran.nakadai.service.MessageService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.apache.commons.lang3.StringUtils; -import org.springframework.amqp.core.AmqpAdmin; -import org.springframework.amqp.core.DirectExchange; +import com.huoran.nakadai.utils.PageParam; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import javax.servlet.http.HttpServletRequest; +import java.util.Arrays; + -@Api(value = "或然中台消息管理", tags = "或然中台消息管理") @RestController -@RequestMapping("/message") +@RequestMapping("/admin/message") public class MessageController { - @Autowired - private AmqpAdmin amqpAdmin; - @Autowired private MessageService messageService; -// @Autowired -// private WebsocketService webSocketService; - -// @ApiOperation(value = "所有在线用户接收消息通知",response = SendMsgVO.class) -// @PostMapping("/refreshPageNotification") -// public void refreshPageNotification( -// @ApiParam(name = "username", value = "发送者名称", required = false) -// @RequestParam(required = false) String username, -// @ApiParam(name = "to", value = "发给谁(默认发送给所有在线用户)", required = false) -// @RequestParam(required = false) String to, -// @ApiParam(name = "content", value = "消息通知", required = false) -// @RequestParam(required = false) String content) { -// WebsocketMsgDTO websocketMsgDTO = new WebsocketMsgDTO(); -// websocketMsgDTO.setForm("系统消息"); -// if (StringUtils.isEmpty(username)){ -// websocketMsgDTO.setUsername("系统通知机器人"); -// }else { -// websocketMsgDTO.setUsername(username); -// } -// if (StringUtils.isEmpty(to)){ -// websocketMsgDTO.setTo("all"); -// }else { -// websocketMsgDTO.setTo(to); -// } -// if (StringUtils.isEmpty(content)){ -// websocketMsgDTO.setContent("refresh"); -// }else { -// websocketMsgDTO.setContent(content); -// } -// websocketMsgDTO.setExtras(null); -// webSocketService.send(websocketMsgDTO); -// } - /** - * 发送指定的用户队列 + * 分页获取 */ - @ApiOperation(value = "发送消息给指定的用户") - @GetMapping("/sendMessageToUser") - public void sendMessageToUser(String message, String accountId) { - messageService.sendMessageToUser(message,accountId); + @GetMapping("/page") + public ServerResponseEntity> page(Message message, PageParam page) { + IPage messages = messageService.page(page, new LambdaQueryWrapper() + .like(StrUtil.isNotBlank(message.getUserName()), Message::getUserName, message.getUserName()) + .eq(message.getStatus() != null, Message::getStatus, message.getStatus())); + return ServerResponseEntity.success(messages); } - - @ApiOperation(value = "接收消息") - @GetMapping("/receiveMessages") - public R receiveMessages(HttpServletRequest request,Long deliveryTag) { - String accountId = TokenUtils.getIdByJwtToken(request); - return messageService.messagesListener(accountId,deliveryTag); + /** + * 获取信息 + */ + @GetMapping("/info/{id}") + public ServerResponseEntity info(@PathVariable("id") Long id) { + Message message = messageService.getById(id); + return ServerResponseEntity.success(message); } + /** + * 保存 + */ + @PostMapping + public ServerResponseEntity save(@RequestBody Message message) { + messageService.save(message); + return ServerResponseEntity.success(); + } - - @ApiOperation(value = "创建交换机") - @GetMapping("/creatExchange") - public void creatExchange( - @ApiParam(name = "exchangeName", value = "交换机名称", required = true) - @RequestParam String exchangeName) { - DirectExchange directExchange = new DirectExchange(exchangeName,true,false); - amqpAdmin.declareExchange(directExchange); + /** + * 修改 + */ + @PutMapping + public ServerResponseEntity update(@RequestBody Message message) { + messageService.updateById(message); + return ServerResponseEntity.success(); } + /** + * 公开留言 + */ + @PutMapping("/release/{id}") + public ServerResponseEntity release(@PathVariable("id") Long id) { + Message message = new Message(); + message.setId(id); + message.setStatus(1); + messageService.updateById(message); + return ServerResponseEntity.success(); + } - @ApiOperation(value = "创建队列") - @GetMapping("/createQueue") - public void createQueue(String accountId) { - messageService.createQueue(accountId); + /** + * 取消公开留言 + */ + @PutMapping("/cancel/{id}") + public ServerResponseEntity cancel(@PathVariable("id") Long id) { + Message message = new Message(); + message.setId(id); + message.setStatus(1); + messageService.updateById(message); + return ServerResponseEntity.success(); } + /** + * 删除 + */ + @DeleteMapping("/{ids}") + public ServerResponseEntity delete(@PathVariable Long[] ids) { + messageService.removeByIds(Arrays.asList(ids)); + return ServerResponseEntity.success(); + } } diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/ModelDemoHiddenController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/ModelDemoHiddenController.java deleted file mode 100644 index 4bde5ef..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/ModelDemoHiddenController.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.huoran.nakadai.controller; - - -import com.huoran.api.UserClient; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.nakadai.entity.ModelDemoHidden; -import com.huoran.nakadai.service.ModelDemoHiddenService; -import com.huoran.nakadai.service.ModelReferenceDemoService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -/** - *

- * 此表是在教师端系统管理,可对于系统内置模型统一管理 前端控制器 - *

- * - * @author chen - * @since 2023-06-03 - */ -@RestController -@RequestMapping("/model/demo/hidden") - -@Api(value = "API - 中台:教师端可对于系统内置模型统一管理", tags = "中台:教师端可对于系统内置模型统一管理") -public class ModelDemoHiddenController { - @Autowired - private UserClient userClient; - @Autowired - public ModelDemoHiddenService service; - - @PostMapping("/batchShutdown") - @ApiOperation(value = "批量关闭(用于教师端读取系统内置模型—关闭模型) 集合传的是模型id") - public R delete(@RequestBody List ids, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - for (Integer modelId : ids) { - ModelDemoHidden details = service.viewDetails(modelId, schoolId); - if (details==null){ - ModelDemoHidden hidden = new ModelDemoHidden(); - hidden.setModelId(modelId); - hidden.setIsClose(1); - hidden.setSchoolId(schoolId); - service.save(hidden); - } - } - return R.ok(); - } - - @PostMapping("/batchOpen") - @ApiOperation(value = "批量打开(用于教师端读取系统内置模型—打开模型) 集合传的是模型id") - public R batchOpen(@RequestBody List ids, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - for (Integer modelId : ids) { - ModelDemoHidden hidden = service.viewDetails(modelId, schoolId); - service.removeById(hidden.getId()); - } - return R.ok(); - } - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/ModelReferenceCategoryController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/ModelReferenceCategoryController.java deleted file mode 100644 index 7c6a771..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/ModelReferenceCategoryController.java +++ /dev/null @@ -1,122 +0,0 @@ -package com.huoran.nakadai.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.api.UserClient; -import com.huoran.common.constant.DelConstant; -import com.huoran.common.constant.ModellConstant; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.nakadai.entity.ModelReferenceCategory; -import com.huoran.nakadai.entity.ModelSysCategory; -import com.huoran.nakadai.service.ModelReferenceCategoryService; -import com.huoran.nakadai.service.ModelSysCategoryService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -/** - *

- * 引用模型-分类表 前端控制器 - *

- * - * @author chen - * @since 2022-03-04 - */ -@RestController -@RequestMapping("/nakadai/model/reference") -@Api(value = "API - 中台:ModelReferenceCategoryController", tags = "中台:模型分类") -public class ModelReferenceCategoryController { - @Autowired - private UserClient userClient; - @Autowired - public ModelReferenceCategoryService service; - - @PostMapping("/saveReferenceCategory") - @ApiOperation(value = "新增模型分类") - public R saveReferenceCategory(@RequestBody @Validated ModelReferenceCategory modelSysCategory, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - modelSysCategory.setAccountId(Integer.valueOf(accountId)); - if (modelSysCategory.getFounder() == ModellConstant.SOURCE_INSTITUTION) { - //创建来源为院校时候赋值学校id - modelSysCategory.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - } else { - - } - boolean checkRepeat = service.checkRepeat(modelSysCategory, 0); - if (checkRepeat) { - return R.error("该层级下已有重复的分类名称了!"); - } - boolean ret = service.save(modelSysCategory); - return ret ? R.ok().put("referenceCategoryId", modelSysCategory.getId()) : R.error(); - } - - @PostMapping("/modelClassList") - @ApiOperation(value = "模型分类列表(中台、职站教师端通用)") - public R modelClassList(@RequestParam("systemId") @ApiParam(value = "系统id") Integer systemId - , @RequestParam("founder") @ApiParam(value = "创建人来源(0、系统 1、院校)") Integer founder, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = null; - if (founder == ModellConstant.SOURCE_INSTITUTION) { - //创建来源为院校时候赋值学校id - schoolId = userClient.getSchoolIdByAccountId(accountId); - } - - List list = service.modelClassList(systemId, founder, schoolId); - return R.ok().put("data", list); - } - - - @PostMapping("/builtInClassificationByNakadai") - @ApiOperation(value = "职站源模型—(读取的是中台引用模型分类表的数据)") - public R builtInClassificationByOccupationlab(@RequestParam("systemId") @ApiParam(value = "系统id") Integer systemId, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - List list = service.builtInClassificationByNakadai(systemId); - return R.ok().put("data", list); - } - - - @PostMapping("/deleteModelClass") - @ApiOperation(value = "删除模型分类") - public R deleteModelClass(@RequestParam("categoryId") @ApiParam(value = "分类id") Integer categoryId) { - return service.deleteModelClass(categoryId); - } - - @PostMapping("/updateModelClass") - @ApiOperation(value = "编辑模型分类") - public R updateModelClass(@RequestBody ModelReferenceCategory modelSysCategory, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - modelSysCategory.setAccountId(Integer.valueOf(accountId)); - boolean checkRepeat = service.checkRepeat(modelSysCategory, 1); - if (checkRepeat) { - return R.error("该层级下已有重复的分类名称了!"); - } - boolean ret = service.updateById(modelSysCategory); - return ret ? R.ok() : R.error(); - } - - @PostMapping("/checkIsShowBySystemId") - @ApiOperation(value = "根据系统id查询模型是否展示", response = ModelReferenceCategory.class) - public R checkIsShowBySystemId(@RequestParam("systemId") @ApiParam(value = "系统id") Integer systemId) { - return service.checkIsShowBySystemId(systemId); - } - - /*@PostMapping("/modifyIsShowState") - @ApiOperation(value = "更改内置模型按钮前台展示") - public R modifyIsShowState(@RequestParam("systemId") @ApiParam(value = "系统id") Integer systemId, - @RequestParam("isShow") @ApiParam(value = "是否展示->默认0为展示 1为不展示") Integer isShow) { - return service.modifyIsShowState(systemId, isShow); - }*/ - - - - - - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/ModelReferenceDemoController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/ModelReferenceDemoController.java deleted file mode 100644 index 81add18..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/ModelReferenceDemoController.java +++ /dev/null @@ -1,271 +0,0 @@ -package com.huoran.nakadai.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.api.UserClient; -import com.huoran.common.constant.ModellConstant; -import com.huoran.common.constant.PlatformConstant; -import com.huoran.common.entity.PythonCodeResp; -import com.huoran.common.exception.CustomException; -import com.huoran.common.exception.ExceptionEnum; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.nakadai.entity.ModelReferenceDemo; -import com.huoran.nakadai.entity.ModelSysCategory; -import com.huoran.nakadai.entity.ModelSysDemo; -import com.huoran.nakadai.entity.req.PageImportModelReq; -import com.huoran.nakadai.entity.req.PageModelReq; -import com.huoran.nakadai.entity.req.PythonCodeRunReq; -import com.huoran.nakadai.entity.res.ModeCategoryResp; -import com.huoran.nakadai.service.ModelReferenceDemoService; -import com.huoran.nakadai.service.ModelSysCategoryService; -import com.huoran.nakadai.service.ModelSysDemoService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -/** - *

- * 引用模型代码记录表 前端控制器 - *

- * - * @author chen - * @since 2022-03-04 - */ -@RestController -@RequestMapping("/nakadai/model/reference/demo") -@Api(value = "API - 中台:ModelReferenceDemoController", tags = "中台:模型代码记录") -public class ModelReferenceDemoController { - - @Autowired - private UserClient userClient; - @Autowired - public ModelReferenceDemoService service; - - - @Autowired - public ModelSysCategoryService sysCategoryService; - @Autowired - public ModelSysDemoService sysDemoService; - - @PostMapping("/saveReferenceDemo") - @ApiOperation(value = "导入模型") - public R saveReferenceDemo(@RequestBody @Validated List listReference, HttpServletRequest request) { - - if (listReference.size() <= 0) { - //当前选择的分类下的没有满足条件的模型! - throw new CustomException(ExceptionEnum.CLASSIFICATION_HAS_NO_MODEL_DATA); - } - - String accountId = TokenUtils.getIdByJwtToken(request); - String roleName = userClient.getUserAllRole(accountId, PlatformConstant.NAKADAI);//获取当前用户的角色 - Integer count = 0; - for (ModelReferenceDemo referenceDemo : listReference) { - referenceDemo.setModifyAccountId(Integer.valueOf(accountId)); - if (roleName != null) { - referenceDemo.setSchoolId(0); - referenceDemo.setFounder(0); - } else { - referenceDemo.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - referenceDemo.setFounder(1); - } - - - referenceDemo.setAccountId(Integer.valueOf(accountId)); - boolean ret = service.save(referenceDemo); - if (ret) { - count++; - } - } - return count == listReference.size() ? R.ok() : R.error(); - } - - - @PostMapping("/save") - @ApiOperation(value = "新增源模型分类") - public R save(@RequestBody @Validated ModelReferenceDemo modelSysCategory, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - modelSysCategory.setAccountId(Integer.valueOf(accountId)); - modelSysCategory.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - modelSysCategory.setModifyAccountId(Integer.valueOf(accountId)); - if (modelSysCategory.getFounder() == ModellConstant.SOURCE_INSTITUTION) { - //创建来源为院校时候赋值学校id - modelSysCategory.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - } - - boolean ret = service.save(modelSysCategory); - return ret ? R.ok() : R.error(); - } - - - @PostMapping("/findById") - @ApiOperation(value = "根据主键查询", response = ModelReferenceDemo.class) - public R findById(@RequestParam("id") @ApiParam(value = "序号") Integer id) { - ModelReferenceDemo referenceDemo = service.getById(id); - ModelSysDemo modelSysDemo = sysDemoService.getById(referenceDemo.getCopyId()); - referenceDemo.setModelName(modelSysDemo.getModelName()); - referenceDemo.setModelDemo(modelSysDemo.getModelDemo()); - return R.ok().put("data", referenceDemo); - } - - @PostMapping("/referenceDemoList") - @ApiOperation(value = "模型列表", response = ModelReferenceDemo.class) - public R listByEntity(@RequestBody @Validated PageModelReq req, HttpServletRequest request) { - return service.referenceDemoList(req); - } - - @PostMapping("/sortReadingModelByTeacherSideSystem") - @ApiOperation(value = "教师端——依据分类读取系统模型", response = ModelReferenceDemo.class) - public R sortReadingModelByTeacherSideSystem(@RequestBody @Validated PageModelReq req, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - req.setSchoolId(schoolId); - return service.sortReadingModelByTeacherSideSystem(req); - } - - - @PostMapping("/referenceDemoListByNakadai") - @ApiOperation(value = "职站——系统内置模型列表(读取自中台的引用且启用的模型)", response = ModelReferenceDemo.class) - public R referenceDemoListByOccupationlab(@RequestBody PageModelReq req, HttpServletRequest request) { - return service.referenceDemoListByNakadai(req); - } - - @PostMapping("/deleteReferenceDemo") - @ApiOperation(value = "批量移除") - public R delete(@RequestBody List ids) { - boolean ret = service.removeByIds(ids); - return ret ? R.ok() : R.error(); - } - - @PostMapping("/delModelInfoBySystemId") - @ApiOperation(value = "同步模型前删除原有数据") - public R delModelInfoBySystemId(@RequestParam("systemId") @ApiParam(value = "系统id") Integer systemId, - @RequestParam("founder") @ApiParam(value = "创建人来源(0、系统 1、院校)") Integer founder, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - if (founder == ModellConstant.SOURCE_SYSTEM) { - schoolId = null; - } - return service.delModelInfoBySystemId(systemId, founder, schoolId); - } - - - @PostMapping("/getAllModelList") - @ApiOperation(value = "查询全部模型列表", response = ModelReferenceDemo.class) - public R getAllModelList(@RequestBody @Validated PageImportModelReq req, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - String roleName = userClient.getUserAllRole(accountId, PlatformConstant.NAKADAI);//获取当前用户的角色 - if (req.getFounder() == ModellConstant.SOURCE_SYSTEM) { - req.setIsAdmin(1); - } else { - if (roleName != null) { - req.setIsAdmin(1); - } else { - req.setIsAdmin(0); - if (req.getIsAdmin() == 0) { - req.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - } - - } - } - - return service.getAllModelList(req); - } - - - @PostMapping("/teacherModelList") - @ApiOperation(value = "教师端模型列表", response = ModelReferenceDemo.class) - public R teacherModelList(@RequestBody @Validated PageImportModelReq req, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - req.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - return service.teacherModelList(req); - } - - - @PostMapping("systemModelByTeacher") - @ApiOperation(value = "教师端——读取系统模型(该系统模型为中台的模型列表)", response = ModelReferenceDemo.class) - public R systemModelByTeacher(@RequestBody @Validated PageImportModelReq req, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - req.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - return service.systemModelByTeacher(req); - } - - - @PostMapping("/synchronizationMdel") - @ApiOperation(value = "中台同步模型至引用模型(模型列表)") - public R synchronizationMdel(@RequestParam("systemId") @ApiParam(value = "系统id") Integer systemId, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - return service.synchronizationMdel(systemId, Integer.valueOf(accountId)); - } - - - @PostMapping("/synchronizationMdelByOccupationlab") - @ApiOperation(value = "职站同步模型至引用模型(模型列表)") - public R synchronizationMdelByOccupationlab(@RequestParam("systemId") @ApiParam(value = "系统id") Integer systemId, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - return service.synchronizationMdelByOccupationlab(systemId, schoolId, Integer.valueOf(accountId)); - } - - - /*@PostMapping("/mergeModel") - @ApiOperation(value = "合并模型") - public R mergeModel(@RequestBody @Validated List modeCategoryRespList, HttpServletRequest request) { - - if (modeCategoryRespList.size() <= 0) { - //当前选择的分类下的没有满足条件的模型! - throw new CustomException(ExceptionEnum.CLASSIFICATION_HAS_NO_MODEL_DATA); - } - - return R.ok(); - } -*/ - - - - /*@ApiOperation("根据分类id查询该分类下的所有子分类id") - @PostMapping("/selectCategoryChildById") - public String selectCategoryChildById(Integer id) { - - //1 创建list集合,用于封装所有删除菜单id值 - List idList = new ArrayList<>(); - //2 向idList集合设置删除菜单id - this.selectCategoryChildById(id + "", idList);//找到当前菜单的子菜单 把结果id封装到idlist里面去 - //把当前id封装到list里面 - idList.add(id);//现在把当前id封装进去 之前都是子菜单的id - String str = ""; - for (Integer idstr : idList) { - str += idstr + ","; - } - return str.substring(0, str.length()-1); - } - - //2 根据当前菜单id,查询菜单里面子菜单id,封装到list集合 - public void selectCategoryChildById(String id, List idList) { - //查询菜单里面子菜单id - QueryWrapper wrapper = new QueryWrapper(); - wrapper.eq("founder", 1); - wrapper.eq("school_id", id); - wrapper.eq("is_del", 0); - - wrapper.select("id");//我们只想查询id 所以只需要查询指定列的值 - List childIdList = sysCategoryService.list(wrapper);//当前菜单的所有子菜单 - //把childIdList里面菜单id值获取出来,封装idList里面,做递归查询 - childIdList.stream().forEach(item -> {//遍历集合得到每一个对象item - //封装idList里面 - idList.add(item.getId()); - //递归查询 - this.selectCategoryChildById(item.getId() + "", idList); - }); - }*/ - - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/ModelSysCategoryController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/ModelSysCategoryController.java deleted file mode 100644 index 73f0849..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/ModelSysCategoryController.java +++ /dev/null @@ -1,153 +0,0 @@ -package com.huoran.nakadai.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.api.UserClient; -import com.huoran.common.constant.DelConstant; -import com.huoran.common.constant.ModellConstant; -import com.huoran.common.utils.TokenUtils; -import com.huoran.nakadai.entity.Customer; -import com.huoran.nakadai.entity.ModelReferenceCategory; -import com.huoran.nakadai.entity.ModelSysCategory; -import com.huoran.nakadai.entity.ModelSysDemo; -import com.huoran.nakadai.entity.req.ModelSysDemoReq; -import com.huoran.nakadai.service.ICustomerService; -import com.huoran.nakadai.service.ModelSysCategoryService; -import io.swagger.annotations.*; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import com.huoran.common.response.R; - -import javax.servlet.http.HttpServletRequest; -import java.util.ArrayList; -import java.util.List; - -/** - * @描述:源模型-分类表控制类 - * @作者: Rong - * @日期: 2022-03-03 - */ -@RestController -@RequestMapping("/nakadai/model/category") -@Api(value = "API - 中台:ModelSysCategoryController", tags = "中台:源模型分类") -public class ModelSysCategoryController { - @Autowired - private UserClient userClient; - @Autowired - public ModelSysCategoryService service; - @Autowired - public ICustomerService customerService; - @PostMapping("/save") - @ApiOperation(value = "新增源模型分类") - public R save(@RequestBody @Validated ModelSysCategory modelSysCategory, HttpServletRequest request) { - boolean checkRepeat = service.checkRepeat(modelSysCategory, 0); - String accountId = TokenUtils.getIdByJwtToken(request); - modelSysCategory.setAccountId(Integer.valueOf(accountId)); - modelSysCategory.setSchoolId(0); - if (modelSysCategory.getFounder() == ModellConstant.SOURCE_INSTITUTION) { - //创建来源为院校时候赋值学校id - modelSysCategory.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - } - - if (checkRepeat) { - return R.error("该层级下已有重复的分类名称了!"); - } - boolean ret = service.save(modelSysCategory); - return ret ? R.ok() : R.error(); - } - - @PostMapping("/sourceModelClassification") - @ApiOperation(value = "源模型分类列表") - public R sourceModelClassification(@RequestParam("founder") @ApiParam(value = "创建人来源(0、系统 1、院校)") Integer founder, HttpServletRequest request) { - - ModelSysDemoReq req = new ModelSysDemoReq(); - req.setFounder(founder); - if (founder == ModellConstant.SOURCE_INSTITUTION) { - String accountId = TokenUtils.getIdByJwtToken(request); - //创建来源为院校时候赋值学校id - req.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - } - List sourceModelClassification = service.sourceModelClassification(req); - return R.ok().put("data", sourceModelClassification); - } - - @PostMapping("/primaryClassification") - @ApiOperation(value = "一级分类") - public R primaryClassification() { - List primaryClassification = service.primaryClassification(); - return R.ok().put("data", primaryClassification); - } - - @PostMapping("/classificationByPid") - @ApiOperation(value = "根据父id查询分类下的分类") - public R classificationByPid(@RequestParam("parentId") @ApiParam(value = "分类父id") Integer parentId) { - List primaryClassification = service.classificationByPid(parentId); - return R.ok().put("data", primaryClassification); - } - - @PostMapping("/deleteSourceModelCategory") - @ApiOperation(value = "删除源模型分类") - public R deleteSourceModelCategory(@RequestParam("categoryId") @ApiParam(value = "分类id") Integer categoryId) { - return service.deleteSourceModelCategory(categoryId); - } - - @PostMapping("/updateSourceModelCategory") - @ApiOperation(value = "编辑源模型分类") - public R update(@RequestBody ModelSysCategory modelSysCategory, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - modelSysCategory.setAccountId(Integer.valueOf(accountId)); - boolean checkRepeat = service.checkRepeat(modelSysCategory, 1); - - if (checkRepeat) { - return R.error("该层级下已有重复的分类名称了!"); - } - boolean ret = service.updateById(modelSysCategory); - return ret ? R.ok() : R.error(); - } - - - @PostMapping("/builtInModelClassification") - @ApiOperation(value = "学校模型内置分类(用于新增订单后给学校内置数据)") - public R builtInModelClassification(@RequestParam("schoolId") @ApiParam(value = "学校id") Integer schoolId) { - ModelSysCategory modelSysCategory = new ModelSysCategory(); - modelSysCategory.setCategoryName("全部"); - modelSysCategory.setParentId(0); - modelSysCategory.setLevel(0); - modelSysCategory.setFounder(ModellConstant.SOURCE_INSTITUTION); - modelSysCategory.setIsOpen(0); - modelSysCategory.setSchoolId(schoolId); - modelSysCategory.setAccountId(1); - boolean ret = service.save(modelSysCategory); - return ret ? R.ok() : R.error(); - } - - @PostMapping("/batchBuiltInModelClassification") - @ApiOperation(value = "学校模型内置分类(用于新增订单后给学校内置数据)") - public R batchBuiltInModelClassification() { - - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("is_del",0); - queryWrapper.last(" GROUP BY school_id"); - List list = customerService.list(queryWrapper); - for (Customer customer: list ) { - ModelSysCategory modelSysCategory = new ModelSysCategory(); - modelSysCategory.setCategoryName("全部"); - modelSysCategory.setParentId(0); - modelSysCategory.setLevel(0); - modelSysCategory.setFounder(ModellConstant.SOURCE_INSTITUTION); - modelSysCategory.setIsOpen(0); - modelSysCategory.setSchoolId(customer.getSchoolId()); - modelSysCategory.setAccountId(1); - boolean ret = service.save(modelSysCategory); - } - return R.ok() ; - } - - -} - - - - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/ModelSysDemoController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/ModelSysDemoController.java deleted file mode 100644 index afc8757..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/ModelSysDemoController.java +++ /dev/null @@ -1,405 +0,0 @@ -package com.huoran.nakadai.controller; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.huoran.api.UserClient; -import com.huoran.common.aop.annotation.NoRepeatSubmit; -import com.huoran.common.constant.ModellConstant; -import com.huoran.common.constant.PlatformConstant; -import com.huoran.common.entity.PythonCodeResp; -import com.huoran.common.exception.CustomException; -import com.huoran.common.exception.ExceptionEnum; -import com.huoran.common.utils.TokenUtils; -import com.huoran.nakadai.entity.DataProduct; -import com.huoran.nakadai.entity.ModelReferenceDemo; -import com.huoran.nakadai.entity.ModelSysDemo; -import com.huoran.nakadai.entity.req.CopyTheModelToTheNakadaiReq; -import com.huoran.nakadai.entity.req.DisableEnableModelReq; -import com.huoran.nakadai.entity.req.PageModelReq; -import com.huoran.nakadai.entity.req.PythonCodeRunReq; -import com.huoran.nakadai.service.ModelSysDemoService; -import io.swagger.annotations.*; -import org.apache.commons.lang.StringUtils; -import org.apache.ibatis.annotations.Param; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import com.huoran.common.response.R; - -import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; -import java.io.IOException; -import java.util.List; - -/** - * @描述:源模型代码记录表控制类 - * @作者: Rong - * @日期: 2022-03-04 - */ -@RestController -@RequestMapping("/nakadai/model/demo") -@Api(value = "API - 中台:ModelSysDemoController", tags = "中台:源模型代码记录") -public class ModelSysDemoController { - @Autowired - private UserClient userClient; - @Autowired - public ModelSysDemoService service; - - @Autowired - private StringRedisTemplate redisTemplate; - - @PostMapping("/saveSysModelDemo") - @ApiOperation(value = "新增源模型") - public R save(@RequestBody @Validated ModelSysDemo modelSysDemo, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - modelSysDemo.setAccountId(Integer.valueOf(accountId)); - modelSysDemo.setModifyAccountId(Integer.valueOf(accountId)); - if (modelSysDemo.getFounder() == ModellConstant.SOURCE_INSTITUTION) { - //创建来源为院校时候赋值学校id - modelSysDemo.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - } - - boolean ret = service.save(modelSysDemo); - return ret ? R.ok() : R.error(); - } - - @PostMapping("/updateSysModelDemo") - @ApiOperation(value = "修改") - public R update(@RequestBody ModelSysDemo modelSysDemo, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - - - ModelSysDemo sysDemo = service.getById(modelSysDemo.getId()); - //(0、系统 1、院校) - if (modelSysDemo.getIsAdmin() == null) { - modelSysDemo.setModifyAccountId(Integer.valueOf(accountId)); - } - - - boolean ret = service.updateById(modelSysDemo); - return ret ? R.ok() : R.error(); - } - - @PostMapping("/deleteSysModelDemo") - @ApiOperation(value = "批量删除") - public R delete(@RequestBody List ids) { - boolean ret = service.removeByIds(ids); - return ret ? R.ok() : R.error(); - } - - /* @PostMapping("/bulkDisable") - @ApiOperation(value = "批量禁用启用") - public R bulkDisable(@RequestParam(value = "isOpen") @ApiParam(value = "启用状态(0开启 1禁用 默认0)") Integer isOpen, @RequestBody List ids, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer count = 0; - for (Integer id : ids) { - ModelSysDemo modelSysDemo = new ModelSysDemo(); - modelSysDemo.setModifyAccountId(Integer.valueOf(accountId)); - modelSysDemo.setIsOpen(isOpen); - modelSysDemo.setId(id); - boolean ret = service.updateById(modelSysDemo); - if (ret) { - count++; - } - - } - - return count == ids.size() ? R.ok() : R.error(); - }*/ - - @PostMapping("/findById") - @ApiOperation(value = "根据主键查询", response = ModelSysDemo.class) - public R findById(@RequestParam("id") @ApiParam(value = "序号") Integer id) { - ModelSysDemo modelSysDemo = service.getById(id); - return R.ok().put("data", modelSysDemo); - } - - @PostMapping("/sysModelDemoList") - @ApiOperation(value = "源模型列表(依据分类id查的模型列表)", response = ModelSysDemo.class) - public R listByEntity(@RequestBody @Validated PageModelReq req, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - String roleName = userClient.getUserAllRole(accountId, PlatformConstant.NAKADAI);//获取当前用户的角色 - if (roleName != null) { - req.setIsAdmin(1); - } else { - req.setIsAdmin(0); - req.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - } - return service.sysModelDemoList(req); - } - - @PostMapping("/runPythonCode") - @ApiOperation(value = "运行python代码", response = PythonCodeResp.class) - public R runPythonCode(@RequestBody @Validated PythonCodeRunReq req) throws IOException { - return service.runCode(req.getCode()); - } - - @PostMapping("/getAllModelListBySys") - @ApiOperation(value = "源模型-查询全部模型列表", response = ModelSysDemo.class) - public R getAllModelListBySys(@RequestBody PageModelReq req, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - if (req.getFounder() == ModellConstant.SOURCE_INSTITUTION) { - //创建来源为院校时候赋值学校id - req.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - } - return service.getAllModelListBySys(req); - } - - - /** - * 中台端读取院校模型 未删除、未禁用的模型。 - * - * @param req - * @param request - * @return - */ - @PostMapping("/InstitutionSourceModel") - @ApiOperation(value = "中台端——院校源模型/教师端——源模型", response = ModelSysDemo.class) - public R InstitutionSourceModel(@RequestBody PageModelReq req, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - String roleName = userClient.getUserAllRole(accountId, PlatformConstant.NAKADAI);//获取当前用户的角色 - if (roleName != null) { - req.setIsAdmin(1); - } else { - req.setIsAdmin(0); - req.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - } - return service.InstitutionSourceModel(req); - } - - - @NoRepeatSubmit - @ApiOperation(value = "模型禁启用", response = ModelSysDemo.class) - @PostMapping("/disabledEvents") - public R disabledEvents(@RequestBody List list, HttpServletRequest request) { - boolean ret = false; - for (DisableEnableModelReq req : list) { - String accountId = TokenUtils.getIdByJwtToken(request); - //modelSysDemo:查看当前模型禁启用状态 - ModelSysDemo modelSysDemo = service.getById(req.getModelId()); - ModelSysDemo sysDemo = new ModelSysDemo(); - sysDemo.setId(req.getModelId()); - //禁用平台来源(0中台,1职站教师端 2.职站学生端) - switch (req.getType()) { - case 0: - sysDemo.setZtOpen(req.getIsOpen()); -// sysDemo.setIsOpen(req.getIsOpen()); - break; - case 1: - // 客户创建的模型,禁用时职站首页以及学生登录后的模型模块看不到对应的模型,创建的老师在模型管理还是可以看到该模型,可以编辑,但是无法启用。 - // 即中台禁用的模型,即使是该院校老师创建的,老师端也不能自己启用,需要中台启用。 - //1.判断当前院校禁启用状态为要启用时候再判断当前赛事中台禁启用的状态 - if (req.getIsOpen() == 0) { - if (modelSysDemo.getZtOpen() == 1) { - return R.error("当前模型已被平台禁用,请联系平台管理员!"); - } - } - sysDemo.setIsOpen(req.getIsOpen()); - break; - - } - ret = service.updateById(sysDemo); - } - - - //保存的key名 - String key = "modelDisabled"; - //以时间戳方式保存到缓存中 - redisTemplate.opsForValue().set(key, System.currentTimeMillis() + ""); - return R.ok(); - } - - - /** - * 禁用/启用的时候,把时间戳写入那个key,前端第一次调用的时候,把时间戳写入本地缓存 - * 然后前端通过定时器获取这个redis缓存的接口 - * 只要获取到的值跟本地缓存的不一致就刷新列表 - * - * @return - */ - @PostMapping("/getRedisCache") - @ApiOperation(value = "获取Redis缓存(返回的时间戳只要获取到的值跟本地缓存的不一致就刷新列表)") - public R getRedisCache() { - //保存的key名 - String key = "modelDisabled"; - //查看缓存是否有数据 - String returnValue = redisTemplate.opsForValue().get(key); - - //使用缓存返回数据 - if (returnValue != null) { - return R.ok().put("data", returnValue); - } - - - return R.ok(); - } - - - @PostMapping("/copyTheModelToTheNakadai") - @ApiOperation(value = "中台端复制院校模型", response = ModelSysDemo.class) - public R copyTheModelToTheNakadai(@RequestBody CopyTheModelToTheNakadaiReq req, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - req.setAccountId(Integer.valueOf(accountId)); - return service.copyTheModelToTheNakadai(req); - } - - - @PostMapping("/controlPasteCode") - @ApiOperation(value = "控制是否学生端可以粘贴代码") - public R controlPasteCode(@RequestParam("systemId") @ApiParam(value = "系统id") Integer systemId, - @RequestParam("isShow") @ApiParam(value = "是否展示->默认true为展示 false为不展示") String isShow, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - //保存的key名 - String key = "controlPasteCode:systemId:" + systemId + "schoolId:" + schoolId; - redisTemplate.opsForValue().set(key, isShow); - return R.ok(); - } - - - @PostMapping("/whetherCanPaste") - @ApiOperation(value = "查询是否能粘贴") - public R whetherCanPaste(@RequestParam("systemId") @ApiParam(value = "系统id") Integer systemId, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - //保存的key名 - String key = "controlPasteCode:systemId:" + systemId + "schoolId:" + schoolId; - //查看缓存是否有数据 - String returnValue = redisTemplate.opsForValue().get(key); - - //使用缓存返回数据 - if (returnValue != null) { - return R.ok().put("data", returnValue); - } - redisTemplate.opsForValue().set(key, "true"); - return R.ok().put("data", "true"); - } - - - @PostMapping("/builtInModelButtonDisplayByNakadai") - @ApiOperation(value = "中台控制教师端内置模型按钮展示(用于中台禁用按钮后控制教师端的模型按钮)") - public R builtInModelButtonDisplayByNakadai(@RequestParam("systemId") @ApiParam(value = "系统id") Integer systemId, - @RequestParam("isShow") @ApiParam(value = "是否展示->默认true为展示 false为不展示") String isShow) { - //保存的key名 - String key = "builtInModelButtonDisplay:systemId:" + systemId; - redisTemplate.opsForValue().set(key, isShow); - - //查看缓存是否有数据 - String returnValue = redisTemplate.opsForValue().get(key); - //没有则内置数据 - if (returnValue == null) { - redisTemplate.opsForValue().set(key, "true"); - } - - return R.ok(); - } - - - @PostMapping("/builtInModelState") - @ApiOperation(value = "中台显示内置模型状态") - public R builtInModelState(@RequestParam("systemId") @ApiParam(value = "系统id") Integer systemId) { - //保存的key名 - String key = "builtInModelButtonDisplay:systemId:" + systemId; - //查看缓存是否有数据 - String returnValue = redisTemplate.opsForValue().get(key); - //没有则内置数据 - if (returnValue == null) { - redisTemplate.opsForValue().set(key, "true"); - } - - return R.ok(returnValue); - } - - - @PostMapping("/builtInModelStateByTeacher") - @ApiOperation(value = "职站教师端显示内置模型状态(基于中台禁用、启用后教师端的模型列表以及源模型列表展示依据该接口展示)") - public R builtInModelStateByTeacher(@RequestParam("systemId") @ApiParam(value = "系统id") Integer systemId, HttpServletRequest request) { - //保存的key名 - String key = "builtInModelButtonDisplay:systemId:" + systemId; - //查看缓存是否有数据 - String returnValue = redisTemplate.opsForValue().get(key); - //没有则内置数据 - if (returnValue == null) { - redisTemplate.opsForValue().set(key, "true"); - } - - return R.ok(returnValue); - } - - @PostMapping("/displayListOrNotByTeacher") - @ApiOperation(value = "职站教师端是否展示模型列表以及源模型管理(true表示展示 false不展示)") - public R displayListOrNotByTeacher(@RequestParam("systemId") @ApiParam(value = "系统id") Integer systemId, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - //保存的key名 - String key = "builtInModelButtonDisplayByTeacher:systemId:" + systemId + "schoolId:" + schoolId; - //查看缓存是否有数据 - String returnValue = redisTemplate.opsForValue().get(key); - if (returnValue == null) { - //没有则内置数据 - redisTemplate.opsForValue().set(key, "true"); - return R.ok().put("teacherButtonStatus", "true"); - } - //使用缓存返回数据 - return R.ok().put("teacherButtonStatus", returnValue); - - } - - - @PostMapping("/builtInModelButtonDisplayByTeacher") - @ApiOperation(value = "教师端控制学生端内置模型按钮展示") - public R builtInModelButtonDisplayByTeacher(@RequestParam("systemId") @ApiParam(value = "系统id") Integer systemId, - @RequestParam("isShow") @ApiParam(value = "是否展示->默认true为展示 false为不展示") String isShow, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - //保存的key名 - String key = "builtInModelButtonDisplayByTeacher:systemId:" + systemId + "schoolId:" + schoolId; - redisTemplate.opsForValue().set(key, isShow); - //查看缓存是否有数据 - String returnValue = redisTemplate.opsForValue().get(key); - //没有则内置数据 - if (returnValue == null) { - redisTemplate.opsForValue().set(key, "true"); - } - return R.ok(returnValue); - } - - - @PostMapping("/displayListOrNotByStudent") - @ApiOperation(value = "学生端是否展示模型列表以及源模型管理(true表示展示 false不展示)") - public R displayListOrNotByStudent(@RequestParam("systemId") @ApiParam(value = "系统id") Integer systemId, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - - - //中台控制的key - String middleConsoleControlKey = "builtInModelButtonDisplay:systemId:" + systemId; - //查看中台缓存是否有数据 - String returnValueByNakadai = redisTemplate.opsForValue().get(middleConsoleControlKey); - //没有则内置数据 - if (returnValueByNakadai == null) { - redisTemplate.opsForValue().set(middleConsoleControlKey, "true"); - returnValueByNakadai = redisTemplate.opsForValue().get(middleConsoleControlKey); - } - - String key = "builtInModelButtonDisplayByTeacher:systemId:" + systemId + "schoolId:" + schoolId; - String returnValue = redisTemplate.opsForValue().get(key); - //没有则内置数据 - if (returnValue == null) { - redisTemplate.opsForValue().set(key, "true"); - returnValue = redisTemplate.opsForValue().get(key); - } - - - //中台和职站一并开启才能启用 - if (returnValueByNakadai.equals("true") && returnValue.equals("true")) { - return R.ok().put("studentSideShowsTheStatus", "true"); - } - return R.ok().put("studentSideShowsTheStatus", "false"); - - } -} - - - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/NoticeController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/NoticeController.java new file mode 100644 index 0000000..4a5c5ba --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/controller/NoticeController.java @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.controller; + + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.huoran.common.response.ServerResponseEntity; +import com.huoran.nakadai.entity.model.Notice; +import com.huoran.nakadai.service.NoticeService; +import com.huoran.nakadai.utils.PageParam; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.Date; + +/** + * 公告管理 + * + * @author hzm + * @date + */ +@RestController +@AllArgsConstructor +@RequestMapping("/shop/notice") +public class NoticeController { + + private final NoticeService noticeService; + + /** + * 分页查询 + * + * @param page 分页对象 + * @param notice 公告管理 + * @return 分页数据 + */ + @GetMapping("/page") + public ServerResponseEntity> getNoticePage(PageParam page, Notice notice) { + IPage noticePage = noticeService.page(page, new LambdaQueryWrapper() + .eq(notice.getStatus() != null, Notice::getStatus, notice.getStatus()) + .eq(notice.getIsTop()!=null,Notice::getIsTop,notice.getIsTop()) + .like(notice.getTitle() != null, Notice::getTitle, notice.getTitle()).orderByDesc(Notice::getUpdateTime)); + return ServerResponseEntity.success(noticePage); + } + + + /** + * 通过id查询公告管理 + * + * @param id id + * @return 单个数据 + */ + @GetMapping("/info/{id}") + public ServerResponseEntity getById(@PathVariable("id") Long id) { + return ServerResponseEntity.success(noticeService.getById(id)); + } + + /** + * 新增公告管理 + * + * @param notice 公告管理 + * @return 是否新增成功 + */ + @PostMapping + public ServerResponseEntity save(@RequestBody @Valid Notice notice) { + if (notice.getStatus() == 1) { + notice.setPublishTime(new Date()); + } + notice.setUpdateTime(new Date()); + noticeService.removeNoticeList(); + return ServerResponseEntity.success(noticeService.save(notice)); + } + + /** + * 修改公告管理 + * + * @param notice 公告管理 + * @return 是否修改成功 + */ + @PutMapping + public ServerResponseEntity updateById(@RequestBody @Valid Notice notice) { + Notice oldNotice = noticeService.getById(notice.getId()); + if (oldNotice.getStatus() == 0 && notice.getStatus() == 1) { + notice.setPublishTime(new Date()); + } + notice.setUpdateTime(new Date()); + noticeService.removeNoticeList(); + noticeService.removeNoticeById(notice.getId()); + return ServerResponseEntity.success(noticeService.updateById(notice)); + } + + /** + * 通过id删除公告管理 + * + * @param id id + * @return 是否删除成功 + */ + @DeleteMapping("/{id}") + public ServerResponseEntity removeById(@PathVariable Long id) { + noticeService.removeNoticeList(); + noticeService.removeNoticeById(id); + return ServerResponseEntity.success(noticeService.removeById(id)); + } + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/OSSFileController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/OSSFileController.java deleted file mode 100644 index c46084b..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/OSSFileController.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.huoran.nakadai.controller; - -import com.huoran.common.entity.FilesResult; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.nakadai.service.OSSFileService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.servlet.http.HttpServletRequest; -import java.io.IOException; -import java.util.List; - -/** - * @Author chen - * @DATE 2021/7/13 10:09 - * @Version 1.0 - */ -@Api(tags = "阿里云文件/视频管理") -@RestController -@RequestMapping("/nakadai/oss") -public class OSSFileController { - - @Autowired - private OSSFileService ossFileService; - - @ApiOperation(value = "文件上传") - @PostMapping("/fileUpload") - public R fileUpload( - @ApiParam(name = "file", value = "文件", required = true) - @RequestParam("file") MultipartFile file, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - if (file == null) { - return R.error("请选择文件"); - } - try { - //获取上传路径 - FilesResult filesResult = ossFileService.upload(file); - return R.ok().put("filesResult", filesResult); - } catch (IOException e) { - e.printStackTrace(); - return R.error(); - } - } - - /** - * 批量删除文件 - * - * @param keys 多个文件完整名称集合 - */ - @ApiOperation(value = "删除OSS文件") - @DeleteMapping("/fileDeletion") - public R fileDeletion( - @ApiParam(name = "keys", value = "文件完整名称集合", required = true) - @RequestParam("keys") List keys, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - if (keys != null && keys.size() != 0) { - List deletedObjects = ossFileService.fileDeletion(keys); - return R.ok().put("deletedObjects", deletedObjects); - } else { - return R.error(); - } - } - - - @ApiOperation(value = "获取播放凭证") - @GetMapping("getPlayAuth/{videoId}") - public R getVideoPlayAuth( - @ApiParam(name = "videoId", value = "视频Id", required = true) - @PathVariable("videoId") String videoId) { - - try { - String playAuth = ossFileService.getPlayAuth(videoId); - return R.ok().put("playAuth", playAuth); - } catch (com.aliyuncs.exceptions.ClientException e) { - e.printStackTrace(); - return R.error(e.getMessage()); - } - - } - - @ApiOperation(value = "删除视频文件") - @DeleteMapping("/removeVideo/{videoId}") - public R removeVideo( - @ApiParam(name = "videoId", value = "视频Id", required = true) - @PathVariable String videoId){ - try { - ossFileService.removeVideo(videoId); - return R.ok("删除视频成功"); - } catch (com.aliyuncs.exceptions.ClientException e) { - e.printStackTrace(); - return R.error(e.getMessage()); - } - } - -} diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/OrderController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/OrderController.java index c8a8a1c..a149a4d 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/OrderController.java +++ b/nakadai/src/main/java/com/huoran/nakadai/controller/OrderController.java @@ -1,140 +1,367 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + package com.huoran.nakadai.controller; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.date.DatePattern; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.io.IORuntimeException; +import cn.hutool.core.io.IoUtil; +import cn.hutool.poi.excel.ExcelUtil; +import cn.hutool.poi.excel.ExcelWriter; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.huoran.common.response.R; -import com.huoran.nakadai.entity.Mall; -import com.huoran.nakadai.entity.Order; -import com.huoran.nakadai.entity.OrderOther; -import com.huoran.nakadai.entity.PartnerTeam; -import com.huoran.nakadai.entity.req.DeleteIds; -import com.huoran.nakadai.entity.req.OrderListReq; -import com.huoran.nakadai.entity.res.ExportSubscribedRecordsResp; -import com.huoran.nakadai.entity.vo.OrderVo; -import com.huoran.nakadai.service.IOrderService; -import com.huoran.nakadai.service.MallService; -import com.huoran.nakadai.service.OrderOtherService; -import com.huoran.nakadai.service.PartnerTeamService; -import io.swagger.annotations.Api; +import com.google.common.base.Objects; +import com.huoran.common.exception.YamiShopBindException; +import com.huoran.common.response.ServerResponseEntity; +import com.huoran.common.utils.TokenUtils; +import com.huoran.nakadai.entity.app.dto.*; +import com.huoran.nakadai.entity.app.param.OrderParam; +import com.huoran.nakadai.entity.app.param.OrderShopParam; +import com.huoran.nakadai.entity.app.param.SubmitOrderParam; +import com.huoran.nakadai.entity.enums.OrderStatus; +import com.huoran.nakadai.entity.model.Order; +import com.huoran.nakadai.entity.model.OrderItem; +import com.huoran.nakadai.entity.model.UserAddr; +import com.huoran.nakadai.entity.model.UserAddrOrder; + +import com.huoran.nakadai.entity.param.DeliveryOrderParam; +import com.huoran.nakadai.service.OrderItemService; +import com.huoran.nakadai.service.OrderService; +import com.huoran.nakadai.service.ProductService; +import com.huoran.nakadai.service.SkuService; +import com.huoran.nakadai.utils.Arith; +import com.huoran.nakadai.utils.PageParam; import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; +import lombok.extern.slf4j.Slf4j; +import org.apache.poi.ss.usermodel.Sheet; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.format.annotation.DateTimeFormat; import org.springframework.web.bind.annotation.*; +import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import java.math.BigDecimal; -import java.util.HashMap; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; import java.util.List; -import java.util.concurrent.ExecutionException; + +import static com.huoran.nakadai.utils.SpringContextUtils.applicationContext; /** - *

- * 订单表 前端控制器 - *

- * - * @author huoran - * @since 2021-06-28 + * @author lgh on 2018/09/15. */ -@Api(tags = "订单管理") +@Slf4j @RestController -@RequestMapping("/nakadai/order") +@RequestMapping("/order/order") public class OrderController { @Autowired - private IOrderService orderService; + private OrderService orderService; @Autowired - private OrderOtherService orderOtherService; + private OrderItemService orderItemService; @Autowired - private MallService mallService; + private ProductService productService; @Autowired - private PartnerTeamService partnerTeamService; - - @ApiOperation(value = "添加订单") - @PostMapping("/add") - public R add( - @ApiParam(name = "orderVo", value = "订单数据", required = true) - @RequestBody @Valid OrderVo orderVo) throws ExecutionException, InterruptedException { - return orderService.addOrder(orderVo); - } + private SkuService skuService; - @ApiOperation(value = "订单列表", response = IPage.class) - @PostMapping("/list") - public R list(@ApiParam(name = "orderListReq", value = "查询条件", required = true) @RequestBody OrderListReq orderListReq) { - HashMap orderPage = orderService.orderList(orderListReq); - return R.ok().put("orderPage", orderPage); - } - @ApiOperation(value = "订单详情", response = OrderVo.class) - @GetMapping("/get") - public R get(@ApiParam(name = "orderId", value = "订单id", required = true) @RequestParam @Valid @NotNull Integer orderId) { - OrderVo orderDetails = orderService.queryOrderDetails(orderId); - PartnerTeam rateInformation = null; - if (orderDetails.getOrder().getBusinessManagerId() != null && orderDetails.getOrder().getTeamId() != null) { - //查询费率 - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("classification_id", orderDetails.getOrder().getTeamId()); - rateInformation = partnerTeamService.getOne(queryWrapper); +// @PostMapping("/sendInquiryForm") +// @ApiOperation(value = "根据店铺发送询价单给商家或留言") +// public ServerResponseEntity confirm(@Valid @RequestBody OrderParam orderParam,HttpServletRequest request) { +// String userId = SecurityUtils.getUser().getUserId(); +// TokenUtils.getShopIdByJwtToken(request); +// // 订单的地址信息 +// UserAddr userAddr = userAddrService.getUserAddrByUserId(orderParam.getAddrId(), userId); +// UserAddrDto userAddrDto = BeanUtil.copyProperties(userAddr, UserAddrDto.class); +// +// +// // 组装获取用户提交的购物车商品项 +// List shopCartItems = basketService.getShopCartItemsByOrderItems(orderParam.getBasketIds(),orderParam.getOrderItem(),userId); +// +// if (CollectionUtil.isEmpty(shopCartItems)) { +// throw new YamiShopBindException("请选择您需要的商品加入购物车"); +// } +// +// // 根据店铺组装购车中的商品信息,返回每个店铺中的购物车商品信息 +// List shopCarts = basketService.getShopCarts(shopCartItems); +// +// // 将要返回给前端的完整的订单信息 +// ShopCartOrderMergerDto shopCartOrderMergerDto = new ShopCartOrderMergerDto(); +// +// shopCartOrderMergerDto.setUserAddr(userAddrDto); +// +// // 所有店铺的订单信息 +// List shopCartOrders = new ArrayList<>(); +// +// double actualTotal = 0.0; +// double total = 0.0; +// int totalCount = 0; +// double orderReduce = 0.0; +// for (ShopCartDto shopCart : shopCarts) { +// +// // 每个店铺的订单信息 +// ShopCartOrderDto shopCartOrder = new ShopCartOrderDto(); +// shopCartOrder.setShopId(shopCart.getShopId()); +// shopCartOrder.setShopName(shopCart.getShopName()); +// +// +// List shopCartItemDiscounts = shopCart.getShopCartItemDiscounts(); +// +// // 店铺中的所有商品项信息 +// List shopAllShopCartItems = new ArrayList<>(); +// for (ShopCartItemDiscountDto shopCartItemDiscount : shopCartItemDiscounts) { +// List discountShopCartItems = shopCartItemDiscount.getShopCartItems(); +// shopAllShopCartItems.addAll(discountShopCartItems); +// } +// +// shopCartOrder.setShopCartItemDiscounts(shopCartItemDiscounts); +// +// applicationContext.publishEvent(new ConfirmOrderEvent(shopCartOrder,orderParam,shopAllShopCartItems)); +// +// actualTotal = Arith.add(actualTotal,shopCartOrder.getActualTotal()); +// total = Arith.add(total,shopCartOrder.getTotal()); +// totalCount = totalCount + shopCartOrder.getTotalCount(); +// orderReduce = Arith.add(orderReduce,shopCartOrder.getShopReduce()); +// shopCartOrders.add(shopCartOrder); +// +// +// } +// +// shopCartOrderMergerDto.setActualTotal(actualTotal); +// shopCartOrderMergerDto.setTotal(total); +// shopCartOrderMergerDto.setTotalCount(totalCount); +// shopCartOrderMergerDto.setShopCartOrders(shopCartOrders); +// shopCartOrderMergerDto.setOrderReduce(orderReduce); +// +// shopCartOrderMergerDto = orderService.putConfirmOrderCache(userId, shopCartOrderMergerDto); +// +// return ServerResponseEntity.success(shopCartOrderMergerDto); +// } + + /** + * 分页获取 + */ +// @GetMapping("/page") +// public ServerResponseEntity> page(OrderParam orderParam, PageParam page, HttpServletRequest request) { +// Integer shopId = TokenUtils.getShopIdByJwtToken(request); +// orderParam.setShopId(shopId); +// IPage orderPage = orderService.pageOrdersDetailByOrderParam(page, orderParam); +// return ServerResponseEntity.success(orderPage); +// } + + /** + * 获取信息 + */ + @GetMapping("/orderInfo/{orderNumber}") + public ServerResponseEntity info(@PathVariable("orderNumber") String orderNumber,HttpServletRequest request) { + Integer shopId = TokenUtils.getShopIdByJwtToken(request); + Order order = orderService.getOrderByOrderNumber(orderNumber); + if (!Objects.equal(shopId, order.getShopId())) { + throw new YamiShopBindException("您没有权限获取该订单信息"); } + List orderItems = orderItemService.getOrderItemsByOrderNumber(orderNumber); + order.setOrderItems(orderItems); +// UserAddrOrder userAddrOrder = userAddrOrderService.getById(order.getAddrOrderId()); +// order.setUserAddrOrder(userAddrOrder); + return ServerResponseEntity.success(order); + } - BigDecimal annualMarketingFee = null; - if (rateInformation!=null && rateInformation.getAnnualMarketingFee() != null) { - annualMarketingFee = rateInformation.getAnnualMarketingFee().divide(new BigDecimal(100)); + /** + * 发货 + */ + @PutMapping("/delivery") + public ServerResponseEntity delivery(@RequestBody DeliveryOrderParam deliveryOrderParam,HttpServletRequest request) { + Integer shopId = TokenUtils.getShopIdByJwtToken(request); + Order order = orderService.getOrderByOrderNumber(deliveryOrderParam.getOrderNumber()); + if (!Objects.equal(shopId, order.getShopId())) { + throw new YamiShopBindException("您没有权限修改该订单信息"); } - return R.ok().put("orderDetails", orderDetails).put("annualMarketingFee",annualMarketingFee ); - } + Order orderParam = new Order(); + orderParam.setOrderId(order.getOrderId()); + orderParam.setDvyId(deliveryOrderParam.getDvyId()); + orderParam.setDvyFlowId(deliveryOrderParam.getDvyFlowId()); + orderParam.setDvyTime(new Date()); + orderParam.setStatus(OrderStatus.CONSIGNMENT.value()); + orderParam.setUserId(order.getUserId()); - @ApiOperation(value = "批量删除订单") - @PostMapping("/delete") - public R delete(@ApiParam(name = "orderIds", value = "订单ids", required = true) @RequestBody DeleteIds orderIds) { - boolean delete = orderService.deleteOrders(orderIds.getIds()); - return delete ? R.ok() : R.error(); - } + orderService.delivery(orderParam); - @ApiOperation(value = "更新订单") - @PostMapping("/update") - public R update(@ApiParam(name = "orderVo", value = "订单数据", required = true) @RequestBody @Valid OrderVo orderVo) { - boolean update = orderService.updateOrder(orderVo); - return update ? R.ok() : R.error(); + List orderItems = orderItemService.getOrderItemsByOrderNumber(deliveryOrderParam.getOrderNumber()); + for (OrderItem orderItem : orderItems) { + productService.removeProductCacheByProdId(orderItem.getProdId()); + skuService.removeSkuCacheBySkuId(orderItem.getSkuId(),orderItem.getProdId()); + } + return ServerResponseEntity.success(); } /** - * 查询客户订单 + * 打印待发货的订单表 * - * @param customerId 客户id + * @param order + * @param consignmentName 发件人姓名 + * @param consignmentMobile 发货人手机号 + * @param consignmentAddr 发货地址 */ - @GetMapping("/getCustomerOrder") - public R getCustomerOrder(Integer customerId) { - List orderList = orderService.list(new QueryWrapper().eq("customer_id", customerId)); - return R.ok().put("orderList", orderList); - } + @GetMapping("/waitingConsignmentExcel") + public void waitingConsignmentExcel(Order order, @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date startTime, + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date endTime, String consignmentName, String consignmentMobile, + String consignmentAddr, HttpServletResponse response,HttpServletRequest request) { + Integer shopId = TokenUtils.getShopIdByJwtToken(request); + order.setShopId(shopId); + order.setStatus(OrderStatus.PADYED.value()); + List orders = orderService.listOrdersDetailByOrder(order, startTime, endTime); + + //通过工具类创建writer + ExcelWriter writer = ExcelUtil.getBigWriter(); + Sheet sheet = writer.getSheet(); + sheet.setColumnWidth(0, 20 * 256); + sheet.setColumnWidth(1, 20 * 256); + sheet.setColumnWidth(2, 20 * 256); + sheet.setColumnWidth(3, 60 * 256); + sheet.setColumnWidth(4, 60 * 256); + sheet.setColumnWidth(7, 60 * 256); + sheet.setColumnWidth(8, 60 * 256); + sheet.setColumnWidth(9, 60 * 256); + // 待发货 + String[] hearder = {"订单编号", "收件人", "手机", "收货地址", "商品名称", "数量", "发件人姓名", "发件人手机号", "发货地址", "备注"}; + writer.merge(hearder.length - 1, "发货信息整理"); + writer.writeRow(Arrays.asList(hearder)); - @ApiOperation(value = "中台-导出Excel已订阅记录") - @PostMapping(value = "/exportSubscribedRecords", produces = "application/json;multipart/form-data;charset=utf-8") - public void exportSubscribedRecords(@RequestBody List listOfExportSub, HttpServletResponse response, HttpServletRequest request) throws Exception { - orderService.exportSubscribedRecords(listOfExportSub, response); + int row = 1; + for (Order dbOrder : orders) { + UserAddrOrder addr = dbOrder.getUserAddrOrder(); + String addrInfo = addr.getProvince() + addr.getCity() + addr.getArea() + addr.getAddr(); + List orderItems = dbOrder.getOrderItems(); + row++; + for (OrderItem orderItem : orderItems) { + // 第0列开始 + int col = 0; + writer.writeCellValue(col++, row, dbOrder.getOrderNumber()); + writer.writeCellValue(col++, row, addr.getReceiver()); + writer.writeCellValue(col++, row, addr.getMobile()); + writer.writeCellValue(col++, row, addrInfo); + writer.writeCellValue(col++, row, orderItem.getProdName()); + writer.writeCellValue(col++, row, orderItem.getProdCount()); + writer.writeCellValue(col++, row, consignmentName); + writer.writeCellValue(col++, row, consignmentMobile); + writer.writeCellValue(col++, row, consignmentAddr); + writer.writeCellValue(col++, row, dbOrder.getRemarks()); + } + } + writeExcel(response, writer); } - @ApiOperation(value = "历史订单补充产品数据") - @PostMapping(value = "/supplementaryMallId") - public void supplementaryMallId() { - List list = orderOtherService.list(new QueryWrapper().eq("is_del",1)); - for (OrderOther orderOther : list) { - if (orderOther.getMallId()==null){ - //根据订单名称查询对应的商品id - Mall mall = mallService.getOne(new QueryWrapper().eq("associated_product_name", orderOther.getProductName())); - if (mall!=null){ - orderOther.setMallId(mall.getMallId()); - orderOtherService.updateById(orderOther); - } + /** + * 已销售订单 + * + * @param order + */ + @GetMapping("/soldExcel") + public void soldExcel(Order order, @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date startTime, + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date endTime, HttpServletResponse response,HttpServletRequest request) { + Integer shopId = TokenUtils.getShopIdByJwtToken(request); + order.setShopId(shopId); + order.setIsPayed(1); + List orders = orderService.listOrdersDetailByOrder(order, startTime, endTime); + + //通过工具类创建writer + ExcelWriter writer = ExcelUtil.getBigWriter(); + // 待发货 + String[] hearder = {"订单编号", "下单时间", "收件人", "手机", "收货地址", "商品名称", "数量", "订单应付", "订单运费", "订单实付"}; + Sheet sheet = writer.getSheet(); + sheet.setColumnWidth(0, 20 * 256); + sheet.setColumnWidth(1, 20 * 256); + sheet.setColumnWidth(3, 20 * 256); + sheet.setColumnWidth(4, 60 * 256); + sheet.setColumnWidth(5, 60 * 256); + + writer.merge(hearder.length - 1, "销售信息整理"); + writer.writeRow(Arrays.asList(hearder)); + + int row = 1; + for (Order dbOrder : orders) { + UserAddrOrder addr = dbOrder.getUserAddrOrder(); + String addrInfo = addr.getProvince() + addr.getCity() + addr.getArea() + addr.getAddr(); + List orderItems = dbOrder.getOrderItems(); + int firstRow = row + 1; + int lastRow = row + orderItems.size(); + int col = -1; + // 订单编号 + mergeIfNeed(writer, firstRow, lastRow, ++col, col, dbOrder.getOrderNumber()); + // 下单时间 + mergeIfNeed(writer, firstRow, lastRow, ++col, col, dbOrder.getCreateTime()); + // 收件人 + mergeIfNeed(writer, firstRow, lastRow, ++col, col, addr.getReceiver()); + // "手机" + mergeIfNeed(writer, firstRow, lastRow, ++col, col, addr.getMobile()); + // "收货地址" + mergeIfNeed(writer, firstRow, lastRow, ++col, col, addrInfo); + int prodNameCol = ++col; + int prodCountCol = ++col; + for (OrderItem orderItem : orderItems) { + row++; + // 商品名称 + writer.writeCellValue(prodNameCol, row, orderItem.getProdName()); + // 数量 + writer.writeCellValue(prodCountCol, row, orderItem.getProdCount()); } + // 订单应付 + mergeIfNeed(writer, firstRow, lastRow, ++col, col, dbOrder.getTotal()); + // 订单运费 + mergeIfNeed(writer, firstRow, lastRow, ++col, col, dbOrder.getFreightAmount()); + // 订单实付 + mergeIfNeed(writer, firstRow, lastRow, ++col, col, dbOrder.getActualTotal()); + } + writeExcel(response, writer); } + /** + * 如果需要合并的话,就合并 + */ + private void mergeIfNeed(ExcelWriter writer, int firstRow, int lastRow, int firstColumn, int lastColumn, Object content) { + if (content instanceof Date) { + content = DateUtil.format((Date) content, DatePattern.NORM_DATETIME_PATTERN); + } + if (lastRow - firstRow > 0 || lastColumn - firstColumn > 0) { + writer.merge(firstRow, lastRow, firstColumn, lastColumn, content, false); + } else { + writer.writeCellValue(firstColumn, firstRow, content); + } + + } + + private void writeExcel(HttpServletResponse response, ExcelWriter writer) { + //response为HttpServletResponse对象 + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + //test.xls是弹出下载对话框的文件名,不能为中文,中文请自行编码 + response.setHeader("Content-Disposition", "attachment;filename=1.xls"); + + ServletOutputStream servletOutputStream = null; + try { + servletOutputStream = response.getOutputStream(); + writer.flush(servletOutputStream); + servletOutputStream.flush(); + } catch (IORuntimeException | IOException e) { + log.error("写出Excel错误:", e); + } finally { + IoUtil.close(writer); + } + } } diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/OrderOtherController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/OrderOtherController.java deleted file mode 100644 index eca92d4..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/OrderOtherController.java +++ /dev/null @@ -1,141 +0,0 @@ -package com.huoran.nakadai.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.common.entity.to.JudgmentPointDataTo; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.nakadai.entity.OrderOther; -import com.huoran.nakadai.entity.req.BulkShipOrdersReq; -import com.huoran.nakadai.entity.req.QueryTimeReq; -import com.huoran.nakadai.entity.vo.OrderRenewVo; -import com.huoran.nakadai.service.OrderOtherService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; -import java.util.ArrayList; -import java.util.List; - -/** - *

- * 订单其他信息(包含课程权限、数据平台权限、合同信息等) 前端控制器 - *

- * - * @author cheney - * @since 2021-07-01 - */ -@Api(tags = "订单内容管理") -@RestController -@RequestMapping("/nakadai/orderOther") -public class OrderOtherController { - - @Autowired - private OrderOtherService orderOtherService; - - @ApiOperation(value = "订单发货") - @PostMapping("/ship") - public R ship(@RequestBody OrderOther orderOther) { - boolean update = orderOtherService.ship(orderOther); - return update ? R.ok() : R.error(); - } - - @ApiOperation(value = "批量发货") - @PostMapping("/bulkShipping") - public R bulkShipping(@RequestBody BulkShipOrdersReq bulkShipOrdersReq) { - boolean update = orderOtherService.bulkShipping(bulkShipOrdersReq); - return update ? R.ok() : R.error(); - } - - @ApiOperation(value = "是否启用订单") - @PostMapping("/enable") - public R enable( - @ApiParam(name = "id", value = "货品id", required = true) - @RequestParam @Valid @NotNull(message = "货品id不能为空") Integer id, - @ApiParam(name = "flag", value = "标识", required = true) - @RequestParam @Valid @Size(max = 1) Integer flag) { - boolean update = orderOtherService.enable(id, flag); - return update ? R.ok() : R.error(); - } - - @ApiOperation(value = "续费查询之前产品信息") - @PostMapping("/renew") - public R renew(@RequestBody @Valid OrderRenewVo orderRenewVo) { - ArrayList orderOthers = orderOtherService.renew(orderRenewVo); - return R.ok().put("orderOthers", orderOthers); - } - - /** - * 查询订单其他信息 - */ - @GetMapping("/getOrderOther") - public R getOrderOther(Integer orderId, Integer authority) { - List orderOtherList = orderOtherService. - list(new QueryWrapper().eq("order_id", orderId).eq("authority", authority)); - return R.ok().put("orderOtherList", orderOtherList); - } - - /** - * 查询客户订单信息 - */ - @ApiOperation(value = "查询客户订单信息") - @PostMapping("/getCustomerOrderOther") - public JudgmentPointDataTo getCustomerOrderOther(@RequestParam Integer schoolId, @RequestParam Integer systemId, @RequestParam String name) { - return orderOtherService.getCustomerOrderOther(schoolId, systemId, name); - } - - /** - * 查询订单内容时间 - */ - @ApiOperation(value = "查询订单内容时间") - @PostMapping("/getOrderOtherTime") - public R getOrderOtherTime(@RequestBody QueryTimeReq queryTimeReq) { - String newTime = orderOtherService.getOrderOtherTime(queryTimeReq); - return R.ok().put("endTime", newTime); - } - - /** - * 定时任务处理剩余期限(每日凌晨一点执行一遍) - */ - @Scheduled(cron = "0 0 1 * * ?") - // @ApiOperation(value = "定时任务处理剩余期限") - // @PostMapping("/remainingPeriod") - public void remainingPeriod() { - orderOtherService.remainingPeriod(); - } - - /** - * 定时任务处理客户到期时间(每日凌晨两点执行一遍) - */ - @Scheduled(cron = "0 0 2 * * ?") - // @PostMapping("/remainingPeriod") - public void customerExpiration() { - orderOtherService.customerExpiration(); - } - - @PostMapping("/orderBulkDisableEnable") - @ApiOperation(value = "订单批量禁用启用") - public R orderBulkDisableEnable(@RequestParam(value = "isOpen") @ApiParam(value = "是否开启(0不开启,1开启,发货后,默认开启)") Integer isOpen, @RequestBody List ids, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer count = 0; - for (Integer id : ids) { - OrderOther orderOther = new OrderOther(); - orderOther.setIsEnable(isOpen); - orderOther.setId(id); - boolean ret = orderOtherService.updateById(orderOther); - if (ret) { - count++; - } - - } - - return count == ids.size() ? R.ok() : R.error(); - } -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/PartnerAccountController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/PartnerAccountController.java deleted file mode 100644 index f5468fd..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/PartnerAccountController.java +++ /dev/null @@ -1,217 +0,0 @@ -package com.huoran.nakadai.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.common.exception.CustomException; -import com.huoran.common.exception.ExceptionEnum; -import com.huoran.common.response.R; -import com.huoran.nakadai.entity.PartnerAccount; -import com.huoran.nakadai.entity.PartnerClassification; -import com.huoran.nakadai.entity.PartnerTeam; -import com.huoran.nakadai.entity.req.*; -import com.huoran.nakadai.entity.res.PartnerAccountResp; -import com.huoran.nakadai.entity.vo.TeamMemberVo; -import com.huoran.nakadai.service.PartnerAccountService; -import com.huoran.nakadai.service.PartnerClassificationService; -import com.huoran.nakadai.service.PartnerTeamService; -import com.huoran.nakadai.utils.GenerateCodeUtil; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.redis.core.RedisTemplate; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; -import java.util.concurrent.TimeUnit; - -/** - *

- * 合伙人账号表 前端控制器 - *

- * - * @author chen - * @since 2022-05-18 - */ -@Api(tags = "合伙人账号管理") -@RestController -@RequestMapping("/nakadai/partnerAccount") -public class PartnerAccountController { - - @Autowired - public PartnerAccountService partnerAccountService; - - @Autowired - public PartnerTeamService partnerTeamService; - - @Autowired - public PartnerClassificationService partnerClassificationService; - - @Autowired - private RedisTemplate redisTemplate; - - /** - * 生成专属邀请码 - */ - @PostMapping("/generateInvitationCode") - @ApiOperation(value = "生成专属邀请码") - public R generateInvitationCode(@RequestParam("accountId") String accountId) { - //存在直接返回邀请码 - String code = redisTemplate.opsForValue().get(accountId+"invitationCode"); - if (StringUtils.isEmpty(code)){ - code = GenerateCodeUtil.generateCode(); - redisTemplate.opsForValue().set(accountId+"invitationCode",code,7, TimeUnit.DAYS); - } - //过期时间 - Long expireTime = redisTemplate.opsForValue().getOperations().getExpire(accountId+"invitationCode"); - return R.ok().put("invitationCode",code).put("expireTime",expireTime); - } - - @ApiOperation(value = "邀请二维码生成") - @GetMapping(value = "/generationQrCode",produces = "image/png") - public void generationQrCode( - @ApiParam(name = "url", value = "链接", required = true) - @RequestParam String url, HttpServletResponse response){ - partnerAccountService.generationQrCode(url,response); - } - - /** - * 新增合伙人账号 - */ - @PostMapping("/savePartnerAccount") - @ApiOperation(value = "新增合伙人账号") - public R savePartnerAccount(@RequestBody @Valid PartnerAccountAddReq partnerAccountAddReq) { - return partnerAccountService.savePartnerAccount(partnerAccountAddReq); - } - - /** - * 合伙人账号列表 - */ - @PostMapping("/partnerAccountList") - @ApiOperation(value = "合伙人账号列表(查询分类下所有团队及成员)", response = PartnerAccountResp.class) - public R partnerAccountList(@RequestBody @Valid PartnerAccountListReq req) { - return partnerAccountService.pagePartnerAccountList(req); - } - - @PostMapping("/partnerAccountMergeList") - @ApiOperation(value = "合伙人账号列表--合并数据查询(以账号为维度查询合并-中台调用)", response = PartnerAccountResp.class) - public R partnerAccountMergeList(@RequestBody @Valid PartnerAccountListReq req) { - return partnerAccountService.partnerAccountMergeList(req); - } - - @PostMapping("/teamPartnerList") - @ApiOperation(value = "团队合伙人列表(以团队维度查询-小程序调用)", response = PartnerAccountResp.class) - public R teamPartnerList(@RequestBody @Valid PartnerAccountListReq req) { - return partnerAccountService.teamPartnerList(req); - } - - @PostMapping("/queryTeamMembers") - @ApiOperation(value = "查询团队成员", response = PartnerAccountResp.class) - public R queryTeamMembers(@RequestBody TeamMemberVo teamMemberVo) { - return partnerAccountService.queryTeamMembers(teamMemberVo); - } - - /** - * 合伙人账号详情 - */ - @GetMapping("/partnerAccountDetail") - // @ApiOperation(value = "合伙人账号详情", response = PartnerAccountResp.class) - public R partnerAccountDetail(@ApiParam(name = "accountId", value = "合伙人账号账号id") - @RequestParam Integer accountId) { - return partnerAccountService.partnerAccountDetail(accountId); - } - - /** - * 编辑合伙人账号 - */ - @PostMapping("/modifyPartnerAccount") - // @ApiOperation(value = "编辑合伙人账号") - public R modifyPartnerAccount(@RequestBody @Valid PartnerAccountUpdateReq updateReq) { - return partnerAccountService.modifyPartnerAccount(updateReq); - } - - /** - * 生成转让邀请码 - */ - @PostMapping("/generateTransferCode") - @ApiOperation(value = "生成转让邀请码") - public R generateTransferCode(@RequestParam("accountId") String accountId) { - //存在直接返回邀请码 - String code = redisTemplate.opsForValue().get(accountId+"transferCode"); - if (StringUtils.isEmpty(code)){ - code = GenerateCodeUtil.generateCode(); - redisTemplate.opsForValue().set(accountId+"transferCode",code,1, TimeUnit.DAYS); - } - //过期时间 - Long expireTime = redisTemplate.opsForValue().getOperations().getExpire(accountId+"transferCode"); - return R.ok().put("transferCode",code).put("expireTime",expireTime); - } - - @PostMapping("/transferAdmin") - @ApiOperation(value = "新增转让超管") - public R transferAdmin(@RequestBody @Valid TransferAdminReq transferAdminReq) { - return partnerAccountService.transferAdmin(transferAdminReq); - } - - @PostMapping("/transferTeam") - @ApiOperation(value = "团队内转让超管") - public R transferTeam(@RequestBody @Valid TransferTeamReq transferTeamReq) { - return partnerAccountService.transferTeam(transferTeamReq); - } - - /** - * 删除团队 - */ - @PostMapping("/delPartnerAccount") - @ApiOperation(value = "删除合伙人") - public R delPartnerAccount( - @ApiParam(name = "accountId", value = "账号id") - @RequestParam Integer accountId) { - return partnerAccountService.delPartnerAccount(accountId); - } - - /** - * 移除团队 - */ - @GetMapping("/partnerRemoval") - @ApiOperation(value = "移除团队") - public R partnerRemoval( - @ApiParam(name = "teamId", value = "团队id") - @RequestParam String teamId, - @ApiParam(name = "partnerId", value = "合伙人id") - @RequestParam String partnerId) { - PartnerClassification partnerClassification = partnerClassificationService.getById(teamId); - if (partnerClassification.getIsTeam() == 1) { - throw new CustomException(ExceptionEnum.PARTNER_REMOVAL); - } - PartnerAccount partnerAccount = partnerAccountService.getById(partnerId); - //删除团队成员 - partnerClassificationService.removeById(Integer.parseInt(teamId)); - //同步删除该团队相关角色信息 - partnerClassificationService.removeRole(teamId,partnerAccount.getAccountId()); - return partnerTeamService.remove(new QueryWrapper(). - eq("partner_id", partnerId). - eq("classification_id", teamId)) ? R.ok() : R.error(); - } - - @PostMapping("/mailFileSend") - @ApiOperation(value = "邮箱文案发送") - public R mailFileSend(@RequestBody FileSendReq fileSendReq) { - return partnerAccountService.mailFileSend(fileSendReq); - } - - - @ApiOperation(value = "查询合伙人账号信息") - @PostMapping("/queryPartnerAccount") - public R queryPartnerAccount(@RequestParam String phone) { - return partnerAccountService.queryPartnerAccount(phone); - } - - @ApiOperation(value = "合伙人账号申请注册") - @PostMapping("/partnerAccountApplication") - public R partnerAccountApplication(@RequestBody @Valid PartnerRegisterReq registerReq) { - return partnerAccountService.partnerAccountApplication(registerReq); - } -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/PartnerArticleClassificationController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/PartnerArticleClassificationController.java deleted file mode 100644 index c2ebb72..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/PartnerArticleClassificationController.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.huoran.nakadai.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.nakadai.entity.PartnerArticleClassification; -import com.huoran.nakadai.service.PartnerArticleClassificationService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; - - -/** - * @描述:合伙人——文章管理——文章所属分类控制类 - * @作者: Rong - * @日期: 2023-03-16 - */ -@RestController -@RequestMapping("/nakadai/partner/article/classification") -@Api(value = "合伙人——文章管理——文章所属分类:PartnerArticleClassificationController", tags = "R-合伙人——文章所属分类") -public class PartnerArticleClassificationController { - - @Autowired - public PartnerArticleClassificationService service; - - - @PostMapping("/queryClassificationByType") - @ApiOperation(value = "依据类型查询分类", response = PartnerArticleClassification.class) - public R allTheQuery(@ApiParam(name = "typeId", value = "类型(1.学习2.资讯3.方案)", required = true) @RequestParam Integer typeId) { - List list = service.list(new QueryWrapper() - .eq("type_id", typeId)); - return R.ok().put("data",list); - } - - - @PostMapping("/findById") - @ApiOperation(value = "查询详情", response = PartnerArticleClassification.class) - public R findById(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { - PartnerArticleClassification partnerArticleClassification = service.getById(id); - return R.ok().put("data", partnerArticleClassification); - } - - - @PostMapping("/checkForHeavy") - @ApiOperation(value = "分类校验判重", response = PartnerArticleClassification.class) - public R checkForHeavy(@ApiParam(name = "typeId", value = "类型(1.学习2.资讯", required = true) @RequestParam Integer typeId, - @ApiParam(name = "classificationName", value = "分类名称", required = true) @RequestParam String classificationName, - @ApiParam(name = "classificationId", value = "分类id(新增不传,编辑传)", required = false) @RequestParam Integer classificationId) { - - QueryWrapper queryWrapper = new QueryWrapper().eq("type_id", typeId). - eq("classification_name", classificationName); - - //id不得空表示编辑校验 - if (classificationId != null) { - queryWrapper.last(" and id != " + classificationId); - } - PartnerArticleClassification sysContentClassification = service.getOne(queryWrapper); - if (sysContentClassification != null) { - return R.error("当前分类名称已存在!"); - } - return R.ok(); - - } - - - @PostMapping("/save") - @ApiOperation(value = "新增", response = PartnerArticleClassification.class) - public R save(@RequestBody @ApiParam(name = "合伙人——文章管理——文章所属分类对象", value = "传入json格式", required = true) PartnerArticleClassification partnerArticleClassification, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - partnerArticleClassification.setFounderId(Integer.parseInt(accountId)); - partnerArticleClassification.setEditorId(Integer.parseInt(accountId)); - boolean addState = service.save(partnerArticleClassification); - return addState ? R.ok() : R.error("新增失败"); - } - - - @PostMapping("/update") - @ApiOperation(value = "修改", response = PartnerArticleClassification.class) - public R update(@RequestBody @ApiParam(name = "合伙人——文章管理——文章所属分类对象", value = "传入json格式", required = true) PartnerArticleClassification partnerArticleClassification, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - partnerArticleClassification.setEditorId(Integer.parseInt(accountId)); - boolean updateState = service.updateById(partnerArticleClassification); - return updateState ? R.ok() : R.error("编辑失败"); - } - - - @PostMapping("/batchDeletion") - @ApiOperation(value = "批量删除", response = PartnerArticleClassification.class) - public R batchDeletion(@ApiParam(name = "id", value = "主键", required = true) @RequestParam List ids) { - boolean delState = service.removeByIds(ids); - return delState ? R.ok() : R.error("删除失败"); - } -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/PartnerArticleFileController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/PartnerArticleFileController.java deleted file mode 100644 index df2bc6f..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/PartnerArticleFileController.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.huoran.nakadai.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.nakadai.entity.PartnerArticleFile; -import com.huoran.nakadai.service.PartnerArticleFileService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; - - -/** - * @描述:合伙人——文章管理——文章附件管理表控制类 - * @作者: Rong - * @日期: 2023-03-16 - */ -@RestController -@RequestMapping("/nakadai/partner/article/file") -@Api(value = "合伙人——文章管理——文章附件管理表:PartnerArticleFileController", tags = "R-合伙人——文章附件管理表") -public class PartnerArticleFileController { - - @Autowired - public PartnerArticleFileService service; - - - @PostMapping("/theAttachmentUnderTheQueryColumn") - @ApiOperation(value = "查询文章id下的附件", response = PartnerArticleFile.class) - public R theAttachmentUnderTheQueryColumn(@ApiParam(name = "contentId", value = "文章id", required = true) @RequestParam Integer contentId) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("content_id",contentId); - List sysContentFile = service.list(queryWrapper); - return R.ok().put("data",sysContentFile); - } - - - - - @PostMapping("/findById") - @ApiOperation(value = "查询详情", response = PartnerArticleFile.class) - public R findById(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { - PartnerArticleFile partnerArticleFile = service.getById(id); - return R.ok().put("data", partnerArticleFile); - } - - - @PostMapping("/save") - @ApiOperation(value = "新增", response = PartnerArticleFile.class) - public R save(@RequestBody @ApiParam(name = "合伙人——文章管理——文章附件管理表对象", value = "传入json格式", required = true) PartnerArticleFile partnerArticleFile, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - partnerArticleFile.setFounderId(Integer.parseInt(accountId)); - partnerArticleFile.setEditorId(Integer.parseInt(accountId)); - boolean addState = service.save(partnerArticleFile); - return addState ? R.ok() : R.error("新增失败"); - } - - - @PostMapping("/update") - @ApiOperation(value = "修改", response = PartnerArticleFile.class) - public R update(@RequestBody @ApiParam(name = "合伙人——文章管理——文章附件管理表对象", value = "传入json格式", required = true) PartnerArticleFile partnerArticleFile, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - partnerArticleFile.setEditorId(Integer.parseInt(accountId)); - boolean updateState = service.updateById(partnerArticleFile); - return updateState ? R.ok() : R.error("编辑失败"); - } - - - @PostMapping("/batchDeletion") - @ApiOperation(value = "批量删除", response = PartnerArticleFile.class) - public R batchDeletion(@ApiParam(name = "id", value = "主键", required = true) @RequestParam List ids) { - boolean delState = service.removeByIds(ids); - return delState ? R.ok() : R.error("删除失败"); - } -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/PartnerArticleLabelController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/PartnerArticleLabelController.java deleted file mode 100644 index ece2882..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/PartnerArticleLabelController.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.huoran.nakadai.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.nakadai.entity.PartnerArticleLabel; -import com.huoran.nakadai.service.PartnerArticleLabelService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; - - -/** - * @描述:合伙人——文章管理——文章主题标签控制类 - * @作者: Rong - * @日期: 2023-03-16 - */ -@RestController -@RequestMapping("/nakadai/partner/article/label") -@Api(value = "合伙人——文章管理——文章主题标签:PartnerArticleLabelController", tags = "R-合伙人——文章主题标签") -public class PartnerArticleLabelController { - - @Autowired - public PartnerArticleLabelService service; - - - @PostMapping("/queryAllArticleSubjectTags") - @ApiOperation(value = "查询全部文章主题标签(文章主题标签不区分)", response = PartnerArticleLabel.class) - public R queryAllArticleSubjectTags() { - List list = service.list(null); - return R.ok().put("data", list); - } - - - @PostMapping("/findById") - @ApiOperation(value = "查询详情", response = PartnerArticleLabel.class) - public R findById(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { - PartnerArticleLabel partnerArticleLabel = service.getById(id); - return R.ok().put("data", partnerArticleLabel); - } - - - @PostMapping("/save") - @ApiOperation(value = "新增", response = PartnerArticleLabel.class) - public R save(@RequestBody @ApiParam(name = "合伙人——文章管理——文章主题标签对象", value = "传入json格式", required = true) PartnerArticleLabel partnerArticleLabel, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - partnerArticleLabel.setFounderId(Integer.parseInt(accountId)); - partnerArticleLabel.setEditorId(Integer.parseInt(accountId)); - boolean addState = service.save(partnerArticleLabel); - return addState ? R.ok() : R.error("新增失败"); - } - - - @PostMapping("/checkForHeavy") - @ApiOperation(value = "标签校验判重", response = PartnerArticleLabel.class) - public R checkForHeavy( @ApiParam(name = "labelName", value = "标签名称", required = true) @RequestParam String labelName, @ApiParam(name = "labelId", value = "标签id(新增不传,编辑传)", required = false) @RequestParam Integer labelId) { - - QueryWrapper queryWrapper = new QueryWrapper().eq("label_name", labelName); - - //id不得空表示编辑校验 - if (labelId != null) { - queryWrapper.last(" and id != " + labelId); - } - PartnerArticleLabel contentLabel = service.getOne(queryWrapper); - if (contentLabel != null) { - return R.error("当前标签名称已存在!"); - } - return R.ok(); - - } - - - @PostMapping("/update") - @ApiOperation(value = "修改", response = PartnerArticleLabel.class) - public R update(@RequestBody @ApiParam(name = "合伙人——文章管理——文章主题标签对象", value = "传入json格式", required = true) PartnerArticleLabel partnerArticleLabel, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - partnerArticleLabel.setEditorId(Integer.parseInt(accountId)); - boolean updateState = service.updateById(partnerArticleLabel); - return updateState ? R.ok() : R.error("编辑失败"); - } - - - @PostMapping("/batchDeletion") - @ApiOperation(value = "批量删除", response = PartnerArticleLabel.class) - public R batchDeletion(@ApiParam(name = "id", value = "主键", required = true) @RequestParam List ids) { - boolean delState = service.removeByIds(ids); - return delState ? R.ok() : R.error("删除失败"); - } -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/PartnerArticleManagementController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/PartnerArticleManagementController.java deleted file mode 100644 index 63d1905..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/PartnerArticleManagementController.java +++ /dev/null @@ -1,216 +0,0 @@ -package com.huoran.nakadai.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; -import com.huoran.api.UserClient; -import com.huoran.common.constant.DelConstant; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.nakadai.entity.PartnerArticleFile; -import com.huoran.nakadai.entity.PartnerArticleManagement; -import com.huoran.nakadai.entity.PartnerArticleManagementCollect; -import com.huoran.nakadai.entity.req.PagePartnerArticleManagementReq; -import com.huoran.nakadai.entity.res.PartnerArticleManagementResp; -import com.huoran.nakadai.entity.vo.ContentHeavyTitleReqVO; -import com.huoran.nakadai.service.*; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; -import java.util.Date; -import java.util.List; - - -/** - * @描述:合伙人——文章管理控制类 - * @作者: Rong - * @日期: 2023-03-16 - */ -@RestController -@RequestMapping("/nakadai/partner/article/management") -@Api(value = "合伙人——文章管理:PartnerArticleManagementController", tags = "R-合伙人——文章管理") -public class PartnerArticleManagementController { - - @Autowired - public PartnerArticleManagementService service; - - @Autowired - public PartnerArticleManagementCollectService articleManagementCollectService; - - @Autowired - public PartnerArticleClassificationService classificationService; - - @Autowired - public PartnerArticleFileService fileService; - - @Autowired - public PartnerArticleLabelService labelService; - @Autowired - private UserClient userClient; - - @PostMapping("/partnerOperatingList") - @ApiOperation(value = "合伙人运营列表", response = PartnerArticleManagementResp.class) - public R partnerOperatingList(@RequestBody PagePartnerArticleManagementReq partnerArticleManagement, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - partnerArticleManagement.setAccountId(Integer.valueOf(accountId)); - return service.partnerOperatingList(partnerArticleManagement); - } - - - @PostMapping("/findById") - @ApiOperation(value = "查询详情", response = PartnerArticleManagement.class) - public R findById(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { - PartnerArticleManagement partnerArticleManagement = service.getById(id); - List fileList = fileService.getFileByContentId(id); - partnerArticleManagement.setFileList(fileList); - partnerArticleManagement.setClassificationNameList(classificationService.categoryIdsQueriesCategoryInformation(partnerArticleManagement.getClassificationId() + "")); - partnerArticleManagement.setLabelNameList((labelService.idsQueriesLabelInformation(partnerArticleManagement.getLableId() + ""))); - return R.ok().put("data", partnerArticleManagement); - } - - - @PostMapping("/save") - @ApiOperation(value = "新增", response = PartnerArticleManagement.class) - public R save(@RequestBody @ApiParam(name = "合伙人文章管理对象", value = "传入json格式", required = true) PartnerArticleManagement articleManagement, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - articleManagement.setFounderId(Integer.parseInt(accountId)); - articleManagement.setEditorId(Integer.parseInt(accountId)); - /* - QueryWrapper queryWrap = new QueryWrapper<>(); - queryWrap.eq("type_id", articleManagement.getTypeId()); - Integer count = service.count(queryWrap); - if (count == 0) { - count = 1; - }*/ -// articleManagement.setSequence(count + 1); - boolean addState = service.save(articleManagement); - //附件新增数据处理 - if (articleManagement.getFileList().size() > 0) { - for (PartnerArticleFile partnerArticleFile : articleManagement.getFileList()) { - partnerArticleFile.setContentId(articleManagement.getId()); - partnerArticleFile.setFounderId(Integer.parseInt(accountId)); - partnerArticleFile.setEditorId(Integer.parseInt(accountId)); - fileService.save(partnerArticleFile); - } - } - return addState ? R.ok() : R.error("新增失败"); - } - - - @PostMapping("/update") - @ApiOperation(value = "修改", response = PartnerArticleManagement.class) - public R update(@RequestBody @ApiParam(name = "合伙人——文章管理对象", value = "传入json格式", required = true) PartnerArticleManagement partnerArticleManagement, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); -// partnerArticleManagement.setFounderId(Integer.parseInt(accountId)); - partnerArticleManagement.setEditorId(Integer.parseInt(accountId)); - ContentHeavyTitleReqVO content = new ContentHeavyTitleReqVO(); - content.setTitle(partnerArticleManagement.getTitle()); - content.setTypeId(partnerArticleManagement.getTypeId()); - content.setId(partnerArticleManagement.getId()); - boolean verify = service.checkIfTheTitleIsRepeat(content); - if (verify == false) { - return R.error("该标题已重复"); - } - - UpdateWrapper updateWrapper = new UpdateWrapper<>(); - updateWrapper.set("is_del", DelConstant.IS_DEL); - updateWrapper.eq("content_id", partnerArticleManagement.getId()); - fileService.update(new PartnerArticleFile(), updateWrapper); - - - //附件新增数据处理 - if (partnerArticleManagement.getFileList().size() > 0) { - for (PartnerArticleFile partnerArticleFile : partnerArticleManagement.getFileList()) { - partnerArticleFile.setContentId(partnerArticleManagement.getId()); - partnerArticleFile.setFounderId(Integer.parseInt(accountId)); - partnerArticleFile.setEditorId(Integer.parseInt(accountId)); - fileService.save(partnerArticleFile); - } - } - - boolean updateState = service.updateById(partnerArticleManagement); - return updateState ? R.ok() : R.error("编辑失败"); - } - - - @PostMapping("/batchDeletion") - @ApiOperation(value = "批量删除", response = PartnerArticleManagement.class) - public R batchDeletion(@ApiParam(name = "id", value = "主键", required = true) @RequestParam List ids) { - - boolean delState = service.removeByIds(ids); - return delState ? R.ok() : R.error("删除失败"); - } - - @PostMapping("/articleEnableOrDisable") - @ApiOperation(value = "文章启用禁用", response = PartnerArticleManagement.class) - public R articleEnableOrDisable(@ApiParam(name = "id", value = "文章id", required = true) @RequestParam Integer id, @ApiParam(name = "isDisable", value = "是否禁用(0默认,0启用 1禁用)", required = true) @RequestParam Integer isDisable) { - UpdateWrapper updateWrapper = new UpdateWrapper(); - updateWrapper.set("is_disable", isDisable); - updateWrapper.eq("id", id); - boolean ret = service.update(new PartnerArticleManagement(), updateWrapper); - return ret ? R.ok() : R.error("禁用/启用失败"); - } - - - @PostMapping("/checkIfTheTitleIsRepeat") - @ApiOperation(value = "标题判重——只对已发布的判重(新增,编辑,点击发布时候都要调用判断))", response = PartnerArticleManagement.class) - public R checkIfTheTitleIsRepeat(@RequestBody @Valid ContentHeavyTitleReqVO content) { - return service.checkIfTheTitleIsRepeat(content) ? R.ok() : R.error("该标题已重复!"); - } - - - @PostMapping("/articleTopOperation") - @ApiOperation(value = "文章置顶/取消置顶", response = PartnerArticleManagement.class) - public R articleTopOperation(@ApiParam(name = "isTop", value = "是否置顶(默认为0 不置顶 1为置顶)", required = true) @RequestParam Integer isTop, @ApiParam(name = "articleId", value = "文章Id", required = true) @RequestParam Integer articleId) { - //是否置顶(默认为0 不置顶 1为置顶) - UpdateWrapper updateWrap = new UpdateWrapper<>(); - updateWrap.set("is_top", isTop); - if (isTop == 1) { - updateWrap.set("top_time", new Date());//置顶时间(置顶一次更新一次) - } else { - updateWrap.set("top_time", null); - } - updateWrap.eq("id", articleId); - boolean ret = service.update(new PartnerArticleManagement(), updateWrap); - return ret ? R.ok() : R.error("操作失败"); - - } - - - @PostMapping("/collectCourse") - @ApiOperation(value = "收藏课程", response = PartnerArticleManagement.class) - public R collectCourse(@ApiParam(name = "contentId", value = "文章id", required = true) @RequestParam Integer contentId, @ApiParam(name = "state", value = "操作状态(state = 1收藏,0取消收藏)", required = true) @RequestParam Integer state, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - QueryWrapper queryWrapper = new QueryWrapper(); - queryWrapper.eq("content_id", contentId); - queryWrapper.eq("account_id", accountId); - - PartnerArticleManagementCollect detail = articleManagementCollectService.getOne(queryWrapper); - switch (state) { - case 0://取消收藏 - if (detail != null) { - articleManagementCollectService.removeById(detail.getId()); - } - break; - - case 1://收藏 - if (detail != null) { - return R.ok("已经收藏过了!"); - } - PartnerArticleManagementCollect courseCollect = new PartnerArticleManagementCollect(); - courseCollect.setContentId(contentId); - courseCollect.setCollectionTime(new Date()); - courseCollect.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - courseCollect.setAccountId(Integer.valueOf(accountId)); - articleManagementCollectService.save(courseCollect); - break; - } - return R.ok(); - } - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/PartnerClassificationController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/PartnerClassificationController.java deleted file mode 100644 index f0e9717..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/PartnerClassificationController.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.huoran.nakadai.controller; - - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.common.response.R; -import com.huoran.nakadai.entity.PartnerClassification; -import com.huoran.nakadai.entity.req.PartnerClassificationAddReq; -import com.huoran.nakadai.service.PartnerClassificationService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; -import java.util.List; - -/** - *

- * 合伙人分类表 前端控制器 - *

- * - * @author chen - * @since 2022-05-18 - */ -@Api(tags = "合伙人分类管理") -@RestController -@RequestMapping("/nakadai/partnerClassification") -public class PartnerClassificationController { - - @Autowired - public PartnerClassificationService partnerClassificationService; - - /** - * 新增合伙人分类 - */ - @PostMapping("/save") - @ApiOperation(value = "新增合伙人分类") - public R save(@RequestBody @Valid PartnerClassificationAddReq PartnerClassificationAddReq) { - - //暂时无限制 -/* if (PartnerClassificationAddReq.getLevel() > 6) { - return R.error("暂不支持" + PartnerClassificationAddReq.getLevel() + "层级"); - }*/ - - PartnerClassification partnerClassification = new PartnerClassification(); - BeanUtils.copyProperties(PartnerClassificationAddReq, partnerClassification); - - boolean ok = partnerClassificationService.checkRepeat(partnerClassification); - if (ok) { - return R.error("同级下已存在相同的名称:" + PartnerClassificationAddReq.getPartnerClassificationName()); - } - boolean save = partnerClassificationService.save(partnerClassification); - return save ? R.ok().put("id", partnerClassification.getId()) : R.error(); - - } - - /** - * 编辑合伙人分类 - */ - @PostMapping("/update") - @ApiOperation(value = "编辑合伙人分类") - public R update(@RequestBody @Valid PartnerClassification partnerClassification) { - boolean ok = false; - PartnerClassification byId = partnerClassificationService.getById(partnerClassification.getId()); - //名字未修改,不用进行判重 - if (!byId.getPartnerClassificationName().equals(partnerClassification.getPartnerClassificationName())){ - //全部分类进行判重 - ok = partnerClassificationService.checkRepeatAll(partnerClassification); - } - if (ok) { - return R.error("已存在相同的名称:" + partnerClassification.getPartnerClassificationName()); - } else { - boolean update = partnerClassificationService.updateById(partnerClassification); - if (partnerClassification.getIsTeam()==1){ - //更新团员所属团队名称 - List partnerClassifications = partnerClassificationService.list(new QueryWrapper(). - eq("parent_id", partnerClassification.getId())); - partnerClassifications.forEach(partnerClassification1 -> { - partnerClassification1.setPartnerClassificationName(partnerClassification.getPartnerClassificationName()); - partnerClassificationService.updateById(partnerClassification1); - }); - } - return update ? R.ok() : R.error(); - } - } - - /** - * 删除合伙人分类 - */ - @PostMapping("/delete") - @ApiOperation(value = "删除合伙人分类") - public R delete(@ApiParam(name = "id", value = "分类id", required = true) @RequestParam Integer id) { - //级联删除子分类 - boolean remove = partnerClassificationService.removeClassification(id); - return remove ? R.ok() : R.error(); - } - - /** - * 合伙人分类树形列表 - */ - @PostMapping("/treeList") - @ApiOperation(value = "合伙人分类树形列表", response = PartnerClassification.class) - public R treeList(@ApiParam(name = "applet", value = "小程序标识", required = false) - @RequestParam(required = false) Integer applet) { - List list = partnerClassificationService.treeList(applet); - return R.ok().put("treeList", list); - } - - @GetMapping("/getAllTeam") - @ApiOperation(value = "查询所有团队") - public R getAllTeam() { - List team = partnerClassificationService.list(new QueryWrapper(). - eq("is_team", 1)); - return R.ok().put("team",team) ; - } -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/PartnerSchemeManagementController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/PartnerSchemeManagementController.java deleted file mode 100644 index cea53b5..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/PartnerSchemeManagementController.java +++ /dev/null @@ -1,138 +0,0 @@ -package com.huoran.nakadai.controller; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.nakadai.entity.PartnerSchemeManagement; -import com.huoran.nakadai.entity.PartnerSchemeManagementProductConfig; -import com.huoran.nakadai.entity.req.PagePartnerArticleManagementReq; -import com.huoran.nakadai.service.PartnerSchemeManagementProductConfigService; -import com.huoran.nakadai.service.PartnerSchemeManagementService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; - - -/** - * @描述:合伙人——方案管理控制类 - * @作者: Rong - * @日期: 2023-03-20 - */ -@RestController -@RequestMapping("/nakadai/partner/schemeManagement") -@Api(value = "合伙人——方案管理", tags = "R-合伙人——方案管理") -public class PartnerSchemeManagementController { - - @Autowired - public PartnerSchemeManagementService service; - @Autowired - public PartnerSchemeManagementProductConfigService productConfigService; - - @PostMapping("/schemeList") - @ApiOperation(value = "方案列表分页查询", response = PartnerSchemeManagement.class) - public R schemeList(@RequestBody PagePartnerArticleManagementReq partnerSchemeManagement) { - return service.schemeList(partnerSchemeManagement); - } - - - @PostMapping("/findById") - @ApiOperation(value = "查询详情", response = PartnerSchemeManagement.class) - public R findById(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { - PartnerSchemeManagement partnerSchemeManagement = service.getById(id); - //isRelease:是否发布(0:草稿 1:已发布) - Integer isRelease = partnerSchemeManagement.getIsRelease(); - List list = productConfigService.obtainProductsAccordingToTheScheme(id, isRelease); - if (list.size() > 0) { - partnerSchemeManagement.setProductList(list); - - } - return R.ok().put("data", partnerSchemeManagement); - } - - - @PostMapping("/save") - @ApiOperation(value = "新增", response = PartnerSchemeManagement.class) - public R save(@RequestBody @ApiParam(name = "合伙人——方案管理对象", value = "传入json格式", required = true) PartnerSchemeManagement partnerSchemeManagement, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - partnerSchemeManagement.setFounderId(Integer.parseInt(accountId)); - partnerSchemeManagement.setEditorId(Integer.parseInt(accountId)); - boolean addState = service.save(partnerSchemeManagement); - if (partnerSchemeManagement.getProductList().size() > 0) { - //新增到产品配置表 - for (PartnerSchemeManagementProductConfig productConfig : partnerSchemeManagement.getProductList()) { - productConfig.setSchemeId(partnerSchemeManagement.getId()); - productConfigService.save(productConfig); - } - - } - - - return addState ? R.ok() : R.error("新增失败"); - } - - - @PostMapping("/update") - @ApiOperation(value = "修改", response = PartnerSchemeManagement.class) - public R update(@RequestBody @ApiParam(name = "合伙人——方案管理对象", value = "传入json格式", required = true) PartnerSchemeManagement partnerSchemeManagement, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - partnerSchemeManagement.setEditorId(Integer.parseInt(accountId)); - - LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); - lambdaQueryWrapper.eq(PartnerSchemeManagementProductConfig::getSchemeId, partnerSchemeManagement.getId()); - productConfigService.remove(lambdaQueryWrapper); - - if (partnerSchemeManagement.getProductList().size() > 0) { - //新增到产品配置表 - for (PartnerSchemeManagementProductConfig productConfig : partnerSchemeManagement.getProductList()) { - productConfigService.save(productConfig); - } - - } - - boolean updateState = service.updateById(partnerSchemeManagement); - return updateState ? R.ok() : R.error("编辑失败"); - } - - - @PostMapping("/delete") - @ApiOperation(value = "删除", response = PartnerSchemeManagement.class) - public R delete(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { - boolean delState = service.removeById(id); - return delState ? R.ok() : R.error("删除失败"); - } - - @PostMapping("/batchDeletion") - @ApiOperation(value = "批量删除", response = PartnerSchemeManagement.class) - public R batchDeletion(@ApiParam(name = "id", value = "主键", required = true) @RequestParam List ids) { - boolean delState = service.removeByIds(ids); - return delState ? R.ok() : R.error("删除失败"); - } - - - @PostMapping("/enableOrDisable") - @ApiOperation(value = "启用禁用", response = PartnerSchemeManagement.class) - public R enableOrDisable(@ApiParam(name = "id", value = "id", required = true) @RequestParam Integer id, - @ApiParam(name = "isDisable", value = "是否禁用(0默认,0启用 1禁用)", required = true) @RequestParam Integer isDisable) { - UpdateWrapper updateWrapper = new UpdateWrapper(); - updateWrapper.set("is_disable", isDisable); - updateWrapper.eq("id", id); - boolean ret = service.update(new PartnerSchemeManagement(), updateWrapper); - return ret ? R.ok() : R.error("禁用/启用失败"); - } - - - /*@PostMapping("/modifiedArticleSort") - @ApiOperation(value = "修改文章排序", response = PartnerSchemeManagement.class) - public R modifiedSort(@RequestBody List reqList) { - return service.modifiedSort(reqList); - }*/ - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/PartnerSchemeManagementProductConfigController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/PartnerSchemeManagementProductConfigController.java deleted file mode 100644 index 64305ce..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/PartnerSchemeManagementProductConfigController.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.huoran.nakadai.controller; - - -import com.huoran.nakadai.entity.PartnerSchemeManagementProductConfig; -import com.huoran.nakadai.service.PartnerSchemeManagementProductConfigService; -import org.springframework.web.bind.annotation.RequestMapping; -import com.huoran.api.UserClient; -import com.huoran.common.utils.TokenUtils; -import io.swagger.annotations.*; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.huoran.common.response.R; -import org.springframework.beans.factory.annotation.Autowired; -import org.apache.commons.lang.StringUtils; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import org.springframework.web.bind.annotation.RequestParam; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; - -import java.util.List; -import javax.servlet.http.HttpServletRequest; - -import org.springframework.web.bind.annotation.RestController; - -/** - *

- * 合伙人——方案管理——产品配置表 前端控制器 - *

- * - * @author chen - * @since 2023-06-28 - */ - -/** - * @描述:合伙人——方案管理——产品配置表控制类 - * @作者: Rong - * @日期: 2023-06-28 - */ -@RestController -@RequestMapping("/partnerSchemeManagementProductConfig") -@Api(value = "合伙人——方案管理——产品配置表:PartnerSchemeManagementProductConfigController", tags = "R-合伙人——方案管理——产品配置表") -public class PartnerSchemeManagementProductConfigController { - - @Autowired - public PartnerSchemeManagementProductConfigService service; - - @Autowired - private UserClient userClient; - - - @PostMapping("/batchDeletion") - @ApiOperation(value = "批量删除", response = PartnerSchemeManagementProductConfig.class) - public R batchDeletion(@ApiParam(name = "id", value = "主键", required = true) @RequestBody List ids) { - boolean delState = service.removeByIds(ids); - return delState ? R.ok() : R.error("删除失败"); - } -} diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/PartnerTeamController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/PartnerTeamController.java deleted file mode 100644 index 87f6ae8..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/PartnerTeamController.java +++ /dev/null @@ -1,199 +0,0 @@ -package com.huoran.nakadai.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; -import com.huoran.api.UserClient; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.nakadai.entity.PartnerAccount; -import com.huoran.nakadai.entity.PartnerClassification; -import com.huoran.nakadai.entity.PartnerTeam; -import com.huoran.nakadai.entity.req.EditProvinceCityReq; -import com.huoran.nakadai.entity.req.PartnerTeamRateReq; -import com.huoran.nakadai.entity.vo.CheckVo; -import com.huoran.nakadai.service.PartnerAccountService; -import com.huoran.nakadai.service.PartnerClassificationService; -import com.huoran.nakadai.service.PartnerTeamService; -import com.huoran.nakadai.service.impl.PartnerAccountServiceImpl; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; -import java.util.List; - -/** - *

- * 合伙人团队表(合伙人账号与分类中间表) 前端控制器 - *

- * - * @author chen - * @since 2022-05-18 - */ -@Api(tags = "团队管理") -@RestController -@RequestMapping("/nakadai/partner-team") -public class PartnerTeamController { - - @Autowired - public PartnerTeamService partnerTeamService; - - @Autowired - public PartnerAccountService accountService; - - @Autowired - public PartnerAccountServiceImpl accountServiceImpl; - - @Autowired - public PartnerClassificationService classificationService; - - @Autowired - private UserClient userClient; - - /*@ApiOperation(value = "团队成员列表") - @GetMapping(value = "/teamList") - public R teamList( - @ApiParam(name = "id", value = "团队id", required = true) - @RequestParam String id, - @ApiParam(name = "current", value = "当前页码", required = true) - @RequestParam int current, - @ApiParam(name = "pageSize", value = "每页记录数", required = true) - @RequestParam int pageSize, - @ApiParam(name = "name", value = "成员名称", required = false) - @RequestParam(value = "name") String name){ - List teamList = partnerTeamService.selectTeamList(id,current,pageSize,name); - return R.ok().put("teamList",teamList); - }*/ - - @ApiOperation(value = "我的") - @GetMapping(value = "/my") - public R my( - @ApiParam(name = "partnerId", value = "商务经理id", required = false) - @RequestParam(required = false) String partnerId, - @ApiParam(name = "teamId", value = "团队id", required = false) - @RequestParam(required = false) String teamId, HttpServletRequest request){ - int platformId = 3; - if (StringUtils.isNotEmpty(partnerId)||StringUtils.isNotEmpty(teamId)){ - platformId = 4; - } - String id = TokenUtils.getIdByJwtToken(request); - String phone = partnerTeamService.getPhone(id,platformId); - - return partnerTeamService.queryUserInfoByPhone(phone,partnerId,teamId); - } - - @ApiOperation(value = "查询手机号用户") - @GetMapping(value = "/queryUserInfoByPhone") - public R queryUserInfoByPhone( - @ApiParam(name = "phone", value = "手机号", required = true) - @RequestParam String phone ){ - return partnerTeamService.queryPhone(phone); - } - - @ApiOperation(value = "更新邮箱") - @PostMapping("/updateMyEmail") - public R updateMyEmail(@RequestBody CheckVo checkVo, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - checkVo.setAccountId(accountId); - return partnerTeamService.updateMyEmail(checkVo); - } - - @ApiOperation(value = "邮箱验证码发送") - @PostMapping("/mailCodeSend") - public R mailCodeSend(@RequestBody CheckVo checkVo, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - checkVo.setAccountId(accountId); - boolean send = partnerTeamService.mailCodeSend(checkVo); - return send ? R.ok() : R.error(); - } - - @ApiOperation(value = "编辑合伙人信息") - @PostMapping("/editProvinceCity") - public R editProvinceCity(@RequestBody @Valid EditProvinceCityReq provinceCityReq) { - if (provinceCityReq.getUserName()!=null){ - boolean res = partnerTeamService.checkName(provinceCityReq); - if (res){ - return R.error("合伙人姓名已存在!"); - } - //修改用户姓名 - partnerTeamService.editUsername(provinceCityReq); - } - //更新角色 - if (provinceCityReq.getRoleList() != null) { - //团队成员不能赋予超管角色 - if (provinceCityReq.getIsTeam()!=null && provinceCityReq.getIsTeam()!=1){ - for (Integer integer : provinceCityReq.getRoleList()) { - //测试|正式 - if (integer==172||integer==123){ - return R.error("团体成员无法设置超管角色!"); - } - } - } - - // 负责人角色从未认证改为超管后,成员未认证修改 - if (provinceCityReq.getRoleName()!=null && provinceCityReq.getRoleName().contains("未认证")){ - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("parent_id",provinceCityReq.getClassificationId()); - queryWrapper.eq("is_team",0); - List list = classificationService.list(queryWrapper); - for (PartnerClassification partnerClassification : list) { - QueryWrapper teamQueryWrapper = new QueryWrapper<>(); - teamQueryWrapper.eq("classification_id",partnerClassification.getId()); - PartnerTeam one = partnerTeamService.getOne(teamQueryWrapper); - PartnerAccount partnerAccount = accountService.getById(one.getPartnerId()); - - //删除该账号在所在团队的角色 - partnerTeamService.delRoleByAccountIdAndTeamId(partnerAccount.getAccountId(),partnerClassification.getId()); - //账号赋予团队成员角色 - accountServiceImpl.assignTeamMemberRoles(partnerAccount.getAccountId(),0,partnerClassification.getId()); - } - } - //删除该账号在所在团队的角色 - partnerTeamService.delRoleByAccountIdAndTeamId(provinceCityReq.getAccountId(),provinceCityReq.getClassificationId()); - //账号赋予所在团队角色 - userClient.rolePermissionService(provinceCityReq.getAccountId(), provinceCityReq.getRoleList(),provinceCityReq.getClassificationId()); - } - if (provinceCityReq.getProvinceId()!=null||provinceCityReq.getCityId()!=null){ - //更新省份城市 - UpdateWrapper updateWrapper = new UpdateWrapper<>(); - updateWrapper.set("province_id",provinceCityReq.getProvinceId()); - updateWrapper.set("city_id",provinceCityReq.getCityId()); - updateWrapper.eq("classification_id",provinceCityReq.getClassificationId()); - updateWrapper.eq("partner_id",provinceCityReq.getPartnerId()); - partnerTeamService.update(new PartnerTeam(), updateWrapper); - } - return R.ok(); - } - - @ApiOperation(value = "编辑合伙人团队费率") - @PostMapping("/editPartnerTeamRates") - public R editPartnerTeamRates(@RequestBody @Valid PartnerTeamRateReq teamRateReq) { - //更新费率 - UpdateWrapper updateWrapper = new UpdateWrapper<>(); -/* if (teamRateReq.getAnnualTeamFee()!=null){ - }*/ - updateWrapper.set("annual_team_fee",teamRateReq.getAnnualTeamFee()); - updateWrapper.set("annual_marketing_fee",teamRateReq.getAnnualMarketingFee()); -// if (teamRateReq.getAnnualMarketingFee()!=null){ -// } - updateWrapper.eq("classification_id",teamRateReq.getTeamId()); - updateWrapper.eq("partner_id",teamRateReq.getPartnerId()); - boolean update = partnerTeamService.update(new PartnerTeam(), updateWrapper); - return update ? R.ok() : R.error(); - } - - @ApiOperation(value = "查询合伙人团队费率") - @PostMapping("/getPartnerTeamRates") - public R getPartnerTeamRates(@RequestBody @Valid PartnerTeamRateReq teamRateReq) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("classification_id",teamRateReq.getTeamId()); - PartnerTeam one = partnerTeamService.getOne(queryWrapper); - return R.ok().put("teamRates",one); - } - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/PickAddrController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/PickAddrController.java new file mode 100644 index 0000000..3f4fb1b --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/controller/PickAddrController.java @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.controller; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.huoran.common.exception.YamiShopBindException; +import com.huoran.common.response.ResponseEnum; +import com.huoran.common.response.ServerResponseEntity; +import com.huoran.common.utils.TokenUtils; +import com.huoran.nakadai.entity.model.PickAddr; + +import com.huoran.nakadai.service.PickAddrService; +import com.huoran.nakadai.utils.PageParam; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import javax.validation.Valid; +import java.util.Arrays; +import java.util.Objects; + + +@RestController +@RequestMapping("/shop/pickAddr") +public class PickAddrController { + + @Autowired + private PickAddrService pickAddrService; + + /** + * 分页获取 + */ + @GetMapping("/page") + public ServerResponseEntity> page(PickAddr pickAddr, PageParam page){ + IPage pickAddrs = pickAddrService.page(page,new LambdaQueryWrapper() + .like(StrUtil.isNotBlank(pickAddr.getAddrName()),PickAddr::getAddrName,pickAddr.getAddrName()) + .orderByDesc(PickAddr::getAddrId)); + return ServerResponseEntity.success(pickAddrs); + } + + /** + * 获取信息 + */ + @GetMapping("/info/{id}") + public ServerResponseEntity info(@PathVariable("id") Long id){ + PickAddr pickAddr = pickAddrService.getById(id); + return ServerResponseEntity.success(pickAddr); + } + + /** + * 保存 + */ + @PostMapping + public ServerResponseEntity save(@Valid @RequestBody PickAddr pickAddr,HttpServletRequest request){ + pickAddr.setShopId(TokenUtils.getShopIdByJwtToken(request)); + pickAddrService.save(pickAddr); + return ServerResponseEntity.success(); + } + + /** + * 修改 + */ + @PutMapping + public ServerResponseEntity update(@Valid @RequestBody PickAddr pickAddr, HttpServletRequest request){ + PickAddr dbPickAddr = pickAddrService.getById(pickAddr.getAddrId()); + + if (!Objects.equals(dbPickAddr.getShopId(), TokenUtils.getShopIdByJwtToken(request))) { + throw new YamiShopBindException(ResponseEnum.UNAUTHORIZED); + } + pickAddrService.updateById(pickAddr); + return ServerResponseEntity.success(); + } + + /** + * 删除 + */ + @DeleteMapping + public ServerResponseEntity delete(@RequestBody Long[] ids){ + pickAddrService.removeByIds(Arrays.asList(ids)); + return ServerResponseEntity.success(); + } +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamAccountController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamAccountController.java index 10707a7..681daf6 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamAccountController.java +++ b/nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamAccountController.java @@ -190,7 +190,7 @@ public class PlatformTeamAccountController { @ApiOperation(value = "获取当前平台用户的团队信息", response = PartnerAccountResp.class) @GetMapping("/getTeamsByPlatformId") public R getTeamsByPlatformId(@ApiParam(name = "platformId", value = "平台id") @RequestParam Integer platformId, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); + String accountId = platformTeamAccountService.getCurrentPlatformAccount(TokenUtils.getIdByJwtToken(request), platformId); return platformTeamAccountService.getTeamsByPlatformId(accountId, platformId); } diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/ProdCommController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/ProdCommController.java new file mode 100644 index 0000000..8927e71 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/controller/ProdCommController.java @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.huoran.common.response.ServerResponseEntity; +import com.huoran.nakadai.entity.model.ProdComm; +import com.huoran.nakadai.service.ProdCommService; +import com.huoran.nakadai.utils.PageParam; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.Date; + +/** + * 商品评论 + * + * @author xwc + * @date 2019-04-19 10:43:57 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/prod/prodComm" ) +public class ProdCommController { + + private final ProdCommService prodCommService; + + /** + * 分页查询 + * @param page 分页对象 + * @param prodComm 商品评论 + * @return 分页数据 + */ + @GetMapping("/page" ) + public ServerResponseEntity> getProdCommPage(PageParam page, ProdComm prodComm) { + return ServerResponseEntity.success(prodCommService.getProdCommPage(page,prodComm)); + } + + + /** + * 通过id查询商品评论 + * @param prodCommId id + * @return 单个数据 + */ + @GetMapping("/info/{prodCommId}" ) + public ServerResponseEntity getById(@PathVariable("prodCommId" ) Long prodCommId) { + return ServerResponseEntity.success(prodCommService.getById(prodCommId)); + } + + /** + * 新增商品评论 + * @param prodComm 商品评论 + * @return 是否新增成功 + */ + @PostMapping + public ServerResponseEntity save(@RequestBody @Valid ProdComm prodComm) { + return ServerResponseEntity.success(prodCommService.save(prodComm)); + } + + /** + * 修改商品评论 + * @param prodComm 商品评论 + * @return 是否修改成功 + */ + @PutMapping + public ServerResponseEntity updateById(@RequestBody @Valid ProdComm prodComm) { + prodComm.setReplyTime(new Date()); + return ServerResponseEntity.success(prodCommService.updateById(prodComm)); + } + + /** + * 通过id删除商品评论 + * @param prodCommId id + * @return 是否删除成功 + */ + @DeleteMapping("/{prodCommId}" ) + public ServerResponseEntity removeById(@PathVariable Long prodCommId) { + return ServerResponseEntity.success(prodCommService.removeById(prodCommId)); + } + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/ProdTagController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/ProdTagController.java new file mode 100644 index 0000000..76f932b --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/controller/ProdTagController.java @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.controller; + + +import cn.hutool.core.collection.CollectionUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.huoran.common.exception.YamiShopBindException; +import com.huoran.common.response.ServerResponseEntity; +import com.huoran.common.utils.TokenUtils; +import com.huoran.nakadai.entity.model.ProdTag; +import com.huoran.nakadai.service.ProdTagService; +import com.huoran.nakadai.utils.PageParam; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import javax.validation.Valid; +import java.util.Date; +import java.util.List; + +/** + * 商品分组 + * + * @author hzm + * @date 2019-04-18 09:08:36 + */ +@RestController +@RequestMapping("/prod/prodTag") +public class ProdTagController { + + @Autowired + private ProdTagService prodTagService; + + /** + * 分页查询 + * + * @param page 分页对象 + * @param prodTag 商品分组标签 + * @return 分页数据 + */ + @GetMapping("/page") + public ServerResponseEntity> getProdTagPage(PageParam page, ProdTag prodTag) { + IPage tagPage = prodTagService.page( + page, new LambdaQueryWrapper() + .eq(prodTag.getStatus() != null, ProdTag::getStatus, prodTag.getStatus()) + .like(prodTag.getTitle() != null, ProdTag::getTitle, prodTag.getTitle()) + .orderByDesc(ProdTag::getSeq, ProdTag::getCreateTime)); + return ServerResponseEntity.success(tagPage); + + } + + + /** + * 通过id查询商品分组标签 + * + * @param id id + * @return 单个数据 + */ + @GetMapping("/info/{id}") + public ServerResponseEntity getById(@PathVariable("id") Long id) { + return ServerResponseEntity.success(prodTagService.getById(id)); + } + + /** + * 新增商品分组标签 + * + * @param prodTag 商品分组标签 + * @return 是否新增成功 + */ + @PostMapping + public ServerResponseEntity save(@RequestBody @Valid ProdTag prodTag, HttpServletRequest request) { + // 查看是否相同的标签 + List list = prodTagService.list(new LambdaQueryWrapper().like(ProdTag::getTitle, prodTag.getTitle())); + if (CollectionUtil.isNotEmpty(list)) { + throw new YamiShopBindException("标签名称已存在,不能添加相同的标签"); + } + prodTag.setIsDefault(0); + prodTag.setProdCount(0L); + prodTag.setCreateTime(new Date()); + prodTag.setUpdateTime(new Date()); + prodTag.setShopId(TokenUtils.getShopIdByJwtToken(request)); + prodTagService.removeProdTag(); + return ServerResponseEntity.success(prodTagService.save(prodTag)); + } + + /** + * 修改商品分组标签 + * + * @param prodTag 商品分组标签 + * @return 是否修改成功 + */ + @PutMapping + public ServerResponseEntity updateById(@RequestBody @Valid ProdTag prodTag) { + prodTag.setUpdateTime(new Date()); + prodTagService.removeProdTag(); + return ServerResponseEntity.success(prodTagService.updateById(prodTag)); + } + + /** + * 通过id删除商品分组标签 + * + * @param id id + * @return 是否删除成功 + */ + @DeleteMapping("/{id}") + public ServerResponseEntity removeById(@PathVariable Long id) { + ProdTag prodTag = prodTagService.getById(id); + if (prodTag.getIsDefault() != 0) { + throw new YamiShopBindException("默认标签不能删除"); + } + prodTagService.removeProdTag(); + return ServerResponseEntity.success(prodTagService.removeById(id)); + } + + @GetMapping("/listTagList") + public ServerResponseEntity> listTagList() { + return ServerResponseEntity.success(prodTagService.listProdTag()); + + } + + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/ProdTagReferenceController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/ProdTagReferenceController.java new file mode 100644 index 0000000..eeb6ab2 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/controller/ProdTagReferenceController.java @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.controller; + + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.huoran.common.response.ServerResponseEntity; +import com.huoran.nakadai.entity.model.ProdTagReference; +import com.huoran.nakadai.service.ProdTagReferenceService; +import com.huoran.nakadai.utils.PageParam; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + +/** + * 分组标签引用 + * + * @author hzm + * @date 2019-04-18 16:28:01 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/generator/prodTagReference" ) +public class ProdTagReferenceController { + + private final ProdTagReferenceService prodTagReferenceService; + + /** + * 分页查询 + * @param page 分页对象 + * @param prodTagReference 分组标签引用 + * @return 分页数据 + */ + @GetMapping("/page" ) + public ServerResponseEntity> getProdTagReferencePage(PageParam page, ProdTagReference prodTagReference) { + return ServerResponseEntity.success(prodTagReferenceService.page(page, new LambdaQueryWrapper())); + } + + + /** + * 通过id查询分组标签引用 + * @param referenceId id + * @return 单个数据 + */ + @GetMapping("/info/{referenceId}" ) + public ServerResponseEntity getById(@PathVariable("referenceId" ) Long referenceId) { + return ServerResponseEntity.success(prodTagReferenceService.getById(referenceId)); + } + + /** + * 新增分组标签引用 + * @param prodTagReference 分组标签引用 + * @return 是否新增成功 + */ + @PostMapping + public ServerResponseEntity save(@RequestBody @Valid ProdTagReference prodTagReference) { + return ServerResponseEntity.success(prodTagReferenceService.save(prodTagReference)); + } + + /** + * 修改分组标签引用 + * @param prodTagReference 分组标签引用 + * @return 是否修改成功 + */ + @PutMapping + public ServerResponseEntity updateById(@RequestBody @Valid ProdTagReference prodTagReference) { + return ServerResponseEntity.success(prodTagReferenceService.updateById(prodTagReference)); + } + + /** + * 通过id删除分组标签引用 + * @param referenceId id + * @return 是否删除成功 + */ + @DeleteMapping("/{referenceId}" ) + public ServerResponseEntity removeById(@PathVariable Long referenceId) { + return ServerResponseEntity.success(prodTagReferenceService.removeById(referenceId)); + } + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/ProductClassificationController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/ProductClassificationController.java deleted file mode 100644 index 9e4ad41..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/ProductClassificationController.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.huoran.nakadai.controller; - - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.common.response.R; -import com.huoran.nakadai.entity.ProductClassification; -import com.huoran.nakadai.service.ProductClassificationService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -/** - *

- * 产品分类表 前端控制器 - *

- * - * @author chen - * @since 2023-04-25 - */ -@Api(value = "M-商品产品分类管理", tags = "M-商品产品分类管理") -@RestController -@RequestMapping("/productClassification") -public class ProductClassificationController { - - @Autowired - private ProductClassificationService classificationService; - - @ApiOperation(value = "添加产品分类") - @PostMapping("/addProductCategory") - public R addProductCategory( - @ApiParam(name = "classificationName", value = "分类名称", required = true) - @RequestParam String classificationName) { - //名称判重 - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("classification_name",classificationName); - ProductClassification one = classificationService.getOne(queryWrapper); - if (ObjectUtil.isNotNull(one)){ - return R.error("产品分类已存在!"); - } - //新增产品分类 - ProductClassification classification = new ProductClassification(); - classification.setClassificationName(classificationName); - boolean save = classificationService.save(classification); - return save ? R.ok() : R.error(); - } - - @ApiOperation(value = "产品分类列表") - @GetMapping("/productCategoryList") - public R productCategoryList( - @ApiParam(name = "search", value = "查询条件",required = false) - @RequestParam(required = false) String search) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - if (search!=null){ - queryWrapper.like("classification_name",search); - } - List classificationList = classificationService.list(queryWrapper); - return R.ok().put("classificationList",classificationList); - } - - @ApiOperation(value = "删除产品分类") - @PostMapping("/deleteProductCategory") - public R deleteProductCategory( - @ApiParam(name = "categoryId", value = "分类id", required = true) - @RequestParam Integer categoryId) { - boolean remove = classificationService.removeById(categoryId); - return remove ? R.ok() : R.error(); - } - - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/ProductController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/ProductController.java new file mode 100644 index 0000000..5454ffb --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/controller/ProductController.java @@ -0,0 +1,223 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.controller; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.huoran.common.exception.YamiShopBindException; +import com.huoran.common.response.ServerResponseEntity; +import com.huoran.common.utils.TokenUtils; +import com.huoran.nakadai.entity.model.Product; +import com.huoran.nakadai.entity.model.Sku; +import com.huoran.nakadai.entity.param.ProductParam; +import com.huoran.nakadai.entity.res.PlatformTeamAccountResp; +import com.huoran.nakadai.service.BasketService; +import com.huoran.nakadai.service.ProdTagReferenceService; +import com.huoran.nakadai.service.ProductService; +import com.huoran.nakadai.service.SkuService; +import com.huoran.nakadai.utils.Json; +import com.huoran.nakadai.utils.PageParam; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import javax.validation.Valid; +import java.util.Date; +import java.util.List; +import java.util.Objects; + + +@Api(tags = "商品列表、商品发布管理") +@RestController +@RequestMapping("/prod") +public class ProductController { + + @Autowired + private ProductService productService; + + @Autowired + private SkuService skuService; + + @Autowired + private ProdTagReferenceService prodTagReferenceService; + + @Autowired + private BasketService basketService; + + @GetMapping("/page") + @ApiOperation(value = "分页获取商品信息", response = Product.class) + public ServerResponseEntity> page(ProductParam product,HttpServletRequest request) { + PageParam page = new PageParam<>(); + IPage products = productService.page(page, + new LambdaQueryWrapper() + .like(StrUtil.isNotBlank(product.getProdName()), Product::getProdName, product.getProdName()) + .eq(Product::getShopId, TokenUtils.getShopIdByJwtToken(request)) + .eq(product.getStatus() != null, Product::getStatus, product.getStatus()) + .orderByDesc(Product::getPutawayTime)); + return ServerResponseEntity.success(products); + } + + + @GetMapping("/info") + @ApiOperation(value = "获取商品信息", response = Product.class) + public ServerResponseEntity info(@RequestParam("prodId") Integer prodId, HttpServletRequest request) { + Product prod = productService.getProductByProdId(prodId); + if (!Objects.equals(prod.getShopId(), TokenUtils.getShopIdByJwtToken(request))) { + throw new YamiShopBindException("没有权限获取该商品规格信息"); + } + List skuList = skuService.listByProdId(prodId); + prod.setSkuList(skuList); + + //获取分组标签 +// List listTagId = prodTagReferenceService.listTagIdByProdId(prodId); +// prod.setTagList(listTagId); + return ServerResponseEntity.success(prod); + } + + @PostMapping("/save") + @ApiOperation(value = "保存商品信息") + public ServerResponseEntity save(@Valid @RequestBody ProductParam productParam,HttpServletRequest request) { + checkParam(productParam); + + Product product = BeanUtil.copyProperties(productParam, Product.class); +// product.setDeliveryMode(Json.toJsonString(productParam.getDeliveryModeVo())); + product.setShopId(TokenUtils.getShopIdByJwtToken(request)); + product.setUpdateTime(new Date()); + if (product.getStatus() == 0) { + product.setPutawayTime(new Date()); + } + product.setCreateTime(new Date()); + productService.saveProduct(product); + return ServerResponseEntity.success(); + } + + + @PostMapping("/update") + @ApiOperation(value = "修改商品信息") + public ServerResponseEntity update(@Valid @RequestBody ProductParam productParam,HttpServletRequest request) { + checkParam(productParam); + Product dbProduct = productService.getProductByProdId(productParam.getProdId()); + if (!Objects.equals(dbProduct.getShopId(), TokenUtils.getShopIdByJwtToken(request))) { + return ServerResponseEntity.showFailMsg("无法修改非本店铺商品信息"); + } + + List dbSkus = skuService.listByProdId(dbProduct.getProdId()); + + Product product = BeanUtil.copyProperties(productParam, Product.class); +// product.setDeliveryMode(Json.toJsonString(productParam.getDeliveryModeVo())); + product.setUpdateTime(new Date()); + + if (productParam.getStatus() == 1) { + product.setPutawayTime(new Date()); + } + dbProduct.setSkuList(dbSkus); + productService.updateProduct(product, dbProduct); + + +// List userIds = basketService.listUserIdByProdId(product.getProdId()); +// +// for (String userId : userIds) { +// basketService.removeShopCartItemsCacheByUserId(userId); +// } + for (Sku sku : dbSkus) { + skuService.removeSkuCacheBySkuId(sku.getSkuId(), sku.getProdId()); + } + return ServerResponseEntity.success(); + } + + /** + * 删除 + */ + public ServerResponseEntity delete(Integer prodId,HttpServletRequest request) { + Product dbProduct = productService.getProductByProdId(prodId); + if (!Objects.equals(dbProduct.getShopId(), TokenUtils.getShopIdByJwtToken(request))) { + throw new YamiShopBindException("无法获取非本店铺商品信息"); + } + List dbSkus = skuService.listByProdId(dbProduct.getProdId()); + // 删除商品 + productService.removeProductByProdId(prodId); + + for (Sku sku : dbSkus) { + skuService.removeSkuCacheBySkuId(sku.getSkuId(), sku.getProdId()); + } + + +// List userIds = basketService.listUserIdByProdId(prodId); +// +// for (String userId : userIds) { +// basketService.removeShopCartItemsCacheByUserId(userId); +// } + + return ServerResponseEntity.success(); + } + + @PostMapping("/batchDelete") + @ApiOperation(value = "批量删除商品信息") + public ServerResponseEntity batchDelete(@RequestBody Integer[] prodIds,HttpServletRequest request) { + for (Integer prodId : prodIds) { + delete(prodId,request); + } + return ServerResponseEntity.success(); + } + + + @PostMapping("/prodStatus") + @ApiOperation(value = "更新商品状态") + public ServerResponseEntity shopStatus( + @ApiParam(value = "商品id") + @RequestParam Integer prodId, + @ApiParam(value = "prodStatus:默认是1,表示上架, 2下架,3草稿,4审核,0为删除") + @RequestParam Integer prodStatus) { + Product product = new Product(); + product.setProdId(prodId); + product.setStatus(prodStatus); + if (prodStatus == 1) { + product.setPutawayTime(new Date()); + } + productService.updateById(product); + productService.removeProductCacheByProdId(prodId); +// List userIds = basketService.listUserIdByProdId(prodId); +// +// for (String userId : userIds) { +// basketService.removeShopCartItemsCacheByUserId(userId); +// } + return ServerResponseEntity.success(); + } + + private void checkParam(ProductParam productParam) { +// if (CollectionUtil.isEmpty(productParam.getTagList())) { +// throw new YamiShopBindException("请选择产品分组"); +// } + +// Product.DeliveryModeVO deliveryMode = productParam.getDeliveryModeVo(); +// boolean hasDeliverMode = deliveryMode != null +// && (deliveryMode.getHasShopDelivery() || deliveryMode.getHasUserPickUp()); +// if (!hasDeliverMode) { +// throw new YamiShopBindException("请选择配送方式"); +// } + List skuList = productParam.getSkuList(); + boolean isAllUnUse = true; + for (Sku sku : skuList) { + if (sku.getStatus() == 1) { + isAllUnUse = false; + } + } + if (isAllUnUse) { + throw new YamiShopBindException("至少要启用一种商品规格"); + } + } +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/ProductThemeController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/ProductThemeController.java deleted file mode 100644 index 6ef40a0..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/ProductThemeController.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.huoran.nakadai.controller; - -import com.huoran.api.UserClient; -import com.huoran.common.utils.TokenUtils; -import io.swagger.annotations.*; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.huoran.common.response.R; -import org.springframework.beans.factory.annotation.Autowired; -import org.apache.commons.lang.StringUtils; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import org.springframework.web.bind.annotation.RequestParam; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import com.huoran.nakadai.service.ProductThemeService; -import com.huoran.nakadai.entity.ProductTheme; -import org.apache.commons.io.FileUtils; -import org.apache.commons.io.IOUtils; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.net.HttpURLConnection; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.List; -import javax.servlet.http.HttpServletRequest; - -/** - * @描述:控制类 - * @作者: Rong - * @日期: 2023-08-22 - */ -@RestController -@RequestMapping("/productTheme") -@Api(value = "产品主题:ProductThemeController", tags = "R-产品主题") -public class ProductThemeController { - - @Autowired - public ProductThemeService service; - - @PostMapping("/allSubjects") - @ApiOperation(value = "全部主题", response = ProductTheme.class) - public R allSubjects() { - List list = service.list(null); - return R.ok().put("data", list); - } - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/ProductTypeController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/ProductTypeController.java deleted file mode 100644 index ae5d490..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/ProductTypeController.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.huoran.nakadai.controller; - - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.common.response.R; -import com.huoran.nakadai.entity.ProductType; -import com.huoran.nakadai.service.ProductTypeService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -/** - *

- * 产品类型表 前端控制器 - *

- * - * @author chen - * @since 2023-04-25 - */ -@Api(value = "M-商品产品类型管理", tags = "M-商品产品类型管理") -@RestController -@RequestMapping("/productType") -public class ProductTypeController { - - @Autowired - private ProductTypeService typeService; - - @ApiOperation(value = "添加产品类型") - @PostMapping("/addProductType") - public R addProductType( - @ApiParam(name = "typeName", value = "类型名称", required = true) - @RequestParam String typeName) { - //名称判重 - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("type_name",typeName); - ProductType one = typeService.getOne(queryWrapper); - if (ObjectUtil.isNotNull(one)){ - return R.error("产品类型已存在!"); - } - //新增产品分类 - ProductType type = new ProductType(); - type.setTypeName(typeName); - boolean save = typeService.save(type); - return save ? R.ok() : R.error(); - } - - @ApiOperation(value = "更新产品类型") - @PostMapping("/updateProductType") - public R updateProductType( - @ApiParam(name = "type", value = "类型", required = true) - @RequestBody ProductType type) { - //名称判重 - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("type_name",type.getTypeName()).notInSql("type_id",type.getTypeId().toString()); - ProductType one = typeService.getOne(queryWrapper); - if (ObjectUtil.isNotNull(one)){ - return R.error("产品类型已存在!"); - } - boolean save = typeService.updateById(type); - return save ? R.ok() : R.error(); - } - - @ApiOperation(value = "产品类型列表") - @GetMapping("/productTypeList") - public R productTypeList( - @ApiParam(name = "search", value = "查询条件",required = false) - @RequestParam(required = false) String search) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - if (search!=null){ - queryWrapper.like("type_name",search); - } - List typeList = typeService.list(queryWrapper); - return R.ok().put("typeList",typeList); - } - - @ApiOperation(value = "删除产品类型") - @PostMapping("/deleteProductType") - public R deleteProductType( - @ApiParam(name = "typeId", value = "类型id", required = true) - @RequestParam Integer typeId) { - boolean remove = typeService.removeById(typeId); - return remove ? R.ok() : R.error(); - } - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/ProfessionalClassController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/ProfessionalClassController.java deleted file mode 100644 index 424d29d..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/ProfessionalClassController.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.huoran.nakadai.controller; - - -import com.huoran.common.response.R; -import com.huoran.nakadai.entity.ProfessionalClass; -import com.huoran.nakadai.entity.res.CustomerDetailRes; -import com.huoran.nakadai.service.IProfessionalClassService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -/** - *

- * 前端控制器 - *

- * - * @author huoran - * @since 2021-07-09 - */ -@Api(value = "专业类管理", tags = "专业类管理") -@RestController -@RequestMapping("/nakadai/professionalClass") -public class ProfessionalClassController { - - @Autowired - private IProfessionalClassService iProfessionalClassService; - - /** - * 查询专业类 - * @param disciplineIds - * @return - */ - @ApiOperation(value = "查询专业类",notes = "查询专业类",response = ProfessionalClass.class) - @PostMapping("/queryProfessionalClass") - public R queryProfessionalClass(@RequestBody List disciplineIds) { - List result = iProfessionalClassService.queryProfessionalClass(disciplineIds); - return R.ok().put("result",result); - } -} diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/ProfessionalController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/ProfessionalController.java deleted file mode 100644 index 6eec4e3..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/ProfessionalController.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.huoran.nakadai.controller; - - -import com.huoran.common.response.R; -import com.huoran.nakadai.entity.Professional; -import com.huoran.nakadai.entity.ProfessionalClass; -import com.huoran.nakadai.service.IProfessionalService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import org.springframework.stereotype.Controller; - -import java.util.List; - -/** - *

- * 专业 前端控制器 - *

- * - * @author huoran - * @since 2021-07-09 - */ -@Api(value = "专业管理", tags = "专业管理") -@RestController -@RequestMapping("/nakadai/professional") -public class ProfessionalController { - - @Autowired - private IProfessionalService iProfessionalService; - - @ApiOperation(value = "查询专业",notes = "查询专业",response = Professional.class) - @GetMapping("/queryProfessional") - public R queryProfessional(@RequestParam Integer professionalClassId) { - List result = iProfessionalService.queryProfessional(professionalClassId); - return R.ok().put("result",result); - } -} diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/ProgramShoppingCartController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/ProgramShoppingCartController.java deleted file mode 100644 index 8b0123c..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/ProgramShoppingCartController.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.huoran.nakadai.controller; - -import com.huoran.api.UserClient; -import com.huoran.common.utils.TokenUtils; -import com.huoran.nakadai.entity.ProgramShoppingCart; -import com.huoran.nakadai.entity.req.ProgramShoppingCartReq; -import com.huoran.nakadai.service.ProgramShoppingCartService; -import io.swagger.annotations.*; -import com.huoran.common.response.R; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import org.springframework.web.bind.annotation.RequestParam; -import io.swagger.annotations.ApiOperation; - -import java.util.List; -import javax.servlet.http.HttpServletRequest; - -/** - * @描述:小程序—购物车控制类 - * @作者: Rong - * @日期: 2023-06-09 - */ -@RestController -@RequestMapping("/mini/program/shopping/cart") -@Api(value = "小程序—购物车:ProgramShoppingCartController", tags = "R-小程序—购物车") -public class ProgramShoppingCartController { - - @Autowired - public ProgramShoppingCartService service; - - @Autowired - private UserClient userClient; - - @PostMapping("/shoppingCartList") - @ApiOperation(value = "购物车列表", response = ProgramShoppingCart.class) - public R shoppingCartList(@RequestBody ProgramShoppingCartReq req, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - req.setAccountId(Integer.valueOf(accountId)); - return service.shoppingCartList(req); - } - - - @PostMapping("/addToShoppingCart") - @ApiOperation(value = "加入购物车", response = ProgramShoppingCart.class) - public R save(@RequestBody @ApiParam(name = "小程序—购物车对象", value = "传入json格式", required = true) ProgramShoppingCart ProgramShoppingCart, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - ProgramShoppingCart.setAccountId(Integer.valueOf(accountId)); - boolean addState = service.save(ProgramShoppingCart); - return addState ? R.ok() : R.error("新增失败"); - } - - - - @PostMapping("/batchDeletion") - @ApiOperation(value = "批量删除购物车产品", response = ProgramShoppingCart.class) - public R batchDeletion(@ApiParam(name = "id", value = "主键", required = true) @RequestBody List ids) { - boolean delState = service.removeByIds(ids); - return delState ? R.ok() : R.error("删除失败"); - } -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/ShopDetailController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/ShopDetailController.java new file mode 100644 index 0000000..b761523 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/controller/ShopDetailController.java @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.controller; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.huoran.common.response.ServerResponseEntity; +import com.huoran.common.utils.TokenUtils; +import com.huoran.nakadai.entity.model.ShopDetail; +import com.huoran.nakadai.entity.param.ShopDetailParam; +import com.huoran.nakadai.service.ShopDetailService; +import com.huoran.nakadai.utils.PageParam; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import javax.validation.Valid; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + + + +/** + * + * @author lgh on 2018/08/29. + */ +@RestController +@RequestMapping("/shop/shopDetail") +public class ShopDetailController { + + @Autowired + private ShopDetailService shopDetailService; + + + /** + * 修改分销开关 + */ + @PutMapping("/isDistribution") + public ServerResponseEntity updateIsDistribution(@RequestParam Integer isDistribution, HttpServletRequest request){ + ShopDetail shopDetail=new ShopDetail(); + Integer shopId = TokenUtils.getShopIdByJwtToken(request); + shopDetail.setShopId(shopId); + shopDetail.setIsDistribution(isDistribution); + shopDetailService.updateById(shopDetail); + // 更新完成后删除缓存 + shopDetailService.removeShopDetailCacheByShopId(shopDetail.getShopId()); + return ServerResponseEntity.success(); + } + /** + * 获取信息 + */ + @GetMapping("/info") + public ServerResponseEntity info(HttpServletRequest request){ + ShopDetail shopDetail = shopDetailService.getShopDetailByShopId(TokenUtils.getShopIdByJwtToken(request)); + return ServerResponseEntity.success(shopDetail); + } + + + /** + * 分页获取 + */ + @GetMapping("/page") + public ServerResponseEntity> page(ShopDetail shopDetail, PageParam page){ + IPage shopDetails = shopDetailService.page(page, + new LambdaQueryWrapper() + .like(StrUtil.isNotBlank(shopDetail.getShopName()),ShopDetail::getShopName,shopDetail.getShopName()) + .orderByDesc(ShopDetail::getShopId)); + return ServerResponseEntity.success(shopDetails); + } + + /** + * 获取信息 + */ + @GetMapping("/info/{shopId}") + public ServerResponseEntity info(@PathVariable("shopId") Integer shopId){ + ShopDetail shopDetail = shopDetailService.getShopDetailByShopId(shopId); + // 店铺图片 + return ServerResponseEntity.success(shopDetail); + } + + /** + * 保存 + */ + @PostMapping + public ServerResponseEntity save(@Valid ShopDetailParam shopDetailParam){ + ShopDetail shopDetail = BeanUtil.copyProperties(shopDetailParam, ShopDetail.class); + shopDetail.setCreateTime(new Date()); + shopDetail.setShopStatus(1); + shopDetailService.save(shopDetail); + return ServerResponseEntity.success(); + } + + /** + * 修改 + */ + @PutMapping + public ServerResponseEntity update(@Valid ShopDetailParam shopDetailParam){ + ShopDetail daShopDetail = shopDetailService.getShopDetailByShopId(shopDetailParam.getShopId()); + ShopDetail shopDetail = BeanUtil.copyProperties(shopDetailParam, ShopDetail.class); + shopDetail.setUpdateTime(new Date()); + shopDetailService.updateShopDetail(shopDetail,daShopDetail); + return ServerResponseEntity.success(); + } + + /** + * 删除 + */ + @DeleteMapping("/{id}") + public ServerResponseEntity delete(@PathVariable Integer id){ + shopDetailService.deleteShopDetailByShopId(id); + return ServerResponseEntity.success(); + } + + /** + * 更新店铺状态 + */ + @PutMapping("/shopStatus") + public ServerResponseEntity shopStatus(@RequestParam Integer shopId,@RequestParam Integer shopStatus){ + ShopDetail shopDetail = new ShopDetail(); + shopDetail.setShopId(shopId); + shopDetail.setShopStatus(shopStatus); + shopDetailService.updateById(shopDetail); + // 更新完成后删除缓存 + shopDetailService.removeShopDetailCacheByShopId(shopDetail.getShopId()); + return ServerResponseEntity.success(); + } + + + /** + * 获取所有的店铺名称 + */ +// @GetMapping("/listShopName") +// public ServerResponseEntity> listShopName(){ +// List list = shopDetailService.list().stream().map((dbShopDetail) ->{ +// ShopDetail shopDetail = new ShopDetail(); +// shopDetail.setShopId(dbShopDetail.getShopId()); +// shopDetail.setShopName(dbShopDetail.getShopName()); +// return shopDetail; +// }).collect(Collectors.toList()); +// return ServerResponseEntity.success(list); +// } +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/SpecController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/SpecController.java new file mode 100644 index 0000000..da53e67 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/controller/SpecController.java @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.huoran.common.exception.YamiShopBindException; +import com.huoran.common.response.ServerResponseEntity; +import com.huoran.common.utils.TokenUtils; +import com.huoran.nakadai.entity.enums.ProdPropRule; +import com.huoran.nakadai.entity.model.ProdProp; +import com.huoran.nakadai.entity.model.ProdPropValue; + +import com.huoran.nakadai.service.ProdPropService; +import com.huoran.nakadai.service.ProdPropValueService; +import com.huoran.nakadai.utils.PageParam; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import javax.validation.Valid; +import java.util.List; +import java.util.Objects; + +/** + * 规格管理 + * + * @author lgh + */ +@RestController +@RequestMapping("/prod/spec") +public class SpecController { + + @Autowired + private ProdPropService prodPropService; + @Autowired + private ProdPropValueService prodPropValueService; + + /** + * 分页获取 + */ + @GetMapping("/page") + public ServerResponseEntity> page(ProdProp prodProp, PageParam page,HttpServletRequest request) { + prodProp.setRule(ProdPropRule.SPEC.value()); + prodProp.setShopId(TokenUtils.getShopIdByJwtToken(request)); + IPage list = prodPropService.pagePropAndValue(prodProp, page); + return ServerResponseEntity.success(list); + } + + + /** + * 获取所有的规格 + */ + @GetMapping("/list") + public ServerResponseEntity> list(HttpServletRequest request) { + List list = prodPropService.list(new LambdaQueryWrapper().eq(ProdProp::getRule, ProdPropRule.SPEC.value()).eq(ProdProp::getShopId, TokenUtils.getShopIdByJwtToken(request))); + return ServerResponseEntity.success(list); + } + + /** + * 根据规格id获取规格值 + */ + @GetMapping("/listSpecValue/{specId}") + public ServerResponseEntity> listSpecValue(@PathVariable("specId") Long specId) { + List list = prodPropValueService.list(new LambdaQueryWrapper().eq(ProdPropValue::getPropId, specId)); + return ServerResponseEntity.success(list); + } + + /** + * 保存 + */ + @PostMapping + public ServerResponseEntity save(@Valid @RequestBody ProdProp prodProp,HttpServletRequest request) { + prodProp.setRule(ProdPropRule.SPEC.value()); + prodProp.setShopId(TokenUtils.getShopIdByJwtToken(request)); + prodPropService.saveProdPropAndValues(prodProp); + return ServerResponseEntity.success(); + } + + /** + * 修改 + */ + @PutMapping + public ServerResponseEntity update(@Valid @RequestBody ProdProp prodProp, HttpServletRequest request) { + ProdProp dbProdProp = prodPropService.getById(prodProp.getPropId()); + if (!Objects.equals(dbProdProp.getShopId(), TokenUtils.getShopIdByJwtToken(request))) { + throw new YamiShopBindException("没有权限获取该商品规格信息"); + } + prodProp.setRule(ProdPropRule.SPEC.value()); + prodProp.setShopId(TokenUtils.getShopIdByJwtToken(request)); + prodPropService.updateProdPropAndValues(prodProp); + return ServerResponseEntity.success(); + } + + /** + * 删除 + */ + @DeleteMapping("/{id}") + public ServerResponseEntity delete(@PathVariable Integer id,HttpServletRequest request) { + prodPropService.deleteProdPropAndValues(id, ProdPropRule.SPEC.value(), TokenUtils.getShopIdByJwtToken(request)); + return ServerResponseEntity.success(); + } + + /** + * 根据获取规格值最大的自增id + */ + @GetMapping("/listSpecMaxValueId") + public ServerResponseEntity listSpecMaxValueId() { + ProdPropValue propValue = prodPropValueService.getOne(new LambdaQueryWrapper() + .orderByDesc(ProdPropValue::getValueId).last("limit 1")); + return ServerResponseEntity.success(Objects.isNull(propValue) ? 0L : propValue.getValueId()); + } + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/StudentModelCorrelationController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/StudentModelCorrelationController.java deleted file mode 100644 index 793a88b..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/StudentModelCorrelationController.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.huoran.nakadai.controller; - -import com.huoran.api.UserClient; -import com.huoran.common.constant.DelConstant; -import com.huoran.common.constant.ModellConstant; -import com.huoran.common.constant.PlatformConstant; -import com.huoran.common.exception.CustomException; -import com.huoran.common.exception.ExceptionEnum; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.nakadai.entity.ModelReferenceCategory; -import com.huoran.nakadai.entity.ModelReferenceDemo; -import com.huoran.nakadai.entity.ModelSysDemo; -import com.huoran.nakadai.entity.req.PageImportModelReq; -import com.huoran.nakadai.entity.req.PageModelReq; -import com.huoran.nakadai.service.ModelReferenceCategoryService; -import com.huoran.nakadai.service.ModelReferenceDemoService; -import com.huoran.nakadai.service.ModelSysDemoService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -/** - *

- * 引用模型代码记录表 前端控制器 - *

- * - * @author chen - * @since 2022-03-04 - */ -@RestController -@RequestMapping("/nakadai/model/student/") -@Api(value = "API - 学生端:ModelReferenceDemoController", tags = "中台:学生端模型相关") -public class StudentModelCorrelationController { - - @Autowired - private UserClient userClient; - @Autowired - public ModelReferenceDemoService service; - - @Autowired - public ModelSysDemoService sysDemoService; - - - @Autowired - public ModelReferenceCategoryService referenceCategoryService; - - @PostMapping("/studentModelList") - @ApiOperation(value = "学生端:读取教师端模型列表") - public R studentModelList(@RequestBody @Validated PageImportModelReq req, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - req.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - return service.studentModelList(req); - - } - - - @PostMapping("/studentModelListBySystem") - @ApiOperation(value = "学生端:读取教师端系统模型") - public R studentModelListBySystem(@RequestBody @Validated PageImportModelReq req, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - req.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - req.setIsOpen(DelConstant.IS_OPEN); - return service.systemModelByTeacher(req); - - } - - - @PostMapping("/modelClassListByStudent") - @ApiOperation(value = "学生端模型分类") - public R modelClassListByStudent(@RequestParam("systemId") @ApiParam(value = "系统id") Integer systemId, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - //schoolClassification学校共享出来的分类 - List schoolClassification = referenceCategoryService.modelClassList(systemId, ModellConstant.SOURCE_INSTITUTION, schoolId); - - //系统内置分类 - List systemBuiltInClassification = referenceCategoryService.builtInClassificationByNakadai(systemId); - - return R.ok().put("systemBuiltInClassification", systemBuiltInClassification).put("schoolClassification", schoolClassification); - } - - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/SupplierClassificationConfigController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/SupplierClassificationConfigController.java deleted file mode 100644 index a35a7ee..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/SupplierClassificationConfigController.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.huoran.nakadai.controller; - -import com.huoran.api.UserClient; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.nakadai.entity.SupplierClassificationConfig; -import com.huoran.nakadai.service.SupplierClassificationConfigService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -/** - * @描述:供应商分类配置表控制类 - * @作者: Rong - * @日期: 2023-12-27 - */ -@RestController -@RequestMapping("/supplierClassificationConfig") -@Api(value = "供应商分类配置表:SupplierClassificationConfigController", tags = "供应商分类配置表") -public class SupplierClassificationConfigController { - - @Autowired - public SupplierClassificationConfigService service; - - @Autowired - private UserClient userClient; - - /*@PostMapping("/listByEntity") - @ApiOperation(value = "分页查询", response = SupplierClassificationConfig.class) - public R listByEntity(@RequestBody SupplierClassificationConfig supplierClassificationConfig) { - - return null; - } -*/ - - @PostMapping("/findById") - @ApiOperation(value = "查询详情", response = SupplierClassificationConfig.class) - public R findById(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { - SupplierClassificationConfig supplierClassificationConfig = service.getById(id); - return R.ok().put("data", supplierClassificationConfig); - } - - - @PostMapping("/save") - @ApiOperation(value = "新增分类", response = SupplierClassificationConfig.class) - public R save(@RequestBody @ApiParam(name = "供应商分类配置表对象", value = "传入json格式", required = true) SupplierClassificationConfig supplierClassificationConfig, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - supplierClassificationConfig.setAccountId(Integer.valueOf(accountId)); - boolean addState = service.save(supplierClassificationConfig); - return addState ? R.ok() : R.error("新增失败"); - } - - - @PostMapping("/update") - @ApiOperation(value = "修改", response = SupplierClassificationConfig.class) - public R update(@RequestBody @ApiParam(name = "供应商分类配置表对象", value = "传入json格式", required = true) SupplierClassificationConfig supplierClassificationConfig, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - supplierClassificationConfig.setAccountId(Integer.valueOf(accountId)); - boolean updateState = service.updateById(supplierClassificationConfig); - return updateState ? R.ok() : R.error("编辑失败"); - } - - - @PostMapping("/batchDeletion") - @ApiOperation(value = "批量删除", response = SupplierClassificationConfig.class) - public R batchDeletion(@ApiParam(name = "ids", value = "主键", required = true) @RequestBody List ids) { - boolean delState = service.removeByIds(ids); - return delState ? R.ok() : R.error("删除失败"); - } -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/SupplierController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/SupplierController.java deleted file mode 100644 index 5b79705..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/SupplierController.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.huoran.nakadai.controller; - - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.common.response.R; -import com.huoran.nakadai.entity.Supplier; -import com.huoran.nakadai.service.SupplierService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -/** - *

- * 供应商表 前端控制器 - *

- * - * @author chen - * @since 2023-04-25 - */ -@Api(value = "M-商品供应商管理", tags = "M-商品供应商管理") -@RestController -@RequestMapping("/supplier") -public class SupplierController { - - @Autowired - private SupplierService supplierService; - - @ApiOperation(value = "添加供应商") - @PostMapping("/addSupplier") - public R addSupplier( - @ApiParam(name = "supplierName", value = "供应商名称", required = true) - @RequestParam String supplierName) { - //名称判重 - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("supplier_name",supplierName); - Supplier one = supplierService.getOne(queryWrapper); - if (ObjectUtil.isNotNull(one)){ - return R.error("供应商已存在!"); - } - //新增产品分类 - Supplier supplier = new Supplier(); - supplier.setSupplierName(supplierName); - boolean save = supplierService.save(supplier); - return save ? R.ok() : R.error(); - } - - @ApiOperation(value = "供应商列表") - @GetMapping("/supplierList") - public R supplierList( - @ApiParam(name = "search", value = "查询条件",required = false) - @RequestParam(required = false) String search) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - if (search!=null){ - queryWrapper.like("supplier_name",search); - } - List supplierList = supplierService.list(queryWrapper); - return R.ok().put("supplierList",supplierList); - } - - @ApiOperation(value = "删除供应商") - @PostMapping("/deleteSupplier") - public R deleteSupplier( - @ApiParam(name = "supplierId", value = "供应商id", required = true) - @RequestParam Integer supplierId) { - boolean remove = supplierService.removeById(supplierId); - return remove ? R.ok() : R.error(); - } - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/TagsController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/TagsController.java deleted file mode 100644 index 3bc4fba..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/TagsController.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.huoran.nakadai.controller; - - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.common.response.R; -import com.huoran.nakadai.entity.Tags; -import com.huoran.nakadai.entity.req.TagsReq; -import com.huoran.nakadai.service.TagsService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -/** - *

- * 分类标签表 前端控制器 - *

- * - * @author chen - * @since 2023-04-25 - */ -@Api(value = "M-商品分类标签管理", tags = "M-商品分类标签管理") -@RestController -@RequestMapping("/tags") -public class TagsController { - - @Autowired - private TagsService tagsService; - - @ApiOperation(value = "添加分类标签") - @PostMapping("/addTags") - public R addTags( - @ApiParam(name = "tagsName", value = "分类标签名称", required = true) - @RequestParam String tagsName) { - //名称判重 - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("tags_name",tagsName); - Tags one = tagsService.getOne(queryWrapper); - if (ObjectUtil.isNotNull(one)){ - return R.error("分类标签已存在!"); - } - //新增产品分类 - Tags tags = new Tags(); - tags.setTagsName(tagsName); - tags.setSort(tagsService.count(null)); - boolean save = tagsService.save(tags); - return save ? R.ok() : R.error(); - } - - @ApiOperation(value = "更新分类标签") - @PostMapping("/updateTags") - public R updateTags( - @ApiParam(name = "tags", value = "分类标签", required = true) - @RequestBody Tags tags) { - //名称判重 - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("tags_name",tags.getTagsName()).notInSql("tags_id", tags.getTagsId().toString()); - Tags one = tagsService.getOne(queryWrapper); - if (ObjectUtil.isNotNull(one)){ - return R.error("分类标签已存在!"); - } - boolean save = tagsService.updateById(tags); - return save ? R.ok() : R.error(); - } - - @ApiOperation(value = "更新标签排序") - @PostMapping("/updateTagsSort") - public R updateTagsSort( - @ApiParam(name = "tagsReq", value = "标签集合", required = true) - @RequestBody TagsReq tagsReq) { - boolean updateBatchById = tagsService.updateBatchById(tagsReq.getTagsList()); - return updateBatchById ? R.ok() : R.error(); - } - - @ApiOperation(value = "分类标签列表") - @GetMapping("/tagsList") - public R tagsList( - @ApiParam(name = "search", value = "查询条件",required = false) - @RequestParam(required = false) String search) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - if (search!=null){ - queryWrapper.like("tags_name",search); - } - queryWrapper.orderByAsc("sort"); - List tagsList = tagsService.list(queryWrapper); - return R.ok().put("tagsList",tagsList); - } - - @ApiOperation(value = "删除分类标签") - @PostMapping("/deleteTags") - public R deleteTags( - @ApiParam(name = "tagsId", value = "标签id", required = true) - @RequestParam Integer tagsId) { - boolean remove = tagsService.removeById(tagsId); - return remove ? R.ok() : R.error(); - } - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/ValueModuleManagementController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/ValueModuleManagementController.java deleted file mode 100644 index ca6794d..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/ValueModuleManagementController.java +++ /dev/null @@ -1,114 +0,0 @@ -package com.huoran.nakadai.controller; - - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.api.UserClient; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.nakadai.entity.Customer; -import com.huoran.nakadai.entity.Order; -import com.huoran.nakadai.entity.OrderOther; -import com.huoran.nakadai.entity.ValueModuleManagement; -import com.huoran.nakadai.service.ICustomerService; -import com.huoran.nakadai.service.IOrderService; -import com.huoran.nakadai.service.OrderOtherService; -import com.huoran.nakadai.service.ValueModuleManagementService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -/** - *

- * 增值模块管理表 前端控制器 - *

- * - * @author chen - * @since 2023-01-30 - */ -@Api(tags = "增值模块管理") -@RestController -@RequestMapping("/nakadai/valueModuleManagement") -public class ValueModuleManagementController { - - @Autowired - private ValueModuleManagementService valueModuleManagementService; - - @Autowired - private IOrderService orderService; - - - @Autowired - private UserClient userClient; - - @Autowired - private ICustomerService customerService; - - @Autowired - private OrderOtherService orderOtherService; - - @ApiOperation(value = "增值模块列表") - @PostMapping("/getValueModule") - public R getAllService(@RequestParam Integer platformId){ - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("platform_id",platformId); - List list = valueModuleManagementService.list(wrapper); - List valueList = valueModuleManagementService.selectProductModule(); - for (ValueModuleManagement valueModuleManagement : list) { - if (valueList.contains(valueModuleManagement.getId())){ - valueModuleManagement.setAssociatedProductIdentification(true); - } - } - return R.ok().put("valueList",list); - } - - - @ApiOperation(value = "查询客户增值模块") - @GetMapping("/getCustomerOrder") - public R getCustomerOrder(HttpServletRequest request) { - Integer customerId; - String id = TokenUtils.getIdByJwtToken(request); - //查询学校id - Integer schoolId = userClient.getSchoolIdByAccountId(id); - //根据学校查询客户id - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("school_id",schoolId); - Customer one = customerService.getOne(wrapper); - if (one!=null){ - customerId = one.getCustomerId(); - }else { - return R.ok().put("show", false); - } - - List orderList = orderService.list(new QueryWrapper().eq("customer_id", customerId)); - if (orderList!=null && orderList.size()<1){ - return R.ok().put("show", false); - } - ArrayList orderIdList = new ArrayList<>(); - orderList.forEach(order -> { - orderIdList.add(order.getOrderId()); - }); - - QueryWrapper orderOtherQueryWrapper = new QueryWrapper<>(); - orderOtherQueryWrapper.eq("is_enable",1); - orderOtherQueryWrapper.eq("authority",2); - orderOtherQueryWrapper.eq("ship",1); - orderOtherQueryWrapper.in("order_id",orderIdList); - List list = orderOtherService.list(orderOtherQueryWrapper); - if (list!=null && list.size()>0){ - for (OrderOther orderOther : list) { - //结束时间大于当前时间,当前模块还在使用期间 - if (orderOther.getEndTime().getTime() > new Date().getTime()){ - return R.ok().put("show",true); - } - } - } - return R.ok().put("show", false); - } -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/BasketItemDto.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/BasketItemDto.java new file mode 100644 index 0000000..2e88615 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/BasketItemDto.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.dto; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author lanhai + */ +@Data +public class BasketItemDto implements Serializable { + + @ApiModelProperty(value = "购物车ID" , required = true) + private Long basketId; + + @ApiModelProperty(value = "店铺ID" , required = true) + private Long shopId; + + /** + * 商品名称 + */ + @JsonIgnore + private String shopName; + + @ApiModelProperty(value = "产品ID" , required = true) + private Integer prodId; + + @ApiModelProperty(value = "skuID" , required = true) + private Integer skuId; + + @ApiModelProperty(value = "产品个数" , required = true) + private Integer prodCount; + + @ApiModelProperty(value = "产品名称" , required = true) + private String prodName; + + @ApiModelProperty(value = "产品主图" , required = true) + private String pic; + + @ApiModelProperty(value = "产品现价" , required = true) + private Double price; + + @ApiModelProperty(value = "产品原价" , required = true) + private Double oriPrice; + + @ApiModelProperty(value = "产品简介" , required = true) + private String brief; + + @ApiModelProperty(value = "产品sku信息" , required = true) + private String skuName; + + @ApiModelProperty(value = "参与满减活动列表" ) + private List discounts; + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/CategoryDto.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/CategoryDto.java new file mode 100644 index 0000000..7de0412 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/CategoryDto.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author lanhai + */ +@Data +public class CategoryDto { + + @ApiModelProperty(value = "分类id" ,required=true) + private Long categoryId; + + @ApiModelProperty(value = "分类父id" ,required=true) + private Long parentId; + + @ApiModelProperty(value = "分类名称" ,required=true) + private String categoryName; + + @ApiModelProperty(value = "分类图片" ,required=true) + private String pic; + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ChooseDiscountItemDto.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ChooseDiscountItemDto.java new file mode 100644 index 0000000..50772e2 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ChooseDiscountItemDto.java @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 购物车中选中的满减活动项信息 + * @author lanhai + */ +@Data +public class ChooseDiscountItemDto implements Serializable { + + + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/CouponOrderDto.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/CouponOrderDto.java new file mode 100644 index 0000000..5639057 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/CouponOrderDto.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author lanhai + */ +@Data +public class CouponOrderDto implements Serializable { + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/DeliveryDto.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/DeliveryDto.java new file mode 100644 index 0000000..bfd26e3 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/DeliveryDto.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.dto; + + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * @author lanhai + */ +@Data +public class DeliveryDto { + + @ApiModelProperty(value = "物流公司名称" ,required=true) + private String companyName; + + @ApiModelProperty(value = "物流公司官网" ,required=true) + private String companyHomeUrl; + + @ApiModelProperty(value = "物流订单号" ,required=true) + private String dvyFlowId; + + @ApiModelProperty(value = "查询出的物流信息" ,required=true) + private List data; + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/DeliveryInfoDto.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/DeliveryInfoDto.java new file mode 100644 index 0000000..dec7b69 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/DeliveryInfoDto.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.dto; + + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author lanhai + */ +@Data +public class DeliveryInfoDto { + + @ApiModelProperty(value = "详细信息" ,required=true) + private String context; + + private String ftime; + + @ApiModelProperty(value = "快递所在区域" ,required=true) + private String location; + + @ApiModelProperty(value = "物流更新时间" ,required=true) + private String time; + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/DiscountDto.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/DiscountDto.java new file mode 100644 index 0000000..40ed940 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/DiscountDto.java @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author lanhai + */ +@Data +public class DiscountDto implements Serializable { + + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/IndexImgDto.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/IndexImgDto.java new file mode 100644 index 0000000..79c5e29 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/IndexImgDto.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** + * @author lanhai + */ +@Data +public class IndexImgDto { + + /** + * 图片 + */ + @ApiModelProperty(value = "图片Url" , required = true) + private String imgUrl; + + /** + * 顺序 + */ + @ApiModelProperty(value = "图片顺序" , required = true) + private Integer seq; + + /** + * 上传时间 + */ + @ApiModelProperty(value = "上传时间" , required = true) + private Date uploadTime; + + /** + * 类型 + */ + @ApiModelProperty(value = "类型" , required = true) + private int type; + + /** + * 关联id + */ + @ApiModelProperty(value = "关联id" , required = true) + private Long relation; + + + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/MyOrderDto.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/MyOrderDto.java new file mode 100644 index 0000000..5f9e919 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/MyOrderDto.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.dto; + + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * @author lanhai + */ +@Data +public class MyOrderDto { + + @ApiModelProperty(value = "订单项" ,required=true) + private List orderItemDtos; + + @ApiModelProperty(value = "订单号" ,required=true) + private String orderNumber; + + @ApiModelProperty(value = "总价" ,required=true) + private Double actualTotal; + + @ApiModelProperty(value = "订单状态" ,required=true) + private Integer status; + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/MyOrderItemDto.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/MyOrderItemDto.java new file mode 100644 index 0000000..d3e1835 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/MyOrderItemDto.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author lanhai + */ +@Data +public class MyOrderItemDto { + + @ApiModelProperty(value = "商品图片" , required = true) + private String pic; + + @ApiModelProperty(value = "商品名称" , required = true) + private String prodName; + + @ApiModelProperty(value = "商品数量" , required = true) + private Integer prodCount; + + @ApiModelProperty(value = "商品价格" , required = true) + private Double price; + + @ApiModelProperty(value = "skuName" , required = true) + private String skuName; + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/NoticeDto.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/NoticeDto.java new file mode 100644 index 0000000..1d74317 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/NoticeDto.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.dto; + +import lombok.Data; + +import java.util.Date; + +/** + * @author lanhai + */ +//@Schema(description = "公告对象") +@Data +public class NoticeDto { + +// @Schema(description = "公告id" ) + private Long id; + +// @Schema(description = "店铺id" ) + private Long shopId; + +// @Schema(description = "标题" ) + private String title; + +// @Schema(description = "公告内容" ) + private String content; + +// @Schema(description = "公告发布时间" ) + private Date publishTime; + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/OrderCountData.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/OrderCountData.java new file mode 100644 index 0000000..78e2e6b --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/OrderCountData.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author lanhai + */ +@Data +public class OrderCountData { + + @ApiModelProperty(value = "所有订单数量" ) + private Integer allCount; + + @ApiModelProperty(value = "待付款" ) + private Integer unPay; + + @ApiModelProperty(value = "待发货" ) + private Integer payed; + + @ApiModelProperty(value = "待收货" ) + private Integer consignment; + + @ApiModelProperty(value = "待评价" ) + private Integer confirm; + + @ApiModelProperty(value = "成功" ) + private Integer success; + + @ApiModelProperty(value = "失败" ) + private Integer close; + + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/OrderItemDto.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/OrderItemDto.java new file mode 100644 index 0000000..84f2dee --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/OrderItemDto.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.dto; + +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; + +/** + * @author LGH + */ +@Data +@EqualsAndHashCode(callSuper = false) +public class OrderItemDto extends ProductItemDto implements Serializable { + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/OrderNumbersDto.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/OrderNumbersDto.java new file mode 100644 index 0000000..25bc6be --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/OrderNumbersDto.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.dto; + + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author lanhai + */ +@Data +public class OrderNumbersDto { + + @ApiModelProperty(value = "多个订单号拼接的字符串" ,required=true) + private String orderNumbers; + + public OrderNumbersDto(String orderNumbers) { + this.orderNumbers = orderNumbers; + } + public OrderNumbersDto(){} +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/OrderShopDto.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/OrderShopDto.java new file mode 100644 index 0000000..df2d950 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/OrderShopDto.java @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.dto; + + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * 订单下的每个店铺 + * + * @author YaMi + */ +@Data +public class OrderShopDto implements Serializable { + + /** + * 店铺ID + **/ + @ApiModelProperty(value = "店铺id" , required = true) + private Long shopId; + + /** + * 店铺名称 + **/ + @ApiModelProperty(value = "店铺名称" , required = true) + private String shopName; + + @ApiModelProperty(value = "实际总值" , required = true) + private Double actualTotal; + + @ApiModelProperty(value = "商品总值" , required = true) + private Double total; + + @ApiModelProperty(value = "商品总数" , required = true) + private Integer totalNum; + + @ApiModelProperty(value = "地址Dto" , required = true) + private UserAddrDto userAddrDto; + + @ApiModelProperty(value = "产品信息" , required = true) + private List orderItemDtos; + + @ApiModelProperty(value = "运费" , required = true) + private Double transfee; + + @ApiModelProperty(value = "优惠总额" , required = true) + private Double reduceAmount; + + @ApiModelProperty(value = "促销活动优惠金额" , required = true) + private Double discountMoney; + + @ApiModelProperty(value = "优惠券优惠金额" , required = true) + private Double couponMoney; + + /** + * 创建时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "订单创建时间" , required = true) + private Date createTime; + + /** + * 订单备注信息 + */ + @ApiModelProperty(value = "订单备注信息" , required = true) + private String remarks; + + /** + * 订单状态 + */ + @ApiModelProperty(value = "订单状态" , required = true) + private Integer status; +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ProdCommDataDto.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ProdCommDataDto.java new file mode 100644 index 0000000..e366885 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ProdCommDataDto.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author lanhai + */ +@Data +public class ProdCommDataDto { + + @ApiModelProperty(value = "好评率" ) + private Double positiveRating; + + @ApiModelProperty(value = "评论数量" ) + private Integer number; + + @ApiModelProperty(value = "好评数" ) + private Integer praiseNumber; + + @ApiModelProperty(value = "中评数" ) + private Integer secondaryNumber; + + @ApiModelProperty(value = "差评数" ) + private Integer negativeNumber; + + @ApiModelProperty(value = "有图数" ) + private Integer picNumber; + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ProdCommDto.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ProdCommDto.java new file mode 100644 index 0000000..c7cb8e3 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ProdCommDto.java @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +/** + * @author lanhai + */ +@Data +public class ProdCommDto { + + @ApiModelProperty(value = "id" ) + private Long prodCommId; + + /** + * 得分,0-5分 + */ + @ApiModelProperty(value = "得分,0-5分" ) + private Integer score; + + /** + * 是否匿名(1:是 0:否) + */ + @ApiModelProperty(value = "是否匿名(1:是 0:否)" ) + private Integer isAnonymous; + + /** + * 掌柜回复 + */ + @ApiModelProperty(value = "掌柜回复" ) + private String replyContent; + + /** + * 记录时间 + */ + @ApiModelProperty(value = "记录时间" ) + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date recTime; + + /** + * 回复时间 + */ + @ApiModelProperty(value = "回复时间" ) + @JsonFormat(pattern = "yyyy-MM-dd") + private Date replyTime; + + @ApiModelProperty(value = "用户昵称" ) + private String nickName; + + /** + * 头像图片路径 + */ + @ApiModelProperty(value = "头像图片路径" ) + private String pic; + + /** + * 是否回复 0:未回复 1:已回复 + */ + @ApiModelProperty(value = "商家是否回复 0:未回复 1:已回复" ) + private Integer replySts; + + /** + * 评论图片 + */ + @ApiModelProperty(value = "评论图片" ) + private String pics; + + /** + * 评价等级 + */ + @ApiModelProperty(value = "0好评 1中评 2差评" ) + private Byte evaluate; + + @ApiModelProperty(value = "评论内容" ) + private String content; + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ProdTagDto.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ProdTagDto.java new file mode 100644 index 0000000..fc70914 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ProdTagDto.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.dto; + + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author lanhai + */ +@Data +public class ProdTagDto { + + @ApiModelProperty(value = "分组标签id" ) + private Long id; + + @ApiModelProperty(value = "分组标签标题" ) + private String title; + + @ApiModelProperty(value = "排序(数值越高越靠前)" ) + private String seq; + + @ApiModelProperty(value = "列表样式(0:一列一个,1:一列两个,2:一列三个)" ) + private String style; + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ProductDto.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ProductDto.java new file mode 100644 index 0000000..d49ee38 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ProductDto.java @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.huoran.nakadai.entity.model.Transport; +import lombok.Data; + +import java.util.List; + +/** + * @author lanhai + */ +@Data +public class ProductDto { + /** + * 店铺ID + */ +// @Schema(description = "店铺ID" , required = true) + private Long shopId; + + /** + * 店铺名称 + */ +// @Schema(description = "店铺名称" , required = true) + private String shopName; + + /** + * 商品ID + */ +// @Schema(description = "商品ID" , required = true) + private Integer prodId; + + /** + * 商品名称 + */ +// @Schema(description = "商品名称" ) + private String prodName; + + /** + * 商品价格 + */ +// @Schema(description = "商品价格" , required = true) + private Double price; + + /** + * 商品详情 + */ +// @Schema(description = "详细描述" ) + private String content; + + /** + * 商品原价 + */ +// @Schema(description = "商品原价" , required = true) + private Double oriPrice; + + /** + * 库存量 + */ +// @Schema(description = "库存量" , required = true) + private Integer totalStocks; + + /** + * 简要描述,卖点等 + */ +// @Schema(description = "简要描述,卖点等" , required = true) + private String brief; + + /** + * 商品主图 + */ +// @Schema(description = "商品主图" , required = true) + private String pic; + +// @Schema(description = "商品图片列表,以逗号分割" , required = true) + private String imgs; + + /** + * 商品分类 + */ +// @Schema(description = "商品分类id" , required = true) + private Long categoryId; + +// @Schema(description = "sku列表" ) + private List skuList; + +// @Schema(description = "运费信息" , required = true) + private Transport transport; + + public static interface WithNoContent{} + + public static interface WithContent extends WithNoContent{} + + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ProductItemDto.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ProductItemDto.java new file mode 100644 index 0000000..30b008b --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ProductItemDto.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @author LGH + */ +@Data +public class ProductItemDto implements Serializable { + + @ApiModelProperty(value = "产品名称" ,required=true) + private String prodName; + + @ApiModelProperty(value = "产品个数" ,required=true) + private Integer prodCount; + + @ApiModelProperty(value = "产品图片路径" ,required=true) + private String pic; + + @ApiModelProperty(value = "产品价格" ,required=true) + private Double price; + + @ApiModelProperty(value = "商品总金额" ,required=true) + private Double productTotalAmount; + + @ApiModelProperty(value = "产品ID" ,required=true) + private Integer prodId; + + @ApiModelProperty(value = "skuId" ,required=true) + private Integer skuId; + + @ApiModelProperty(value = "规格名称" , required = true) + private String skuName; + + @ApiModelProperty(value = "basketId" ,required=true) + private Long basketId; + + @ApiModelProperty(value = "商品实际金额 = 商品总金额 - 分摊的优惠金额" ) + private Double actualTotal; + + @ApiModelProperty(value = "满减满折优惠id,0不主动参与活动(用户没有主动参与该活动),-1主动不参与活动" ) + private Long discountId = 0L; + + @ApiModelProperty(value = "分摊的优惠金额" ) + private Double shareReduce; + + @ApiModelProperty(value = "参与满减活动列表" ) + private List discounts = new ArrayList<>(); +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ShopCartAmountDto.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ShopCartAmountDto.java new file mode 100644 index 0000000..0cf8c29 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ShopCartAmountDto.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.dto; + + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author lanhai + */ +@Data +public class ShopCartAmountDto { + + @ApiModelProperty(value = "总额" ) + private Double totalMoney; + + @ApiModelProperty(value = "总计" ) + private Double finalMoney; + + @ApiModelProperty(value = "减额" ) + private Double subtractMoney; + + @ApiModelProperty(value = "商品数量" ) + private Integer count; +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ShopCartDto.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ShopCartDto.java new file mode 100644 index 0000000..3d3d518 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ShopCartDto.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author lanhai + */ +@Data +public class ShopCartDto implements Serializable { + + @ApiModelProperty(value = "店铺ID" , required = true) + private Integer shopId; + + @ApiModelProperty(value = "店铺名称" , required = true) + private String shopName; + + @ApiModelProperty(value = "购物车商品" , required = true) + private List shopCartItemDiscounts; + + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ShopCartExpiryItemDto.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ShopCartExpiryItemDto.java new file mode 100644 index 0000000..c9f6ede --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ShopCartExpiryItemDto.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.dto; + + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * @author lanhai + */ +@Data +public class ShopCartExpiryItemDto { + @ApiModelProperty(value = "店铺ID" , required = true) + private Long shopId; + + @ApiModelProperty(value = "店铺名称" , required = true) + private String shopName; + + @ApiModelProperty(value = "商品项" , required = true) + private List shopCartItemDtoList; + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ShopCartItemDiscountDto.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ShopCartItemDiscountDto.java new file mode 100644 index 0000000..530aa48 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ShopCartItemDiscountDto.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author lanhai + */ +@Data +public class ShopCartItemDiscountDto implements Serializable { + + + @ApiModelProperty(value = "已选满减项" , required = true) + private ChooseDiscountItemDto chooseDiscountItemDto; + + @ApiModelProperty(value = "商品列表" ) + private List shopCartItems; +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ShopCartItemDto.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ShopCartItemDto.java new file mode 100644 index 0000000..4482786 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ShopCartItemDto.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author LGH + */ +@Data +@EqualsAndHashCode(callSuper = false) +public class ShopCartItemDto extends ProductItemDto implements Serializable { + private static final long serialVersionUID = -8284981156242930909L; + + @ApiModelProperty(value = "购物车ID" , required = true) + private Long basketId; + + @ApiModelProperty(value = "店铺ID" , required = true) + private Integer shopId; + + @ApiModelProperty(value = "规格名称" , required = true) + private String skuName; + + @ApiModelProperty(value = "店铺名称" , required = true) + private String shopName; + + @ApiModelProperty(value = "商品原价" , required = true) + private Double oriPrice; + + @ApiModelProperty(value = "推广员使用的推销卡号" ) + private String distributionCardNo; + + @ApiModelProperty(value = "加入购物车的时间" ) + private Date basketDate; +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ShopCartOrderDto.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ShopCartOrderDto.java new file mode 100644 index 0000000..12aafd8 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ShopCartOrderDto.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 单个店铺的订单信息 + * @author lanhai + */ +@Data +public class ShopCartOrderDto implements Serializable{ + + @ApiModelProperty(value = "店铺id" , required = true) + private Integer shopId; + + @ApiModelProperty(value = "店铺名称" , required = true) + private String shopName; + + @ApiModelProperty(value = "实际总值" , required = true) + private Double actualTotal; + + @ApiModelProperty(value = "商品总值" , required = true) + private Double total; + + @ApiModelProperty(value = "商品总数" , required = true) + private Integer totalCount; + + @ApiModelProperty(value = "运费" , required = true) + private Double transfee; + + @ApiModelProperty(value = "促销活动优惠金额" , required = true) + private Double discountReduce; + + @ApiModelProperty(value = "优惠券优惠金额" , required = true) + private Double couponReduce; + + @ApiModelProperty(value = "店铺优惠金额(促销活动 + 优惠券 + 其他)" , required = true) + private Double shopReduce = 0.0; + + @ApiModelProperty(value = "订单备注信息" , required = true) + private String remarks; + + @ApiModelProperty(value = "购物车商品" , required = true) + private List shopCartItemDiscounts; + + @ApiModelProperty(value = "整个店铺可以使用的优惠券列表" , required = true) + private List coupons; + + @ApiModelProperty(value = "订单编号" , required = true) + private String orderNumber; +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ShopCartOrderMergerDto.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ShopCartOrderMergerDto.java new file mode 100644 index 0000000..35b20ef --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/ShopCartOrderMergerDto.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 多个店铺订单合并在一起的合并类 + * "/confirm" 使用 + * @author lanhai + */ +@Data +public class ShopCartOrderMergerDto implements Serializable{ + + @ApiModelProperty(value = "实际总值" , required = true) + private Double actualTotal; + + @ApiModelProperty(value = "商品总值" , required = true) + private Double total; + + @ApiModelProperty(value = "商品总数" , required = true) + private Integer totalCount; + + @ApiModelProperty(value = "订单优惠金额(所有店铺优惠金额相加)" , required = true) + private Double orderReduce; + + @ApiModelProperty(value = "地址Dto" , required = true) + private UserAddrDto userAddr; + + @ApiModelProperty(value = "每个店铺的购物车信息" , required = true) + private List shopCartOrders; + + @ApiModelProperty(value = "整个订单可以使用的优惠券列表" , required = true) + private List coupons; +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/SkuDto.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/SkuDto.java new file mode 100644 index 0000000..a1e9351 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/SkuDto.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author lanhai + */ +@Data +public class SkuDto implements Serializable { + + private static final long serialVersionUID = 6457261945829470666L; + + @ApiModelProperty(value = "skuId" , required = true) + private Integer skuId; + @ApiModelProperty(value = "价格" , required = true) + private Double price; + @ApiModelProperty(value = "原价" ) + private Double oriPrice; + + @ApiModelProperty(value = "库存(-1表示无穷)" , required = true) + private Integer stocks; + + @ApiModelProperty(value = "sku名称" , required = true) + private String skuName; + + @ApiModelProperty(value = "图片" ) + private String pic; + + @ApiModelProperty(value = "销售属性组合字符串,格式是p1:v1;p2:v2" , required = true) + private String properties; +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/TagProductDto.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/TagProductDto.java new file mode 100644 index 0000000..6eafa75 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/TagProductDto.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.dto; + +import io.swagger.annotations.ApiModelProperty; +import io.swagger.annotations.ApiOperation; +import lombok.Data; + +import java.util.List; + +/** + * @author lanhai + */ +@Data +public class TagProductDto { + + @ApiModelProperty(value = "分组标签id" ) + private Long id; + + @ApiModelProperty(value = "分组标签标题" ) + private String title; + + @ApiModelProperty(value = "排序(数值越高越靠前)" ) + private String seq; + + @ApiModelProperty(value = "列表样式(0:一列一个,1:一列两个,2:一列三个)" ) + private String style; + + private List productDtoList; +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/UserAddrDto.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/UserAddrDto.java new file mode 100644 index 0000000..28a79fa --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/UserAddrDto.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +/** + * @author lanhai + */ +@Data +public class UserAddrDto implements Serializable { + @ApiModelProperty(value = "地址id" , required = true) + private Long addrId; + + @ApiModelProperty(value = "收货人" , required = true) + private String receiver; + + @ApiModelProperty(value = "省" , required = true) + private String province; + + @ApiModelProperty(value = "城市" , required = true) + private String city; + + @ApiModelProperty(value = "区" , required = true) + private String area; + + @ApiModelProperty(value = "地址" , required = true) + private String addr; + + @ApiModelProperty(value = "手机" , required = true) + private String mobile; + + @ApiModelProperty(value = "是否默认地址(1:是 0:否) " , required = true) + private Integer commonAddr; + + /** + * 省ID + */ + @ApiModelProperty(value = "省ID" , required = true) + private Long provinceId; + + /** + * 城市ID + */ + @ApiModelProperty(value = "城市ID" , required = true) + private Long cityId; + + /** + * 区域ID + */ + @ApiModelProperty(value = "区域ID" , required = true) + private Long areaId; +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/UserCollectionDto.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/UserCollectionDto.java new file mode 100644 index 0000000..012d664 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/UserCollectionDto.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.dto; + + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; +/** + * @author lanhai + */ +@Data +public class UserCollectionDto { + + @ApiModelProperty(value = "收藏id" ) + private Long id; + + @ApiModelProperty(value = "商品名称" ) + private String prodName; + + @ApiModelProperty(value = "收藏时间" ) + private Date createTime; + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/AddrParam.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/AddrParam.java new file mode 100644 index 0000000..d261207 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/AddrParam.java @@ -0,0 +1,155 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.param; + + + +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.NotNull; + +/** + * @author lanhai + */ +public class AddrParam { + + @ApiModelProperty(value = "地址ID" ,required=true) + private Long addrId; + + @NotNull(message = "收货人不能为空") + @ApiModelProperty(value = "收货人" ,required=true) + private String receiver; + + @NotNull(message = "地址不能为空") + @ApiModelProperty(value = "地址" ,required=true) + private String addr; + + @ApiModelProperty(value = "邮编" ,required=false) + private String postCode; + + @NotNull(message = "手机不能为空") + @ApiModelProperty(value = "手机" ,required=true) + private String mobile; + + @NotNull(message = "省ID不能为空") + @ApiModelProperty(value = "省ID" ,required=true) + private Long provinceId; + + @NotNull(message = "城市ID不能为空") + @ApiModelProperty(value = "城市ID" ,required=true) + private Long cityId; + + @NotNull(message = "区ID不能为空") + @ApiModelProperty(value = "区ID" ,required=true) + private Long areaId; + + @NotNull(message = "省不能为空") + @ApiModelProperty(value = "省" ,required=true) + private String province; + + @NotNull(message = "城市不能为空") + @ApiModelProperty(value = "城市" ,required=true) + private String city; + + @NotNull(message = "区不能为空") + @ApiModelProperty(value = "区" ,required=true) + private String area; + + + public Long getAddrId() { + return addrId; + } + + public void setAddrId(Long addrId) { + this.addrId = addrId; + } + + public String getReceiver() { + return receiver; + } + + public void setReceiver(String receiver) { + this.receiver = receiver; + } + + public String getAddr() { + return addr; + } + + public void setAddr(String addr) { + this.addr = addr; + } + + public String getPostCode() { + return postCode; + } + + public void setPostCode(String postCode) { + this.postCode = postCode; + } + + public String getMobile() { + return mobile; + } + + public void setMobile(String mobile) { + this.mobile = mobile; + } + + public Long getProvinceId() { + return provinceId; + } + + public void setProvinceId(Long provinceId) { + this.provinceId = provinceId; + } + + public Long getCityId() { + return cityId; + } + + public void setCityId(Long cityId) { + this.cityId = cityId; + } + + public Long getAreaId() { + return areaId; + } + + public void setAreaId(Long areaId) { + this.areaId = areaId; + } + + public String getProvince() { + return province; + } + + public void setProvince(String province) { + this.province = province; + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + public String getArea() { + return area; + } + + public void setArea(String area) { + this.area = area; + } + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/ChangeShopCartParam.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/ChangeShopCartParam.java new file mode 100644 index 0000000..73a44b8 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/ChangeShopCartParam.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.param; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * @author LGH + */ +@Data +public class ChangeShopCartParam { + + @ApiModelProperty(value = "购物车ID" , required = true) + private Long basketId; + + @NotNull(message = "商品ID不能为空") + @ApiModelProperty(value = "商品ID" , required = true) + private Integer prodId; + + @NotNull(message = "skuId不能为空") + @ApiModelProperty(value = "skuId" , required = true) + private Integer skuId; + + @NotNull(message = "店铺ID不能为空") + @ApiModelProperty(value = "店铺ID" , required = true) + private Long shopId; + + @NotNull(message = "商品个数不能为空") + @ApiModelProperty(value = "商品个数" , required = true) + private Integer count; + + @ApiModelProperty(value = "分销推广人卡号" ) + private String distributionCardNo; +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/OrderItemParam.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/OrderItemParam.java new file mode 100644 index 0000000..e6a94e0 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/OrderItemParam.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.param; + + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotNull; + +/** + * @author lanhai + */ +@Data +public class OrderItemParam { + + @NotNull(message = "产品ID不能为空") + @ApiModelProperty(value = "产品ID" ,required=true) + private Integer prodId; + + @NotNull(message = "skuId不能为空") + @ApiModelProperty(value = "skuId" ,required=true) + private Integer skuId; + + @NotNull(message = "产品数量不能为空") + @Min(value = 1,message = "产品数量不能为空") + @ApiModelProperty(value = "产品数量" ,required=true) + private Integer prodCount; + + @NotNull(message = "店铺id不能为空") + @ApiModelProperty(value = "店铺id" ,required=true) + private Integer shopId; + + @ApiModelProperty(value = "推广员使用的推销卡号" ) + private String distributionCardNo; +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/OrderParam.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/OrderParam.java new file mode 100644 index 0000000..244d085 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/OrderParam.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.param; + + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + * @author lanhai + */ +@Data +public class OrderParam { + + + @ApiModelProperty(value = "购物车id 数组" ) + private List basketIds; + + @ApiModelProperty(value = "立即购买时提交的商品项" ) + private OrderItemParam orderItem; + + @ApiModelProperty(value = "地址ID,0为默认地址" ,required=true) + @NotNull(message = "地址不能为空") + private Long addrId; + + @ApiModelProperty(value = "用户是否改变了优惠券的选择,如果用户改变了优惠券的选择,则完全根据传入参数进行优惠券的选择" ) + private Integer userChangeCoupon; + + @ApiModelProperty(value = "优惠券id数组" ) + private List couponIds; + +// @Schema(description = "每次订单提交时的uuid" ) +// private String uuid; +// @Schema(description = "订单入口 SHOP_CART购物车,BUY_NOW立即购买" ) +// private OrderEntry orderEntry; + + + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/OrderRefundExpressParam.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/OrderRefundExpressParam.java new file mode 100644 index 0000000..55b3221 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/OrderRefundExpressParam.java @@ -0,0 +1,27 @@ +package com.huoran.nakadai.entity.app.param; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotEmpty; + +/** + * @author lanhai + */ +@Data +public class OrderRefundExpressParam { + + @ApiModelProperty(value = "退款编号名称" , required = true) + @NotEmpty(message = "退款编号不能为空") + private String refundSn; + + @ApiModelProperty(value = "物流公司名称" , required = true) + @NotEmpty(message = "物流公司名称不能为空") + private String expressName; + + @ApiModelProperty(value = "物流单号" , required = true) + @NotEmpty(message = "物流单号不能为空") + private String expressNo; + + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/OrderRefundParam.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/OrderRefundParam.java new file mode 100644 index 0000000..bff5b54 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/OrderRefundParam.java @@ -0,0 +1,37 @@ +package com.huoran.nakadai.entity.app.param; + + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; + +/** + * @author lanhai + */ +@Data +public class OrderRefundParam { + + @ApiModelProperty(value = "订单编号" , required = true) + @NotEmpty(message = "订单编号不能为空") + private String orderNumber; + + @ApiModelProperty(value = "申请类型(1:仅退款 2退款退货)" , required = true) + @NotNull(message = "申请类型不能为空") + private Integer applyType; + + + @ApiModelProperty(value = "订单项id(全部退款是0)" , required = true) + @NotNull(message = "订单项id不能为空") + private Long orderItemId; + + + @ApiModelProperty(value = "凭证图片列表" , required = true) + private String photoFiles; + + @ApiModelProperty(value = "申请原因" , required = true) + @NotEmpty(message = "订单编号不能为空") + private String buyerMsg; + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/OrderShopParam.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/OrderShopParam.java new file mode 100644 index 0000000..0af30c8 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/OrderShopParam.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.param; + + +import io.swagger.annotations.ApiModelProperty; + +/** + * @author lanhai + */ +public class OrderShopParam { + + /** 店铺ID **/ + @ApiModelProperty(value = "店铺id" ,required=true) + private Long shopId; + + /** + * 订单备注信息 + */ + @ApiModelProperty(value = "订单备注信息" ,required=true) + private String remarks; + + public Long getShopId() { + return shopId; + } + + public void setShopId(Long shopId) { + this.shopId = shopId; + } + + public String getRemarks() { + return remarks; + } + + public void setRemarks(String remarks) { + this.remarks = remarks; + } + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/PayParam.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/PayParam.java new file mode 100644 index 0000000..16d7b1a --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/PayParam.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.param; + + + +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + + +/** + * @author lanhai + */ +public class PayParam { + + /** + * 订单号 + */ + @NotBlank(message="订单号不能为空") + @ApiModelProperty(value = "订单号" ,required=true) + private String orderNumbers; + + /** + * 支付方式 + */ + @NotNull(message="支付方式不能为空") + @ApiModelProperty(value = "支付方式 (1:微信支付 2:支付宝)" ,required=true) + private Integer payType; + + public Integer getPayType() { + return payType; + } + + public void setPayType(Integer payType) { + this.payType = payType; + } + + public String getOrderNumbers() { + return orderNumbers; + } + + public void setOrderNumbers(String orderNumbers) { + this.orderNumbers = orderNumbers; + } + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/ProdCommParam.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/ProdCommParam.java new file mode 100644 index 0000000..7343307 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/ProdCommParam.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.param; + + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * @author lanhai + */ +@Data +public class ProdCommParam { + /** + * 商品ID + */ + @ApiModelProperty(value = "商品id" ) + private Integer prodId; + /** + * 订单项ID + */ + @ApiModelProperty(value = "订单项ID" ) + private Long orderItemId; + + /** + * 评价,0-5分 + */ + @ApiModelProperty(value = "评价,0-5分" ,required=true) + @NotNull(message = "评价不能为空") + private Integer score; + + @ApiModelProperty(value = "评论内容" ,required=true) + private String content; + + @ApiModelProperty(value = "评论图片, 用逗号分隔" ) + private String pics; + + /** + * 是否匿名(1:是 0:否) + */ + @ApiModelProperty(value = "是否匿名(1:是 0:否) 默认为否" ) + private Integer isAnonymous; + + + @ApiModelProperty(value = "* 评价(0好评 1中评 2差评)" ) + private Integer evaluate; + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/SendSmsParam.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/SendSmsParam.java new file mode 100644 index 0000000..1651d6b --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/SendSmsParam.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.param; + +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.Pattern; + +/** + * @author lanhai + */ +public class SendSmsParam { + + @ApiModelProperty(value = "手机号" ) + @Pattern(regexp="1[0-9]{10}",message = "请输入正确的手机号") + private String mobile; + + public String getMobile() { + return mobile; + } + + public void setMobile(String mobile) { + this.mobile = mobile; + } + + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/ShopCartParam.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/ShopCartParam.java new file mode 100644 index 0000000..741cec3 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/ShopCartParam.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.param; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author lanhai + */ +@Data +public class ShopCartParam { + + @ApiModelProperty(value = "购物项id" ) + private Long basketId; + + @ApiModelProperty(value = "活动id,传0则不参与该活动" ) + private Long discountId; +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/ShopCartParams.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/ShopCartParams.java new file mode 100644 index 0000000..ab15931 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/ShopCartParams.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.param; + +import lombok.Data; + +import java.util.List; + +/** + * @author lanhai + */ +@Data +public class ShopCartParams { + List shopCartParams; +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/SubmitOrderParam.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/SubmitOrderParam.java new file mode 100644 index 0000000..66329d8 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/SubmitOrderParam.java @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.param; + + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * @author lanhai + */ +@Data +public class SubmitOrderParam { + @ApiModelProperty(value = "每个店铺提交的订单信息" ,required=true) + private List orderShopParam; +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/UserInfoParam.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/UserInfoParam.java new file mode 100644 index 0000000..597aa67 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/UserInfoParam.java @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.app.param; + +import lombok.Data; +/** + * @author lanhai + */ +@Data +public class UserInfoParam { + + private String nickName; + + private String avatarUrl; + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/distribution/UserShoppingDataDto.java b/nakadai/src/main/java/com/huoran/nakadai/entity/distribution/UserShoppingDataDto.java new file mode 100644 index 0000000..984b934 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/distribution/UserShoppingDataDto.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.distribution; + +import lombok.Data; + + +/** + * 用户购物数据 + * @author lanhai + */ +@Data +public class UserShoppingDataDto { + + /** + * 用户消费笔数 + */ + private Double expenseNumber; + + /** + * 用户消费金额 + */ + private Double sumOfConsumption; +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/dto/ProductDto.java b/nakadai/src/main/java/com/huoran/nakadai/entity/dto/ProductDto.java new file mode 100644 index 0000000..c5d5817 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/dto/ProductDto.java @@ -0,0 +1,190 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.dto; + +import com.huoran.nakadai.entity.model.Sku; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * @author lanhai + */ +@Data +public class ProductDto { + /** + * 商品ID + */ + private Integer prodId; + + /** + * 店铺id + */ + private Long shopId; + + /** + * 店铺名称 + */ + private String shopName; + + /** + * 版本号 + */ + private Integer version; + + /** + * 商品名称 + */ + private String prodName; + + /** + * 原价 + */ + private Double oriPrice; + + /** + * 现价 + */ + private Double price; + + /** + * 简要描述,卖点等 + */ + private String brief; + + /** + * 商品主图 + */ + private String pic; + + /** + * 商品图片 + */ + private String imgs; + + + /** + * 默认是1,表示正常状态 + */ + private Integer status; + + /** + * 商品分类 + */ + private Long categoryId; + + /** + * 观看人数 + */ + private Integer views; + + /** + * 已经销售数量 + */ + private Integer buys; + + /** + * 评论数 + */ + private Integer comments; + + /** + * 评论得分 + */ + private Integer commentScore; + + /** + * 库存量 + */ + private Integer stocks; + + /** + * 实际库存 + */ + private Integer actualStocks; + + /** + * 库存警告 + */ + private Integer stocksArm; + + /** + * 关键字 + */ + private String keyWord; + + /** + * 是否包含用户自提 + */ + private Integer hasUserPickUp; + + /** + * 是否包含商家配送 + */ + private Integer hasShopDelivery; + + /** + * 运费模板id + */ + private Long transportId; + + /** + * 有没发票 + */ + private Integer hasInvoice; + + /** + * 是否保修 + */ + private Integer hasGuarantee; + + /** + * 商品SEOTitle + */ + private String metaTitle; + + /** + * 商品SEO desc + */ + private String metaDesc; + + /** + * 商品SEO keywords + */ + private String metaKeywords; + + /** + * 录入时间 + */ + private Date recTime; + + /** + * 修改时间 + */ + private Date modifyTime; + + /** + * 详细描述 + */ + private String content; + + /** + * sku列表 + */ + private List skuList; + + /** + * 商品分类名称 + */ + private String categoryName; + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/dto/SearchProdDto.java b/nakadai/src/main/java/com/huoran/nakadai/entity/dto/SearchProdDto.java new file mode 100644 index 0000000..117a636 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/dto/SearchProdDto.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.dto; + +import lombok.Data; + +/** + * @author lanhai + */ +@Data +//@Schema(description = "搜索商品数据") +public class SearchProdDto { + +// @Schema(description = "商品id" ) + private Integer prodId; + +// @Schema(description = "商品照片" ) + private String pic; + +// @Schema(description = "商品名字" ) + private String prodName; + +// @Schema(description = "商品价格" ) + private Double price; + +// @Schema(description = "商品评论数量" ) + private Integer prodCommNumber; + +// @Schema(description = "好评率" ) + private Double positiveRating; + +// @Schema(description = "好评数量" ) + private Integer praiseNumber; + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/dto/TinymceEditorDto.java b/nakadai/src/main/java/com/huoran/nakadai/entity/dto/TinymceEditorDto.java new file mode 100644 index 0000000..dd4e5d0 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/dto/TinymceEditorDto.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.dto; + +/** + * 富文本编辑器 图片上传返回数据 + * @author lgh + */ +public class TinymceEditorDto { + + private Boolean error = false; + + private String path; + + public Boolean getError() { + return error; + } + + public void setError(Boolean error) { + this.error = error; + } + + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/enums/AreaLevelEnum.java b/nakadai/src/main/java/com/huoran/nakadai/entity/enums/AreaLevelEnum.java new file mode 100644 index 0000000..cfcd3c4 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/enums/AreaLevelEnum.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ +package com.huoran.nakadai.entity.enums; + +/** + * 地区层级 + * @author cl + */ +public enum AreaLevelEnum { + + + /** + * 第一层 + */ + FIRST_LEVEL(1), + + /** + * 第二层 + */ + SECOND_LEVEL(2), + + /** + * 第三层 + */ + THIRD_LEVEL(3) + + ; + + private Integer num; + + public Integer value() { + return num; + } + + AreaLevelEnum(Integer num) { + this.num = num; + } + + public static AreaLevelEnum instance(Integer value) { + AreaLevelEnum[] enums = values(); + for (AreaLevelEnum statusEnum : enums) { + if (statusEnum.value().equals(value)) { + return statusEnum; + } + } + return null; + } +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/enums/MessageStatus.java b/nakadai/src/main/java/com/huoran/nakadai/entity/enums/MessageStatus.java new file mode 100644 index 0000000..7a238ae --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/enums/MessageStatus.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.enums; + +/** + * @author lanhai + */ +public enum MessageStatus { + + /** + * 小程序 + */ + CANCEL(0), + RELEASE(1); + + private Integer num; + + public Integer value() { + return num; + } + + MessageStatus(Integer num){ + this.num = num; + } +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/enums/OrderEntry.java b/nakadai/src/main/java/com/huoran/nakadai/entity/enums/OrderEntry.java new file mode 100644 index 0000000..473ac13 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/enums/OrderEntry.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.enums; + +/** + * 订单入口 + * @author LGH + */ +public enum OrderEntry { + + /** + * 立即购买 + */ + BUY_NOW, + + /** + * 购物车 + */ + SHOP_CART +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/enums/OrderStatus.java b/nakadai/src/main/java/com/huoran/nakadai/entity/enums/OrderStatus.java new file mode 100644 index 0000000..19aaaba --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/enums/OrderStatus.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.enums; + +/** + * @author lanhai + */ +public enum OrderStatus { + + /** + * 没有付款.待付款 + */ + UNPAY(1), + + /** + * 已经付款,但卖家没有发货.待发货 + */ + PADYED(2), + + /** + * 发货,导致实际库存减少,没有确认收货.待收货 + */ + CONSIGNMENT(3), + + /** + * 收货,没有评价.待评价 + */ + CONFIRM(4), + + /** + * 评价后交易成功,购买数增加1. + */ + SUCCESS(5), + + /** + * 交易失败.,还原库存 + */ + CLOSE(6); + + private Integer num; + + public Integer value() { + return num; + } + + OrderStatus(Integer num) { + this.num = num; + } + + public static OrderStatus instance(Integer value) { + OrderStatus[] enums = values(); + for (OrderStatus statusEnum : enums) { + if (statusEnum.value().equals(value)) { + return statusEnum; + } + } + return null; + } +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/enums/PayType.java b/nakadai/src/main/java/com/huoran/nakadai/entity/enums/PayType.java new file mode 100644 index 0000000..c35467c --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/enums/PayType.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.enums; + +/** + * @author lanhai + */ +public enum PayType { + + /** 微信支付*/ + WECHATPAY(1,"微信支付"), + + /** "支付宝*/ + ALIPAY(2,"支付宝"); + + private Integer num; + + private String payTypeName; + + public Integer value() { + return num; + } + + public String getPayTypeName() { + return payTypeName; + } + + PayType(Integer num,String payTypeName){ + this.num = num; + this.payTypeName = payTypeName; + } + + public static PayType instance(Integer value) { + PayType[] enums = values(); + for (PayType statusEnum : enums) { + if (statusEnum.value().equals(value)) { + return statusEnum; + } + } + return null; + } +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/enums/ProdPropRule.java b/nakadai/src/main/java/com/huoran/nakadai/entity/enums/ProdPropRule.java new file mode 100644 index 0000000..69d24b0 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/enums/ProdPropRule.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.enums; + +/** + * 商品规格参数、属性类型 + * @author lgh + */ +public enum ProdPropRule { + + // 规格属性 (用于商品商品发布时,关联sku) + SPEC(1), + + // 规格参数(用于商品搜索时,与分类关联搜索) + ATTRIBUTE(2); + + private Integer num; + + public Integer value() { + return num; + } + + ProdPropRule(Integer num){ + this.num = num; + } + + public static ProdPropRule instance(Integer value) { + ProdPropRule[] enums = values(); + for (ProdPropRule statusEnum : enums) { + if (statusEnum.value().equals(value)) { + return statusEnum; + } + } + return null; + } +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/enums/SendType.java b/nakadai/src/main/java/com/huoran/nakadai/entity/enums/SendType.java new file mode 100644 index 0000000..1e673b1 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/enums/SendType.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ +package com.huoran.nakadai.entity.enums; + +/** + * @author lh + */ +public enum SendType { + /** + * 用户注册验证码 + */ + REGISTER(12, 1,"用户注册验证码"), + /** + * 发送登录验证码 + */ + LOGIN(13, 1,"发送登录验证码"), + /** + * 修改密码验证码 + */ + UPDATE_PASSWORD(14, 1,"修改密码验证码"), + /** + * 身份验证验证码 + */ + VALID(15, 1,"身份验证验证码") + ; + + private Integer value; + /** + * 1为全部平台发送的消息,2为根据情况 + */ + private Integer type; + private String desc; + SendType(Integer value, Integer type, String desc) { + this.value = value; + this.type = type; + this.desc = desc; + } + public Integer getValue() { + return value; + } + + public String getDesc() { + return desc; + } + + public static SendType instance(Integer value) { + SendType[] enums = values(); + for (SendType statusEnum : enums) { + if (statusEnum.getValue().equals(value)) { + return statusEnum; + } + } + return null; + } + + public Integer getType() { + return type; + } +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/enums/SmsType.java b/nakadai/src/main/java/com/huoran/nakadai/entity/enums/SmsType.java new file mode 100644 index 0000000..fdddfe3 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/enums/SmsType.java @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.enums; + +/** + * @author lanhai + */ +public enum SmsType { + + /** + *发送验证码 + */ + VALID(0,"SMS_152288010","感谢您对xxx的支持。您的验证码是${code},请勿把验证码泄漏给第三方。"), + + /** + * 商品库存不足通知 + */ + STOCKS_ARM(1,"SMS_152288054","尊敬的${name},感谢您对xxx的支持。您的${prodName}库存仅剩${num},为免影响您的客户下单,请及时补货!"), + + /** + * 行业客户审核通过通知 + */ + DISTRIBUTOR_PASS_AUDIT(2,"SMS_152283207","尊敬的${name},感谢您对xxx的支持。您提交的资料已审核通过!祝您购物愉快!"), + + /** + * 分销商订单购买成功通知 + */ + DISTRIBUTOR_BUY_SUCCESS(3,"SMS_152283148","尊敬的${name},感谢您对xxx的支持。您的订单${orderNumber}已确认成功,我们会尽快发货!"), + + /** + * 用户发货通知 + */ + NOTIFY_DVY(4,"SMS_152283152","尊敬的${name},感谢您对xxx的支持。您的订单${orderNumber}已通过${dvyName}发货,快递单号是:${dvyFlowId}。请注意查收。"), + + /** + * 代理商审核通知 + */ + AGENT_PASS_AUDIT(5,"SMS_152288028","尊敬的${name},感谢您对xxx的支持。您提交的代理商申请已审核通过!请重新登陆获取新的会员信息。"), + + /** + * 代理商商品被购买通知 + */ + NOTIFY_BUY(6,"SMS_152288372","尊敬的${name},感谢您对xxx的支持。与您有关联的订单${orderNumber}已生成,客户${buyerName},提货${prodName},数量${buyNum},剩余库存为${stockNum}。"), + + /** + * 代理商新增分销商通知 + */ + ADD_DISTRIBUTOR(7,"SMS_152283192","尊敬的${name},感谢您对xxx的支持。您有新增绑定客户资料生成:客户${userName},联系方式${mobilePhone},联系地址${addr},合计共有客户${number}名。"), + + /** + * 代理商解除与分销商合作通知 + */ + UNBINDING(8,"SMS_152283198","尊敬的${name},感谢您对xxx的支持。您已成功解除与此客户的绑定关系:客户${userName},联系方式${mobilePhone},联系地址${addr},现合计共有客户${number}名。"), + + /** + * 代理商补货订单模板 + */ + AGENT_BUY_SUCCESS(9,"SMS_152288475","尊敬的${name},感谢您对xxx的支持。您的补货订单${orderNumber}已完成入库,${prodName}剩余库存为${stockNum}。"), + + /** + * 普通用户下单成功通知 + */ + USER_BUY_SUCCESS(10,"SMS_152288329","亲爱的客户,感谢您对xxx的支持。您的订单${orderNumber}已支付成功。我们会尽快发货!") + + ; + + private Integer num; + + private String templateCode; + + private String content; + public Integer value() { + return num; + } + + SmsType(Integer num,String templateCode,String content){ + this.num = num; + this.templateCode = templateCode; + this.content = content; + } + + public static SmsType instance(Integer value) { + SmsType[] enums = values(); + for (SmsType statusEnum : enums) { + if (statusEnum.value().equals(value)) { + return statusEnum; + } + } + return null; + } + + public String getTemplateCode() { + return this.templateCode; + } + + public String getContent() { + return this.content; + } +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/enums/TransportChargeType.java b/nakadai/src/main/java/com/huoran/nakadai/entity/enums/TransportChargeType.java new file mode 100644 index 0000000..12d45ca --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/enums/TransportChargeType.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.enums; + + +/** + * 运费收费方式 (0 按件数,1 按重量 2 按体积) + * @author LGH + */ +public enum TransportChargeType { + + /** + * 0全部商品参与 + */ + COUNT(0), + + /** + * 1指定商品参与 + */ + WEIGHT(1), + + /** + * 2指定商品不参与 + */ + VOLUME(2) + ; + + private Integer num; + + public Integer value() { + return num; + } + + TransportChargeType(Integer num){ + this.num = num; + } + + public static TransportChargeType instance(Integer value) { + TransportChargeType[] enums = values(); + for (TransportChargeType statusEnum : enums) { + if (statusEnum.value().equals(value)) { + return statusEnum; + } + } + return null; + } +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/model/Area.java b/nakadai/src/main/java/com/huoran/nakadai/entity/model/Area.java new file mode 100644 index 0000000..cfc8a1a --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/model/Area.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.model; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author lanhai + */ +@Data +@TableName("tz_area") +public class Area implements Serializable { + private static final long serialVersionUID = -6013320537436191451L; + @TableId + @ApiModelProperty(value = "地区id" ,required=true) + private Long areaId; + + @ApiModelProperty(value = "地区名称" ,required=true) + private String areaName; + + @ApiModelProperty(value = "地区上级id" ,required=true) + private Long parentId; + + @ApiModelProperty(value = "地区层级" ,required=true) + private Integer level; + + @TableField(exist=false) + private List areas; +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/model/AttachFile.java b/nakadai/src/main/java/com/huoran/nakadai/entity/model/AttachFile.java new file mode 100644 index 0000000..93260b5 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/model/AttachFile.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.model; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author lanhai + */ +@Data +@TableName("tz_attach_file") +public class AttachFile implements Serializable { + @TableId + + private Long fileId; + + /** + * 文件路径 + */ + + private String filePath; + + /** + * 文件类型 + */ + + private String fileType; + + /** + * 文件大小 + */ + + private Integer fileSize; + + /** + * 上传时间 + */ + + private Date uploadTime; + + /** + * 文件关联的表主键id + */ + + private Long fileJoinId; + + /** + * 文件关联表类型:1 商品表 @see FileJoinType + */ + + private Integer fileJoinType; +} \ No newline at end of file diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/model/Basket.java b/nakadai/src/main/java/com/huoran/nakadai/entity/model/Basket.java new file mode 100644 index 0000000..b0d2323 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/model/Basket.java @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.model; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author lanhai + */ +@Data +@TableName("tz_basket") +public class Basket implements Serializable { + /** + * 主键 + */ + @TableId + + private Long basketId; + + /** + * 店铺ID + */ + + private Long shopId; + + /** + * 产品ID + */ + + private Integer prodId; + + /** + * SkuID + */ + + private Integer skuId; + + /** + * 用户ID + */ + + private String userId; + + /** + * 购物车产品个数 + */ + + private Integer basketCount; + + /** + * 购物时间 + */ + + private Date basketDate; + + /** + * 满减活动ID + */ + private Long discountId; + + /** + * 分销推广人卡号 + */ + private String distributionCardNo; +} \ No newline at end of file diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/model/Brand.java b/nakadai/src/main/java/com/huoran/nakadai/entity/model/Brand.java new file mode 100644 index 0000000..d2552f1 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/model/Brand.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.model; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author lanhai + */ +@Data +@TableName("tz_brand") +public class Brand implements Serializable { + /** + * 主键 + */ + @TableId + + private Long brandId; + + /** + * 品牌名称 + */ + + private String brandName; + + /** + * 图片路径 + */ + + private String brandPic; + + /** + * 用户ID + */ + + private String userId; + + /** + * 备注 + */ + private String memo; + + /** + * 顺序 + */ + private Integer seq; + + /** + * 默认是1,表示正常状态,0为下线状态 + */ + private Integer status; + + /** + * 简要描述 + */ + private String brief; + + /** + * 记录时间 + */ + + private Date recTime; + + /** + * 更新时间 + */ + + private Date updateTime; + + /** + * 品牌首字母 + */ + + private String firstChar; + + /** + * 内容 + */ + private String content; +} \ No newline at end of file diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/model/Category.java b/nakadai/src/main/java/com/huoran/nakadai/entity/model/Category.java new file mode 100644 index 0000000..9b9a4da --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/model/Category.java @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.model; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * @author lanhai + */ +@Data +@TableName("tz_category") +public class Category implements Serializable { + + /** + * 类目ID + * + */ + @TableId(type = IdType.AUTO) + private Long categoryId; + + /** + * 店铺id + */ + private Integer shopId; + + /** + * 父节点 + */ + private Long parentId = 0L; + + /** + * 产品类目名称 + */ + private String categoryName; + + /** + * 类目图标 + */ + private String icon; + + /** + * 类目的显示图片 + */ + private String pic; + + /** + * 排序 + */ + private Integer seq; + + /** + * 默认是1,表示正常状态,0为下线状态 + */ + private Integer status; + + /** + * 记录时间 + */ + private Date recTime; + + /** + * 分类层级 + */ + private Integer grade; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 品牌id + */ + @TableField(exist=false) + private List brandIds; + + /** + * 参数id + */ + @TableField(exist=false) + private List attributeIds; + + /** + * 品牌列表 + */ + @TableField(exist=false) + private List brands; + + /** + * 参数列表 + */ + @TableField(exist=false) + private List prodProps; + + /** + * 商品列表 + */ + @TableField(exist=false) + private List products; + + @TableField(exist=false) + private List categories; +} \ No newline at end of file diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/model/CategoryBrand.java b/nakadai/src/main/java/com/huoran/nakadai/entity/model/CategoryBrand.java new file mode 100644 index 0000000..aac343d --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/model/CategoryBrand.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.model; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author lanhai + */ +@Data +@TableName("tz_category_brand") +public class CategoryBrand implements Serializable { + @TableId + + private Long id; + + /** + * 分类id + */ + + private Long categoryId; + + /** + * 品牌id + */ + + private Long brandId; +} \ No newline at end of file diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/model/CategoryProp.java b/nakadai/src/main/java/com/huoran/nakadai/entity/model/CategoryProp.java new file mode 100644 index 0000000..339c975 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/model/CategoryProp.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.model; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author lanhai + */ +@Data +@TableName("tz_category_prop") +public class CategoryProp implements Serializable { + @TableId + + private Long id; + + /** + * 分类id + */ + + private Long categoryId; + + /** + * 商品属性id即表tz_prod_prop中的prop_id + */ + + private Integer propId; +} \ No newline at end of file diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/model/Delivery.java b/nakadai/src/main/java/com/huoran/nakadai/entity/model/Delivery.java new file mode 100644 index 0000000..755f365 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/model/Delivery.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.model; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author lanhai + */ +@Data +@TableName("tz_delivery") +public class Delivery implements Serializable { + /** + * ID + */ + @TableId + + private Long dvyId; + + /** + * 物流公司名称 + */ + + private String dvyName; + + /** + * 公司主页 + */ + + private String companyHomeUrl; + + /** + * 建立时间 + */ + + private Date recTime; + + /** + * 修改时间 + */ + + private Date modifyTime; + + /** + * 物流查询接口 + */ + + private String queryUrl; +} \ No newline at end of file diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/model/HotSearch.java b/nakadai/src/main/java/com/huoran/nakadai/entity/model/HotSearch.java new file mode 100644 index 0000000..99d44c7 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/model/HotSearch.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.model; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author lanhai + */ +@Data +@TableName("tz_hot_search") +public class HotSearch implements Serializable { + /** + * 主键 + */ + @TableId + private Long hotSearchId; + + /** + * 店铺id + */ + private Long shopId; + + /** + * 标题 + */ + private String title; + + /** + * 内容 + */ + private String content; + + /** + * 录入时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date recDate; + + /** + * 顺序 + */ + private Integer seq; + + /** + * 状态 默认是1,0为下线 + */ + private Integer status; + +} \ No newline at end of file diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/model/IndexImg.java b/nakadai/src/main/java/com/huoran/nakadai/entity/model/IndexImg.java new file mode 100644 index 0000000..a75fec4 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/model/IndexImg.java @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.model; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author lanhai + */ +@Data +@TableName("tz_index_img") +public class IndexImg implements Serializable { + private static final long serialVersionUID = -3468251351681518798L; + /** + * 主键 + */ + @TableId + + private Long imgId; + + /** + * 店铺ID + */ + + private Long shopId; + + /** + * 图片 + */ + private String imgUrl; + + /** + * 说明文字,描述 + */ + private String des; + + /** + * 标题 + */ + private String title; + + /** + * 链接 + */ + private String link; + + /** + * 状态 + */ + private Integer status; + + /** + * 顺序 + */ + private Integer seq; + + /** + * 上传时间 + */ + private Date uploadTime; + + /** + * 类型 + */ + private int type; + + /** + * 关联id + */ + private Long relation; + + /** + * 商品图片 + */ + @TableField(exist = false) + private String pic; + + /** + * 商品名称 + */ + @TableField(exist = false) + private String prodName; + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/model/Message.java b/nakadai/src/main/java/com/huoran/nakadai/entity/model/Message.java new file mode 100644 index 0000000..49a9d43 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/model/Message.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.model; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author lanhai + */ +@Data +@TableName("tz_message") +public class Message implements Serializable { + @TableId + private Long id; + + /** + * 留言创建时间 + */ + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date createTime; + + /** + * 姓名 + */ + private String userName; + + /** + * 邮箱 + */ + private String email; + + /** + * 联系方式 + */ + private String contact; + + /** + * 状态:0:未审核 1审核通过 + */ + private Integer status; + + /** + * 留言内容 + */ + private String content; + + /** + * 留言回复 + */ + private String reply; + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/model/Notice.java b/nakadai/src/main/java/com/huoran/nakadai/entity/model/Notice.java new file mode 100644 index 0000000..168a7dd --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/model/Notice.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.model; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + +/** + * 公告管理 + * + * @author hzm + * @date 2019-04-18 21:21:40 + */ +@Data +@TableName("tz_notice") +public class Notice implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 公告id + */ + @TableId + private Long id; + + /** + * 店铺id + */ + private Long shopId; + + /** + * 公告标题 + */ + private String title; + + /** + * 公告内容 + */ + private String content; + + /** + * 状态(1:公布 0:撤回) + */ + private Integer status; + + /** + * 是否置顶(1:是 0:否) + */ + private Integer isTop; + + /** + * 发布时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date publishTime; + + /** + * 更新时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/model/Order.java b/nakadai/src/main/java/com/huoran/nakadai/entity/model/Order.java new file mode 100644 index 0000000..59ba124 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/model/Order.java @@ -0,0 +1,194 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.model; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * @author lanhai + */ +@Data +@TableName("tz_order") +public class Order implements Serializable { + private static final long serialVersionUID = 6222259729062826852L; + /** + * 订单ID + */ + @TableId(type = IdType.AUTO) + private Long orderId; + + /** + * 店铺id + */ + private Integer shopId; + + /** + * 产品名称,多个产品将会以逗号隔开 + */ + private String prodName; + + /** + * 订购用户ID + */ + private String userId; + + /** + * 订购流水号 + */ + private String orderNumber; + + /** + * 总值 + */ + private Double total; + + /** + * 实际总值 + */ + private Double actualTotal; + + /** + * 支付方式 1 微信支付 2 支付宝 + */ + private Integer payType; + + /** + * 订单备注 + */ + private String remarks; + + /** + * 订单状态 -1 已取消 0:待付款 1:待发货 2:待收货 3:已完成 + */ + private Integer status; + + /** + * 配送类型 + */ + + private String dvyType; + + /** + * 配送方式ID + */ + + private Long dvyId; + + /** + * 物流单号 + */ + + private String dvyFlowId; + + /** + * 订单运费 + */ + + private Double freightAmount; + + /** + * 用户订单地址Id + */ + + private Long addrOrderId; + + /** + * 订单商品总数 + */ + + private Integer productNums; + + /** + * 订购时间 + */ + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + /** + * 订单更新时间 + */ + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + /** + * 付款时间 + */ + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date payTime; + + /** + * 发货时间 + */ + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date dvyTime; + + /** + * 完成时间 + */ + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date finallyTime; + + /** + * 取消时间 + */ + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date cancelTime; + + /** + * 是否已经支付,1:已经支付过,0:,没有支付过 + */ + private Integer isPayed; + + /** + * 用户订单删除状态,0:没有删除, 1:回收站, 2:永久删除 + */ + private Integer deleteStatus; + + /** + * 0:默认,1:在处理,2:处理完成 + */ + private Integer refundSts; + + /** + * 优惠总额 + */ + private Double reduceAmount; + + /** + * 店铺名称 + */ + @TableField(exist = false) + private String shopName; + + @TableField(exist = false) + private List orderItems; + + /** + * 用户订单地址 + */ + @TableField(exist = false) + private UserAddrOrder userAddrOrder; +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/model/OrderItem.java b/nakadai/src/main/java/com/huoran/nakadai/entity/model/OrderItem.java new file mode 100644 index 0000000..3afead7 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/model/OrderItem.java @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.model; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author lanhai + */ +@Data +@TableName("tz_order_item") +public class OrderItem implements Serializable { + + private static final long serialVersionUID = 7307405761190788407L; + /** + * 订单项ID + */ + @TableId(type = IdType.AUTO) + private Long orderItemId; + + + private Integer shopId; + + /** + * 订单sub_number + */ + + private String orderNumber; + + /** + * 产品ID + */ + + private Integer prodId; + + /** + * 产品SkuID + */ + + private Integer skuId; + + /** + * 购物车产品个数 + */ + + private Integer prodCount; + + /** + * 产品名称 + */ + + private String prodName; + + /** + * sku名称 + */ + private String skuName; + + /** + * 产品主图片路径 + */ + private String pic; + + /** + * 产品价格 + */ + private Double price; + + /** + * 用户Id + */ + + private String userId; + + /** + * 商品总金额 + */ + private Double productTotalAmount; + + /** + * 购物时间 + */ + + private Date recTime; + + /** + * 评论状态: 0 未评价 1 已评价 + */ + + private Integer commSts; + + /** + * 推广员使用的推销卡号 + */ + private String distributionCardNo; + + /** + * 加入购物车的时间 + */ + private Date basketDate; +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/model/OrderRefund.java b/nakadai/src/main/java/com/huoran/nakadai/entity/model/OrderRefund.java new file mode 100644 index 0000000..5869b8e --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/model/OrderRefund.java @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.model; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * @author lanhai + */ +@Data +@TableName("tz_order_refund") +public class OrderRefund implements Serializable { + /** + * 记录ID + */ + @TableId + private Long refundId; + + /** + * shopId + */ + private Long shopId; + + /** + * 订单ID + */ + private Long orderId; + + /** + * 订单流水号 + */ + + private String orderNumber; + + /** + * 订单总金额 + */ + + private Double orderAmount; + + /** + * 订单项ID 全部退款是0 + */ + + private Long orderItemId; + + /** + * 退款编号 + */ + + private String refundSn; + + /** + * 订单支付流水号 + */ + + private String flowTradeNo; + + /** + * 第三方退款单号(微信退款单号) + */ + + private String outRefundNo; + + /** + * 订单支付方式 1 微信支付 2 支付宝 + */ + + private Integer payType; + + /** + * 订单支付名称 + */ + + private String payTypeName; + + /** + * 买家ID + */ + + private String userId; + + /** + * 退货数量 + */ + + private Integer goodsNum; + + /** + * 退款金额 + */ + + private Double refundAmount; + + /** + * 申请类型:1,仅退款,2退款退货 + */ + + private Integer applyType; + + /** + * 处理状态:1为待审核,2为同意,3为不同意 + */ + + private Integer refundSts; + + /** + * 处理退款状态: 0:退款处理中 1:退款成功 -1:退款失败 + */ + + private Integer returnMoneySts; + + /** + * 申请时间 + */ + + private Date applyTime; + + /** + * 卖家处理时间 + */ + + private Date handelTime; + + /** + * 退款时间 + */ + + private Date refundTime; + + /** + * 文件凭证json + */ + + private String photoFiles; + + /** + * 申请原因 + */ + + private String buyerMsg; + + /** + * 卖家备注 + */ + + private String sellerMsg; + + /** + * 物流公司名称 + */ + private String expressName; + + /** + * 物流单号 + */ + + private String expressNo; + + /** + * 发货时间 + */ + + private Date shipTime; + + /** + * 收货时间 + */ + + private Date receiveTime; + + /** + * 收货备注 + */ + + private String receiveMessage; + + /** + * 拒绝原因 + */ + private String rejectMessage; + + /** + * 订单列表 + */ + @TableField(exist = false) + private List orderItems; +} \ No newline at end of file diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/model/OrderSettlement.java b/nakadai/src/main/java/com/huoran/nakadai/entity/model/OrderSettlement.java new file mode 100644 index 0000000..1717562 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/model/OrderSettlement.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.model; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author lanhai + */ +@Data +@TableName("tz_order_settlement") +public class OrderSettlement implements Serializable { + /** + * 支付结算单据ID + */ + @TableId + + private Long settlementId; + + /** + * 用户系统内部的订单号 + */ + private String payNo; + + /** + * 外部订单流水号 + */ + private String bizPayNo; + + /** + * 订单号 + */ + private String orderNumber; + + /** + * 支付方式 0 手动代付 1 微信支付 2 支付宝 + */ + + private Integer payType; + + /** + * 支付金额 + */ + private Double payAmount; + + /** + * 用户ID + */ + + private String userId; + + /** + * 是否清算 0:否 1:是 + */ + + private Integer isClearing; + + /** + * 创建时间 + */ + + private Date createTime; + + /** + * 清算时间 + */ + + private Date clearingTime; + + /** + * 支付状态 + */ + private Integer payStatus; + + /** + * 版本号 + */ + private Integer version; + +} \ No newline at end of file diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/model/PickAddr.java b/nakadai/src/main/java/com/huoran/nakadai/entity/model/PickAddr.java new file mode 100644 index 0000000..7be80d4 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/model/PickAddr.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.model; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author lanhai + */ +@Data +@TableName("tz_pick_addr") +public class PickAddr implements Serializable { + /** + * ID + */ + @TableId + private Long addrId; + + /** + * 自提点名称 + */ + + private String addrName; + + /** + * 地址 + */ + private String addr; + + /** + * 手机 + */ + private String mobile; + + /** + * 省份ID + */ + private Long provinceId; + + /** + * 省份 + */ + private String province; + + /** + * 城市ID + */ + private Long cityId; + + /** + * 城市 + */ + private String city; + + /** + * 区/县ID + */ + private Long areaId; + + /** + * 区 + */ + private String area; + + /** + * 店铺id + */ + private Integer shopId; + +} \ No newline at end of file diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/model/ProdComm.java b/nakadai/src/main/java/com/huoran/nakadai/entity/model/ProdComm.java new file mode 100644 index 0000000..6b23d71 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/model/ProdComm.java @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.model; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.huoran.nakadai.entity.vo.UserVO; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + +/** + * 商品评论 + * + * @author xwc + * @date 2019-04-19 10:43:57 + */ +@Data +@TableName("tz_prod_comm") +@EqualsAndHashCode +public class ProdComm implements Serializable{ + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @TableId + private Long prodCommId; + /** + * 商品ID + */ + private Integer prodId; + /** + * 订单项ID + */ + private Long orderItemId; + /** + * 评论用户ID + */ + private String userId; + /** + * 评论内容 + */ + private String content; + /** + * 掌柜回复 + */ + private String replyContent; + /** + * 记录时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date recTime; + /** + * 回复时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date replyTime; + /** + * 是否回复 0:未回复 1:已回复 + */ + private Integer replySts; + /** + * IP来源 + */ + private String postip; + /** + * 得分,0-5分 + */ + private Integer score; + /** + * 有用的计数 + */ + private Integer usefulCounts; + /** + * 晒图的字符串 以逗号分隔 + */ + private String pics; + /** + * 是否匿名(1:是 0:否) + */ + private Integer isAnonymous; + /** + * 是否显示,1:为显示,0:待审核, -1:不通过审核,不显示。 如果需要审核评论,则是0,,否则1 + */ + private Integer status; + + /** + * 评价(0好评 1中评 2差评) + */ + private Integer evaluate; + + /** + * 关联用户 + */ + @TableField(exist = false) + private UserVO user; + + /** + * 商品名称 + */ + @TableField(exist = false) + private String prodName; +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/model/ProdImg.java b/nakadai/src/main/java/com/huoran/nakadai/entity/model/ProdImg.java new file mode 100644 index 0000000..fea93fd --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/model/ProdImg.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.model; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author lanhai + */ +@Data +@TableName("tz_prod_img") +public class ProdImg implements Serializable { + /** + * 图片ID + */ + @TableId + + private Long imgId; + + /** + * 产品ID + */ + + private Integer prodId; + + /** + * skuID(商品通用图片 skuid为0) + */ + + private Integer skuId; + + /** + * 文件路径 + */ + + private String imgPath; + + /** + * 状态 + */ + private Byte status; + + /** + * 顺序 + */ + private Integer seq; + +} \ No newline at end of file diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/model/ProdProp.java b/nakadai/src/main/java/com/huoran/nakadai/entity/model/ProdProp.java new file mode 100644 index 0000000..d159cb1 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/model/ProdProp.java @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.model; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import java.io.Serializable; +import java.util.List; + +/** + * @author lanhai + */ +@Data +@TableName("tz_prod_prop") +public class ProdProp implements Serializable { + private static final long serialVersionUID = -8761177918672000191L; + + /** + * 属性id + */ + @TableId(type = IdType.AUTO) + private Integer propId; + + /** + * 属性名称 + */ + @NotBlank(message = "属性名称不能为空") + private String propName; + + /** + * 1:销售属性(规格); 2:参数属性; + */ + private Integer rule; + + private Integer shopId; + + /** + * 属性值 + */ + @TableField(exist=false) + @NotEmpty(message="规格属性值不能为空") + private List prodPropValues; + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/model/ProdPropValue.java b/nakadai/src/main/java/com/huoran/nakadai/entity/model/ProdPropValue.java new file mode 100644 index 0000000..d7c6b00 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/model/ProdPropValue.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.model; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author lanhai + */ +@Data +@TableName("tz_prod_prop_value") +public class ProdPropValue implements Serializable{ + /** + * + */ + private static final long serialVersionUID = 6604406039354172708L; + + /** + * 属性值ID + */ + @TableId(type = IdType.AUTO) + private Long valueId; + + /** + * 属性值名称 + */ + + private String propValue; + + /** + * 属性ID + */ + + private Integer propId; + +} \ No newline at end of file diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/model/ProdTag.java b/nakadai/src/main/java/com/huoran/nakadai/entity/model/ProdTag.java new file mode 100644 index 0000000..8562571 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/model/ProdTag.java @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.model; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 商品分组标签 + * + * @author hzm + * @date 2019-04-18 10:48:44 + */ +@Data +@TableName("tz_prod_tag") +public class ProdTag implements Serializable { + + private static final long serialVersionUID = 1991508792679311621L; + /** + * 分组标签id + */ + @TableId(type = IdType.AUTO) + private Long id; + /** + * 分组标题 + */ + private String title; + /** + * 店铺Id + */ + private Integer shopId; + /** + * 状态(1为正常,0为删除) + */ + private Integer status; + /** + * 默认类型(0:商家自定义,1:系统默认类型) + */ + private Integer isDefault; + /** + * 商品数量 + */ + private Long prodCount; + /** + * 排序 + */ + private Integer seq; + /** + * 列表样式(0:一列一个,1:一列两个,2:一列三个) + */ + private Integer style; + /** + * 创建时间 + */ + private Date createTime; + /** + * 修改时间 + */ + private Date updateTime; + /** + * 删除时间 + */ + private Date deleteTime; + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/model/ProdTagReference.java b/nakadai/src/main/java/com/huoran/nakadai/entity/model/ProdTagReference.java new file mode 100644 index 0000000..f247da8 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/model/ProdTagReference.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.model; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 分组标签引用 + * + * @author hzm + * @date 2019-04-18 16:28:01 + */ +@Data +@TableName("tz_prod_tag_reference") +public class ProdTagReference implements Serializable{ + private static final long serialVersionUID = 1L; + + /** + * 分组引用id + */ + @TableId(type = IdType.AUTO) + private Long referenceId; + /** + * 店铺id + */ + private Long shopId; + /** + * 标签id + */ + private Long tagId; + /** + * 商品id + */ + private Integer prodId; + /** + * 状态(1:正常,0:删除) + */ + private Integer status; + /** + * 创建时间 + */ + private Date createTime; + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/model/Product.java b/nakadai/src/main/java/com/huoran/nakadai/entity/model/Product.java new file mode 100644 index 0000000..7ca8c40 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/model/Product.java @@ -0,0 +1,164 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.model; + +import com.baomidou.mybatisplus.annotation.*; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * @author lanhai + */ +@Data +@TableName("tz_prod") +public class Product implements Serializable { + + private static final long serialVersionUID = -4644407386444894349L; + /** + * 商品ID + */ + @TableId(type = IdType.AUTO) + @ApiModelProperty(value = "产品ID") + private Integer prodId; + + /** + * 店铺id + */ + @ApiModelProperty(value = "店铺id") + private Integer shopId; + + + @ApiModelProperty(value = "商品名称") + private String prodName; + + + /** + * 商品价格 + */ + @ApiModelProperty(value = "商品价格") + private Double price; + + /** + * 商品价格 + */ + @ApiModelProperty(value = "商品原价") + private Double oriPrice; + + /** + * 库存量 + */ + @ApiModelProperty(value = "库存量") + private Integer totalStocks; + + /** + * 简要描述,卖点等 + */ + @ApiModelProperty(value = "简要描述,卖点等") + private String brief; + + @ApiModelProperty(value = "商品主图") + private String pic; + + /** + * 商品图片 + */ + @ApiModelProperty(value = "商品图片") + private String imgs; + /** + * 默认是1,表示正常状态, -1表示删除, 0下架 + */ + @ApiModelProperty(value = "默认是1,表示上架, 2下架,3草稿,4审核,0为删除") + private Integer status; + + /** + * 商品分类 + */ + private Long categoryId; + + /** + * 已经销售数量 + */ + private Integer soldNum; + + /** + * 配送方式json + */ + private String deliveryMode; + + /** + * 运费模板id + */ + private Long deliveryTemplateId; + + /** + * 录入时间 + */ + private Date createTime; + + /** + * 修改时间 + */ + private Date updateTime; + + /** + * 详细描述 + */ + private String content; + + + /** + * 上架时间 + */ + private Date putawayTime; + + /** + * 版本 + */ + @Version + private Integer version; + + /** + * sku列表 + */ + @TableField(exist = false) + private List skuList; + + /** + * 店铺名称 + */ + @TableField(exist = false) + private String shopName; + + @TableField(exist = false) + private List tagList; + + + @Data + public static class DeliveryModeVO { + + /** + * 用户自提 + */ + private Boolean hasUserPickUp; + + /** + * 店铺配送 + */ + private Boolean hasShopDelivery; + + } +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/model/ShopDetail.java b/nakadai/src/main/java/com/huoran/nakadai/entity/model/ShopDetail.java new file mode 100644 index 0000000..02e49a6 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/model/ShopDetail.java @@ -0,0 +1,162 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.model; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author lanhai + */ +@Data +@TableName("tz_shop_detail") +public class ShopDetail implements Serializable{ + private static final long serialVersionUID = 3300529542917772262L; + /** + * 店铺id + */ + @TableId + private Integer shopId; + + /** + * 店铺名称(数字、中文,英文(可混合,不可有特殊字符),可修改)、不唯一 + */ + private String shopName; + + /** + * 店长用户id + */ + private String userId; + + /** + * 店铺类型 + */ + private Integer shopType; + + /** + * 店铺简介(可修改) + */ + private String intro; + + /** + * 店铺公告(可修改) + */ + private String shopNotice; + + /** + * 店铺行业(餐饮、生鲜果蔬、鲜花等) + */ + private Integer shopIndustry; + + /** + * 店长 + */ + private String shopOwner; + + /** + * 店铺绑定的手机(登录账号:唯一) + */ + private String mobile; + + /** + * 店铺联系电话 + */ + private String tel; + + /** + * 店铺所在纬度(可修改) + */ + private String shopLat; + + /** + * 店铺所在经度(可修改) + */ + private String shopLng; + + /** + * 店铺详细地址 + */ + private String shopAddress; + + /** + * 店铺所在省份(描述) + */ + private String province; + + /** + * 店铺所在城市(描述) + */ + private String city; + + /** + * 店铺所在区域(描述) + */ + private String area; + + /** + * 店铺省市区代码,用于回显 + */ + private String pcaCode; + + /** + * 店铺logo(可修改) + */ + private String shopLogo; + + /** + * 店铺相册 + */ + private String shopPhotos; + + /** + * 每天营业时间段(可修改) + */ + private String openTime; + + /** + * 店铺状态(-1:未开通 0: 停业中 1:营业中),可修改 + */ + private Integer shopStatus; + + /** + * 0:商家承担运费; 1:买家承担运费 + */ + private Integer transportType; + + /** + * 固定运费 + */ + private Double fixedFreight; + + /** + * 满X包邮 + */ + private Double fullFreeShipping; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 分销设置(0关闭 1开启) + */ + private Integer isDistribution; +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/model/Sku.java b/nakadai/src/main/java/com/huoran/nakadai/entity/model/Sku.java new file mode 100644 index 0000000..1aeb5cb --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/model/Sku.java @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.model; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author lanhai + */ +@Data +@TableName("tz_sku") +public class Sku implements Serializable { + /** + * 单品ID + */ + @TableId(type = IdType.AUTO) + @ApiModelProperty(value = "单品ID") + private Integer skuId; + + /** + * 商品ID + */ + @ApiModelProperty(value = "商品ID") + private Integer prodId; + + /** + * 销售属性组合字符串,格式是p1:v1;p2:v2 + */ + @ApiModelProperty(value = "销售属性组合字符串,格式是p1:v1;p2:v2") + private String properties; + + /** + * 原价 + */ + @ApiModelProperty(value = "原价") + private Double oriPrice; + + /** + * 价格 + */ + @ApiModelProperty(value = "价格") + private Double price; + + /** + * 库存 + */ + @ApiModelProperty(value = "库存") + private Integer stocks; + + /** + * 实际库存 + */ + @ApiModelProperty(value = "实际库存") + private Integer actualStocks; + + /** + * 修改时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "修改时间") + private Date updateTime; + + /** + * 记录时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "记录时间") + private Date recTime; + + /** + * 商家编码 + */ + @ApiModelProperty(value = "商家编码",hidden = true) + private String partyCode; + + /** + * 商品条形码 + */ + @ApiModelProperty(value = "商品条形码",hidden = true) + private String modelId; + + /** + * sku图片 + */ + @ApiModelProperty(value = "sku图片") + private String pic; + + /** + * sku名称 + */ + @ApiModelProperty(value = "sku名称") + private String skuName; + + /** + * 商品名称 + */ + @ApiModelProperty(value = "商品名称") + private String prodName; + + @ApiModelProperty(value = "版本号") + private Integer version; + + /** + * 重量 + */ + @ApiModelProperty(value = "重量",hidden = true) + private Double weight; + + /** + * 体积 + */ + @ApiModelProperty(value = "体积",hidden = true) + private Double volume; + + /** + * 状态:0禁用 1 启用 + */ + @ApiModelProperty(value = "状态:0禁用 1 启用") + private Integer status; + + /** + * 0 正常 1 已被删除 + */ + @ApiModelProperty(value = "0 正常 1 已被删除") + private Integer isDelete; + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/model/SmsLog.java b/nakadai/src/main/java/com/huoran/nakadai/entity/model/SmsLog.java new file mode 100644 index 0000000..6eb8023 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/model/SmsLog.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.model; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.util.Date; + +/** + * @author lanhai + */ +@Data +@TableName("tz_sms_log") +public class SmsLog { + /** + * ID + */ + @TableId + + private Long id; + + /** + * 用户id + */ + + private String userId; + + /** + * 手机号码 + */ + + private String userPhone; + + /** + * 短信内容 + */ + private String content; + + /** + * 手机验证码 + */ + + private String mobileCode; + + /** + * 短信类型 1:注册 2:验证 + */ + private Integer type; + + /** + * 发送时间 + */ + + private Date recDate; + + /** + * 发送短信返回码 + */ + + private String responseCode; + + /** + * 状态 1:有效 0:失效 + */ + private Integer status; + +} \ No newline at end of file diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/model/Transcity.java b/nakadai/src/main/java/com/huoran/nakadai/entity/model/Transcity.java new file mode 100644 index 0000000..b5d35fc --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/model/Transcity.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.model; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author lanhai + */ +@Data +@TableName("tz_transcity") +public class Transcity implements Serializable { + @TableId + + private Long transcityId; + + /** + * 运费项id + */ + + private Long transfeeId; + + /** + * 城市id + */ + + private Long cityId; + + /** + * 城市名称 + */ + @TableField(exist=false) + private String areaName; +} \ No newline at end of file diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/model/TranscityFree.java b/nakadai/src/main/java/com/huoran/nakadai/entity/model/TranscityFree.java new file mode 100644 index 0000000..f9ec9da --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/model/TranscityFree.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.model; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author lanhai + */ +@Data +@TableName("tz_transcity_free") +public class TranscityFree implements Serializable { + private static final long serialVersionUID = 2579465286635831076L; + /** + * 指定条件包邮城市项id + */ + @TableId + + private Long transcityFreeId; + + /** + * 指定条件包邮项id + */ + + private Long transfeeFreeId; + + /** + * 城市id + */ + + private Long freeCityId; +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/model/Transfee.java b/nakadai/src/main/java/com/huoran/nakadai/entity/model/Transfee.java new file mode 100644 index 0000000..7336e05 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/model/Transfee.java @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.model; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; +/** + * @author lanhai + */ +@Data +@TableName("tz_transfee") +public class Transfee implements Serializable { + private static final long serialVersionUID = 8039640964056626028L; + /** + * 运费项id + */ + @TableId + @ApiModelProperty(value = "运费项id" ,required=true) + private Long transfeeId; + + /** + * 运费模板id + */ + + @ApiModelProperty(value = "运费模板id" ,required=true) + private Long transportId; + + /** + * 续件数量 + */ + + @ApiModelProperty(value = "续件数量" ,required=true) + private Double continuousPiece; + + /** + * 首件数量 + */ + + @ApiModelProperty(value = "首件数量" ,required=true) + private Double firstPiece; + + /** + * 续件费用 + */ + + @ApiModelProperty(value = "续件费用" ,required=true) + private Double continuousFee; + + /** + * 首件费用 + */ + + @ApiModelProperty(value = "首件费用" ,required=true) + private Double firstFee; + + @TableField(exist=false) + @ApiModelProperty(value = "指定条件运费城市项" ,required=true) + private List cityList; + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/model/TransfeeFree.java b/nakadai/src/main/java/com/huoran/nakadai/entity/model/TransfeeFree.java new file mode 100644 index 0000000..e7cc736 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/model/TransfeeFree.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.model; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; +/** + * @author lanhai + */ +@Data +@TableName("tz_transfee_free") +public class TransfeeFree implements Serializable { + private static final long serialVersionUID = -2811714952219888223L; + /** + * 指定条件包邮项id + */ + @TableId + @ApiModelProperty(value = "指定条件包邮项id" ,required=true) + private Long transfeeFreeId; + + /** + * 运费模板id + */ + + @ApiModelProperty(value = "运费模板id" ,required=true) + private Long transportId; + + /** + * 包邮方式 (0 满x件/重量/体积包邮 1满金额包邮 2满x件/重量/体积且满金额包邮) + */ + + @ApiModelProperty(value = "包邮方式 (0 满x件/重量/体积包邮 1满金额包邮 2满x件/重量/体积且满金额包邮)" ,required=true) + private Integer freeType; + + /** + * 需满金额 + */ + @ApiModelProperty(value = "需满金额" ,required=true) + private Double amount; + + /** + * 包邮x件/重量/体积 + */ + @ApiModelProperty(value = "包邮x件/重量/体积" ,required=true) + private Double piece; + + /** + * 指定条件包邮城市项 + */ + @TableField(exist=false) + @ApiModelProperty(value = "指定条件包邮城市项" ,required=true) + private List freeCityList; +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/model/Transport.java b/nakadai/src/main/java/com/huoran/nakadai/entity/model/Transport.java new file mode 100644 index 0000000..a9e1563 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/model/Transport.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.model; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; +/** + * @author lanhai + */ +@Data +@TableName("tz_transport") +public class Transport implements Serializable { + private static final long serialVersionUID = 1876655654053364580L; + /** + * 运费模板id + */ + @TableId + @ApiModelProperty(value = "运费模板id" ,required=true) + private Long transportId; + + /** + * 运费模板名称 + */ + + @ApiModelProperty(value = "运费模板名称" ,required=true) + private String transName; + + /** + * 创建时间 + */ + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建时间" ,required=true) + private Date createTime; + + /** + * 店铺id + */ + + @ApiModelProperty(value = "店铺id" ,required=true) + private Long shopId; + + /** + * 参考 TransportChargeType + * 收费方式(0 按件数,1 按重量 2 按体积) + */ + @ApiModelProperty(value = "收费方式(0 按件数,1 按重量 2 按体积)" ,required=true) + private Integer chargeType; + + + /** + * 是否包邮 0:不包邮 1:包邮 + */ + @ApiModelProperty(value = "是否包邮 0:不包邮 1:包邮" ,required=true) + private Integer isFreeFee; + + /** + * 是否含有包邮条件 + */ + @ApiModelProperty(value = "是否含有包邮条件" ,required=true) + private Integer hasFreeCondition; + + /** + * 指定条件包邮项 + */ + @TableField(exist=false) + @ApiModelProperty(value = "指定条件包邮项" ,required=true) + private List transfeeFrees; + + /** + * 运费项 + */ + @TableField(exist=false) + @ApiModelProperty(value = "运费项" ,required=true) + private List transfees; + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/model/User.java b/nakadai/src/main/java/com/huoran/nakadai/entity/model/User.java new file mode 100644 index 0000000..2140059 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/model/User.java @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.model; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; +/** + * @author lanhai + */ +@Data +@TableName("tz_user") +public class User implements Serializable { + private static final long serialVersionUID = 2090714647038636896L; + /** + * ID + */ + @TableId(type = IdType.INPUT) + private String userId; + + /** + * 用户昵称 + */ + private String nickName; + + /** + * 真实姓名 + */ + + private String realName; + + /** + * 用户邮箱 + */ + + private String userMail; + + /** + * 登录密码 + */ + + private String loginPassword; + + /** + * 支付密码 + */ + + private String payPassword; + + /** + * 手机号码 + */ + + private String userMobile; + + /** + * 修改时间 + */ + + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date modifyTime; + + /** + * 注册时间 + */ + + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date userRegtime; + + /** + * 注册IP + */ + + private String userRegip; + + /** + * 最后登录时间 + */ + + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date userLasttime; + + /** + * 最后登录IP + */ + + private String userLastip; + + /** + * 备注 + */ + + private String userMemo; + + /** + * M(男) or F(女) + */ + private String sex; + + /** + * 例如:2009-11-27 + */ + + @DateTimeFormat(pattern="yyyy-MM-dd") + private String birthDate; + + /** + * 头像图片路径 + */ + private String pic; + + /** + * 状态 1 正常 0 无效 + */ + private Integer status; + + /** + * 积分 + */ + private Integer score; + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/model/UserAddr.java b/nakadai/src/main/java/com/huoran/nakadai/entity/model/UserAddr.java new file mode 100644 index 0000000..a0c8a10 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/model/UserAddr.java @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.model; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + +/** + * 用户地址管理 + * + * @author hzm + * @date 2019-04-15 10:49:40 + */ +@Data +@TableName("tz_user_addr") +@EqualsAndHashCode(callSuper = false) +public class UserAddr implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @TableId + private Long addrId; + /** + * 用户ID + */ + private String userId; + /** + * 收货人 + */ + private String receiver; + /** + * 省ID + */ + private Long provinceId; + /** + * 省 + */ + private String province; + /** + * 城市 + */ + private String city; + /** + * 城市ID + */ + private Long cityId; + /** + * 区 + */ + private String area; + /** + * 区ID + */ + private Long areaId; + /** + * 邮编 + */ + private String postCode; + /** + * 地址 + */ + private String addr; + /** + * 手机 + */ + private String mobile; + /** + * 状态,1正常,0无效 + */ + private Integer status; + /** + * 是否默认地址 1是 + */ + private Integer commonAddr; + /** + * 建立时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + /** + * 版本号 + */ + private Integer version; + /** + * 更新时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/model/UserAddrOrder.java b/nakadai/src/main/java/com/huoran/nakadai/entity/model/UserAddrOrder.java new file mode 100644 index 0000000..dbe8c27 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/model/UserAddrOrder.java @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.model; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +/** + * @author lanhai + */ +@Data +@TableName("tz_user_addr_order") +public class UserAddrOrder implements Serializable { + /** + * ID + */ + @TableId + + + private Long addrOrderId; + + /** + * 地址ID + */ + + private Long addrId; + + /** + * 用户ID + */ + + private String userId; + + /** + * 收货人 + */ + private String receiver; + + /** + * 省 + */ + + private String province; + + /** + * 城市 + */ + + private String city; + + /** + * 区 + */ + + private String area; + + /** + * 地址 + */ + private String addr; + + /** + * 邮编 + */ + + private String postCode; + + /** + * 省ID + */ + + private Long provinceId; + + /** + * 城市ID + */ + + private Long cityId; + + /** + * 区域ID + */ + + private Long areaId; + + /** + * 手机 + */ + private String mobile; + + /** + * 建立时间 + */ + + private Date createTime; + + /** + * 版本号 + */ + private Integer version; + +} \ No newline at end of file diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/model/UserCollection.java b/nakadai/src/main/java/com/huoran/nakadai/entity/model/UserCollection.java new file mode 100644 index 0000000..27f95b0 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/model/UserCollection.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.model; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.Date; + +/** + * 用户收藏表 + * + * @author xwc + * @date 2019-04-19 16:57:20 + */ +@Data +@TableName("tz_user_collection") +@EqualsAndHashCode +public class UserCollection implements Serializable{ + private static final long serialVersionUID = 1L; + + /** + * 收藏表 + */ + @TableId(type = IdType.AUTO) + private Long id; + /** + * 商品id + */ + private Integer prodId; + /** + * 用户id + */ + private String userId; + /** + * 收藏时间 + */ + private Date createTime; + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/param/DeliveryOrderParam.java b/nakadai/src/main/java/com/huoran/nakadai/entity/param/DeliveryOrderParam.java new file mode 100644 index 0000000..351f174 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/param/DeliveryOrderParam.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.param; + + +import javax.validation.constraints.NotBlank; + +/** + * @author lanhai + */ +public class DeliveryOrderParam { + + @NotBlank(message="订单号不能为空") +// @Schema(description = "订单号" ,required=true) + private String orderNumber; + + @NotBlank(message="快递公司id不能为空") +// @Schema(description = "快递公司" ,required=true) + private Long dvyId; + + @NotBlank(message="物流单号不能为空") +// @Schema(description = "物流单号" ,required=true) + private String dvyFlowId; + + + public Long getDvyId() { + return dvyId; + } + + public void setDvyId(Long dvyId) { + this.dvyId = dvyId; + } + + public String getDvyFlowId() { + return dvyFlowId; + } + + public void setDvyFlowId(String dvyFlowId) { + this.dvyFlowId = dvyFlowId; + } + + public String getOrderNumber() { + return orderNumber; + } + + public void setOrderNumber(String orderNumber) { + this.orderNumber = orderNumber; + } + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/param/OrderParam.java b/nakadai/src/main/java/com/huoran/nakadai/entity/param/OrderParam.java new file mode 100644 index 0000000..4bceb82 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/param/OrderParam.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.param; + +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +/** + * @author lanhai + */ +@Data +public class OrderParam { + /** + * 店铺id + */ + private Integer shopId; + + /** + * 订单状态 -1 已取消 0:待付款 1:待发货 2:待收货 3:已完成 + */ + private Integer status; + + /** + * 是否已经支付,1:已经支付过,0:,没有支付过 + */ + private Integer isPayed; + + /** + * 订购流水号 + */ + private String orderNumber; + + /** + * 开始时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date startTime; + + /** + * 结束时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date endTime; + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/param/ProductParam.java b/nakadai/src/main/java/com/huoran/nakadai/entity/param/ProductParam.java new file mode 100644 index 0000000..c2812f9 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/param/ProductParam.java @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.param; + + +import com.huoran.nakadai.entity.model.Product; +import com.huoran.nakadai.entity.model.Sku; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.util.List; + +/** + * @author lanhai + */ +@Data +public class ProductParam { + + /** + * 产品ID + */ + @ApiModelProperty(value = "产品ID") + private Integer prodId; + + /** + * 状态 + */ + @ApiModelProperty(value = "默认是0,表示上架, 2下架,3草稿,4审核") + private Integer status; + + /** + * 商品名称 + */ + @NotBlank(message = "商品名称不能为空") + @Size(max = 200, message = "商品名称长度应该小于{max}") + @ApiModelProperty(value = "商品名称") + private String prodName; + + + /** + * 商品价格 + */ + @NotNull(message = "请输入商品价格") + @ApiModelProperty(value = "商品价格") + private Double price; + + /** + * 商品价格 + */ + @NotNull(message = "请输入商品原价") + @ApiModelProperty(value = "商品原价") + private Double oriPrice; + + /** + * 库存量 + */ + @NotNull(message = "请输入商品库存") + @ApiModelProperty(value = "商品库存") + private Integer totalStocks; + + /** + * 简要描述,卖点等 + */ + @Size(max = 500, message = "商品卖点长度应该小于{max}") + @ApiModelProperty(value = "简要描述,卖点等") + private String brief; + + @NotBlank(message = "请选择图片上传") + @ApiModelProperty(value = "商品主图") + private String pic; + + /** + * 商品图片 + */ +// @NotBlank(message = "请选择图片上传") + @ApiModelProperty(value = "商品图片",hidden = true) + private String imgs; + + /** + * 商品分类 + */ + @NotNull(message = "请选择商品分类") + @ApiModelProperty(value = "商品分类") + private Long categoryId; + + /** + * sku列表字符串 + */ + @ApiModelProperty(value = "sku列表字符串") + private List skuList; + + /** + * content 商品详情 + */ + @ApiModelProperty(value = "商品详情") + private String content; + + /** + * 是否能够用户自提 + */ + @ApiModelProperty(value = "是否能够用户自提",hidden = true) + private Product.DeliveryModeVO deliveryModeVo; + + /** + * 运费模板id + */ + @ApiModelProperty(value = "运费模板id",hidden = true) + private Long deliveryTemplateId; + + /** + * 分组标签列表 + */ + @ApiModelProperty(value = "分组标签列表",hidden = true) + private List tagList; + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/param/ShopDetailParam.java b/nakadai/src/main/java/com/huoran/nakadai/entity/param/ShopDetailParam.java new file mode 100644 index 0000000..2a77c9e --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/param/ShopDetailParam.java @@ -0,0 +1,223 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.param; + + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; + +/** + * @author lanhai + */ +public class ShopDetailParam { + + + private Integer shopId; + + /** + * 店铺名称(数字、中文,英文(可混合,不可有特殊字符),可修改)、不唯一 + */ + @NotBlank(message="店铺名称不能为空") + @Size(max = 50,message = "商品名称长度应该小于{max}") + private String shopName; + + /** + * 店铺简介(可修改) + */ + @Size(max = 200,message = "店铺简介长度应该小于{max}") + private String intro; + + /** + * 店铺公告(可修改) + */ + @Size(max = 50,message = "店铺公告长度应该小于{max}") + private String shopNotice; + + /** + * 店铺联系电话 + */ + @NotBlank(message="店铺联系电话不能为空") + @Size(max = 20,message = "店铺公告长度应该小于{max}") + private String tel; + + /** + * 店铺详细地址 + */ + @NotBlank(message="店铺详细地址不能为空") + @Size(max = 100,message = "店铺公告长度应该小于{max}") + private String shopAddress; + + /** + * 店铺所在省份(描述) + */ + @NotBlank(message="店铺所在省份不能为空") + @Size(max = 10,message = "店铺所在省份长度应该小于{max}") + private String province; + + /** + * 店铺所在城市(描述) + */ + @NotBlank(message="店铺所在城市不能为空") + @Size(max = 10,message = "店铺所在城市长度应该小于{max}") + private String city; + + /** + * 店铺所在区域(描述) + */ + @NotBlank(message="店铺所在区域不能为空") + @Size(max = 10,message = "店铺所在省份区域长度应该小于{max}") + private String area; + + /** + * 店铺省市区代码,用于回显 + */ + @NotBlank(message="店铺省市区代码不能为空") + @Size(max = 20,message = "店铺省市区代码长度应该小于{max}") + private String pcaCode; + + /** + * 店铺logo(可修改) + */ + @NotBlank(message="店铺logo不能为空") + @Size(max = 200,message = "店铺logo长度应该小于{max}") + private String shopLogo; + + /** + * 店铺相册 + */ + @Size(max = 1000,message = "店铺相册长度应该小于{max}") + private String shopPhotos; + + /** + * 每天营业时间段(可修改) + */ + @NotBlank(message="每天营业时间段不能为空") + @Size(max = 100,message = "每天营业时间段长度应该小于{max}") + private String openTime; + + /** + * 店铺状态(-1:未开通 0: 停业中 1:营业中),可修改 + */ + private Integer shopStatus; + + public String getShopName() { + return shopName; + } + + public void setShopName(String shopName) { + this.shopName = shopName; + } + + public String getIntro() { + return intro; + } + + public void setIntro(String intro) { + this.intro = intro; + } + + public String getShopNotice() { + return shopNotice; + } + + public void setShopNotice(String shopNotice) { + this.shopNotice = shopNotice; + } + + public String getTel() { + return tel; + } + + public void setTel(String tel) { + this.tel = tel; + } + + public String getShopAddress() { + return shopAddress; + } + + public void setShopAddress(String shopAddress) { + this.shopAddress = shopAddress; + } + + public String getProvince() { + return province; + } + + public void setProvince(String province) { + this.province = province; + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + public String getArea() { + return area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getPcaCode() { + return pcaCode; + } + + public void setPcaCode(String pcaCode) { + this.pcaCode = pcaCode; + } + + public String getShopLogo() { + return shopLogo; + } + + public void setShopLogo(String shopLogo) { + this.shopLogo = shopLogo; + } + + public String getShopPhotos() { + return shopPhotos; + } + + public void setShopPhotos(String shopPhotos) { + this.shopPhotos = shopPhotos; + } + + public String getOpenTime() { + return openTime; + } + + public void setOpenTime(String openTime) { + this.openTime = openTime; + } + + public Integer getShopStatus() { + return shopStatus; + } + + public void setShopStatus(Integer shopStatus) { + this.shopStatus = shopStatus; + } + + public Integer getShopId() { + return shopId; + } + + public void setShopId(Integer shopId) { + this.shopId = shopId; + } + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/pay/PayInfoDto.java b/nakadai/src/main/java/com/huoran/nakadai/entity/pay/PayInfoDto.java new file mode 100644 index 0000000..f5c0d7c --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/pay/PayInfoDto.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.pay; + +import lombok.Data; + +/** + * 支付信息 + * @author LGH + */ +@Data +public class PayInfoDto { + + /** + * 支付信息,如商品名称 + */ + private String body; + + /** + * 支付单号 + */ + private String payNo; + + /** + * 付款金额 + */ + private Double payAmount; +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/vo/SysUserVO.java b/nakadai/src/main/java/com/huoran/nakadai/entity/vo/SysUserVO.java new file mode 100644 index 0000000..9a97e18 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/vo/SysUserVO.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.vo; + +import lombok.Data; +/** + * @author lanhai + */ +@Data +public class SysUserVO { + + /** + * 用户id + */ + private String userId; + + /** + * 用户名 + */ + private String username; + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/vo/UserVO.java b/nakadai/src/main/java/com/huoran/nakadai/entity/vo/UserVO.java new file mode 100644 index 0000000..23b1ad0 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/vo/UserVO.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.entity.vo; + +import lombok.Data; +/** + * @author lanhai + */ +@Data +public class UserVO { + + /** + * 用户id + */ + private String userId; + + /** + * 用户昵称 + */ + private String nickName; + + private String userMobile; + + /** + * 用户头像 + */ + private String pic; +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/BasketMapper.java b/nakadai/src/main/java/com/huoran/nakadai/mapper/BasketMapper.java new file mode 100644 index 0000000..1b84c8d --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/BasketMapper.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.huoran.nakadai.entity.app.dto.ShopCartItemDto; +import com.huoran.nakadai.entity.app.param.ShopCartParam; +import com.huoran.nakadai.entity.model.Basket; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * @author lanhai + */ +public interface BasketMapper extends BaseMapper { + + /** + * 获取购物项 + * @param userId 用户id + * @return 购物项列表 + */ + List getShopCartItems(@Param("userId") String userId); + + /** + * 根据购物车id列表和用户id删除购物车 + * @param userId 用户id + * @param basketIds 购物车id列表 + */ + void deleteShopCartItemsByBasketIds(@Param("userId") String userId, @Param("basketIds") List basketIds); + + /** + * 删除所有购物车 + * @param userId 用户id + */ + void deleteAllShopCartItems(@Param("userId") String userId); + + /** + * 获取失效的购物项 + * @param userId 用户id + * @return 失效的购物项 + */ + List getShopCartExpiryItems(@Param("userId") String userId); + + /** + * 删除失效的购物项 + * @param userId 用户id + */ + void cleanExpiryProdList(@Param("userId") String userId); + + /** + * 更新购物车满减活动id + * @param userId 用户id + * @param basketIdShopCartParamMap 购物项map + */ + void updateDiscountItemId(@Param("userId")String userId, @Param("basketIdShopCartParamMap") Map basketIdShopCartParamMap); + + /** + * 根据商品id获取用户id列表 + * @param prodId + * @return + */ + List listUserIdByProdId(@Param("prodId")Integer prodId); + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/CategoryMapper.java b/nakadai/src/main/java/com/huoran/nakadai/mapper/CategoryMapper.java new file mode 100644 index 0000000..eaf140b --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/CategoryMapper.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.huoran.nakadai.entity.model.Category; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * @author lanhai + */ +@Mapper +public interface CategoryMapper extends BaseMapper { + + /** + * 根据父级id获取分类列表 + * + * @param parentId + * @return + */ + List listByParentId(Long parentId); + + /** + * 根据店铺id获取分类列表 + * + * @param shopId + * @return + */ + List tableCategory(Integer shopId); +} \ No newline at end of file diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/CategoryPropMapper.java b/nakadai/src/main/java/com/huoran/nakadai/mapper/CategoryPropMapper.java new file mode 100644 index 0000000..93062b5 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/CategoryPropMapper.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.huoran.nakadai.entity.model.CategoryProp; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author lanhai + */ +public interface CategoryPropMapper extends BaseMapper { + + /** + * 插入分类属性 + * @param categoryId + * @param propIds + */ + void insertCategoryProp(@Param("categoryId") Long categoryId, @Param("propIds") List propIds); + + /** + * 根据分类id删除分类属性 + * @param categoryId + */ + void deleteByCategoryId(Long categoryId); + + /** + * 根据属性id删除分类属性 + * @param propId + */ + void deleteByPropId( Integer propId); +} \ No newline at end of file diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/CurriculumSubsectionMapper.java b/nakadai/src/main/java/com/huoran/nakadai/mapper/CurriculumSubsectionMapper.java index 5dbedd6..91b7674 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/mapper/CurriculumSubsectionMapper.java +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/CurriculumSubsectionMapper.java @@ -2,6 +2,7 @@ package com.huoran.nakadai.mapper; import com.huoran.nakadai.entity.CurriculumSubsection; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; /** *

@@ -11,6 +12,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; * @author lr * @since 2021-09-26 */ +@Mapper public interface CurriculumSubsectionMapper extends BaseMapper { Integer selectMaxSort(); diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/MessageMapper.java b/nakadai/src/main/java/com/huoran/nakadai/mapper/MessageMapper.java new file mode 100644 index 0000000..d0cd219 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/MessageMapper.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.huoran.nakadai.entity.model.Message; +import org.apache.ibatis.annotations.Mapper; + +/** + * @author lanhai + */ +@Mapper +public interface MessageMapper extends BaseMapper { +} \ No newline at end of file diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/NoticeMapper.java b/nakadai/src/main/java/com/huoran/nakadai/mapper/NoticeMapper.java new file mode 100644 index 0000000..343f137 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/NoticeMapper.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.huoran.nakadai.entity.app.dto.NoticeDto; +import com.huoran.nakadai.entity.model.Notice; + +/** + * 公告管理 + * + * @author hzm + * @date 2019-04-18 21:21:40 + */ +public interface NoticeMapper extends BaseMapper { + + /** + * 分页获取公布的公告 + * @param page + * @return + */ + Page pageNotice(Page page); +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/OrderItemMapper.java b/nakadai/src/main/java/com/huoran/nakadai/mapper/OrderItemMapper.java new file mode 100644 index 0000000..f5460b2 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/OrderItemMapper.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.huoran.nakadai.entity.model.OrderItem; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author lanhai + */ +public interface OrderItemMapper extends BaseMapper { + + /** + * 根据订单编号获取订单项 + * @param orderNumber + * @return + */ + List listByOrderNumber(@Param("orderNumber") String orderNumber); + + /** + * 插入订单项 + * @param orderItems + */ + void insertBatch(List orderItems); + +} \ No newline at end of file diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/OrderMapper.java b/nakadai/src/main/java/com/huoran/nakadai/mapper/OrderMapper.java index 41023e7..9572931 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/mapper/OrderMapper.java +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/OrderMapper.java @@ -1,75 +1,138 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + package com.huoran.nakadai.mapper; +import cn.hutool.core.date.DateTime; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.huoran.nakadai.entity.Order; -import com.huoran.nakadai.entity.req.ListOfClientCommercialManagersReq; -import com.huoran.nakadai.entity.req.OrderListReq; -import com.huoran.nakadai.entity.req.OrderRecordParametersReq; -import com.huoran.nakadai.entity.req.SalesProgressReq; -import com.huoran.nakadai.entity.res.AnnualOperatingAnalysisResp; -import com.huoran.nakadai.entity.res.SchoolCourseRes; +import com.huoran.nakadai.entity.app.dto.MyOrderDto; +import com.huoran.nakadai.entity.app.dto.OrderCountData; +import com.huoran.nakadai.entity.distribution.UserShoppingDataDto; +import com.huoran.nakadai.entity.model.Order; + +import com.huoran.nakadai.entity.param.OrderParam; +import com.huoran.nakadai.utils.PageAdapter; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; -import java.util.HashSet; +import java.util.Date; import java.util.List; /** - *

- * 订单表 Mapper 接口 - *

- * - * @author huoran - * @since 2021-06-28 + * @author lanhai */ @Mapper public interface OrderMapper extends BaseMapper { - List selectOrderPage(OrderListReq orderListReq); - - int selectTotalNum(OrderListReq orderListReq); - - List schoolCourse(@Param("schoolId") Integer schoolId); - - List getSchoolEffectiveCourse(@Param("schoolId") Integer schoolId); - - List schoolCourseByAchievement(@Param("schoolId") Integer schoolId); - - void updateCustomer(@Param("customerId")Integer customerId,@Param("platformId")String platformId); - - String selectCustomerPlatformId(Integer customerId); - - int selectCustomerPlatformPermission(@Param("customerId")Integer customerId,@Param("platformId") Integer platformId); - - int selectCustomerSchool(@Param("customerId")Integer customerId); - - String selectCustomerIdByAccountId(@Param("customerId")Integer customerId); - - String selectCustomerExpireDate(Integer customerId); - - IPage getOrderBasedOnBusinessManagerId(Page page, @Param("req") ListOfClientCommercialManagersReq req); - - String selectCity(Integer cityId,Integer provinceId); - - String selectProvince(Integer provinceId); - - - IPage miniProgramOrderRecord(Page page, @Param("req") OrderRecordParametersReq req); - - - SchoolCourseRes whetherToRenewTheFee(@Param("schoolId") Integer schoolId,@Param("mallId") Integer mallId); - - HashSet dataPermissionOrderId(@Param("cIds") List cIds); - - HashSet dataPermissionOrderIdByDataProduct(@Param("supplierId") String supplierId); - - HashSet valuePermissionOrderIds(); - - AnnualOperatingAnalysisResp income(@Param("req") SalesProgressReq req); - - String selectOpenid(@Param("accountId")Integer accountId); + /** + * 根据订单编号获取订单 + * @param orderNumber + * @return + */ + Order getOrderByOrderNumber(@Param("orderNumber") String orderNumber); + + /** + * 根据参数获取订单 + * @param orderStatus 订单状态 + * @param lessThanUpdateTime 更新时间 + * @return + */ + List listOrderAndOrderItems(@Param("orderStatus") Integer orderStatus, @Param("lessThanUpdateTime") DateTime lessThanUpdateTime); + + /** + * 取消订单 + * @param orders + */ + void cancelOrders(@Param("orders") List orders); + + /** + * 订单确认收货 + * @param orders + */ + void confirmOrder(@Param("orders") List orders); + + /** + * 更新订单为支付成功 + * @param orderNumbers 订单编号列表 + * @param payType 支付类型 + */ + void updateByToPaySuccess(@Param("orderNumbers") List orderNumbers, @Param("payType") Integer payType); + + /** + * 根据参数和时间获取订单列表 + * @param order 参数 + * @param startTime 开始时间 + * @param endTime 结束时间 + * @return + */ + List listOrdersDetailByOrder(@Param("order") Order order, @Param("startTime") Date startTime, @Param("endTime") Date endTime); + + /** + * 根据分页参数和订单参数获取订单列表 + * @param adapter 分页参数 + * @param orderParam 订单参数 + * @return + */ + List listOrdersDetailByOrderParam(@Param("adapter") PageAdapter adapter, @Param("orderParam") OrderParam orderParam); + + /** + * 根据订单参数获取订单数 + * @param orderParam + * @return + */ + Long countOrderDetail(@Param("orderParam") OrderParam orderParam); + + /** + * 根据店铺id和用户id获取购买过的商品id列表 + * @param shopId + * @param userId + * @return + */ + List listBoughtProdByUserIdAndShopId(@Param("shopId") Long shopId, @Param("userId") String userId); + + /** + * 根据参数计算用户消费信息 + * @param shopId + * @param userId + * @return + */ + UserShoppingDataDto calculateUserInShopData(@Param("shopId") Long shopId, @Param("userId") String userId); + + /** + * 根据用户id和订单状态获取订单列表 + * @param adapter + * @param userId + * @param status + * @return + */ + List listMyOrderByUserIdAndStatus(@Param("adapter") PageAdapter adapter, @Param("userId") String userId, @Param("status") Integer status); + + /** + * 根据用户id和订单状态获取订单数量 + * @param userId + * @param status + * @return + */ + Long countMyOrderByUserIdAndStatus(@Param("userId") String userId, @Param("status") Integer status); + + /** + * 删除订单 + * @param orders + */ + void deleteOrders(@Param("orders") List orders); + + /** + * 根据用户id获取各个状态的订单数量 + * @param userId + * @return + */ + OrderCountData getOrderCount(String userId); - HashSet selectGoodsOrderId(@Param("supplierId")String supplierId); } diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/OrderRefundMapper.java b/nakadai/src/main/java/com/huoran/nakadai/mapper/OrderRefundMapper.java new file mode 100644 index 0000000..df6b0d5 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/OrderRefundMapper.java @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.huoran.nakadai.entity.model.OrderRefund; + +/** + * @author lanhai + */ +public interface OrderRefundMapper extends BaseMapper { +} \ No newline at end of file diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/OrderSettlementMapper.java b/nakadai/src/main/java/com/huoran/nakadai/mapper/OrderSettlementMapper.java new file mode 100644 index 0000000..c36e35a --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/OrderSettlementMapper.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.huoran.nakadai.entity.model.OrderSettlement; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author lanhai + */ +@Mapper +public interface OrderSettlementMapper extends BaseMapper { + /** + * 更新订单结算 + * @param orderSettlement + */ + void updateByOrderNumberAndUserId(@Param("orderSettlement") OrderSettlement orderSettlement); + + /** + * 根据支付单号获取结算信息 + * @param payNo + * @return + */ + List getSettlementsByPayNo(@Param("payNo") String payNo); + + /** + * 根据支付单号更新结算 + * @param outTradeNo + * @param transactionId + */ + void updateSettlementsByPayNo(@Param("outTradeNo") String outTradeNo, @Param("transactionId") String transactionId); + + /** + * 更新结算信息为已支付 + * @param payNo + * @param version + * @return + */ + int updateToPay(@Param("payNo") String payNo, @Param("version") Integer version); +} \ No newline at end of file diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/PickAddrMapper.java b/nakadai/src/main/java/com/huoran/nakadai/mapper/PickAddrMapper.java new file mode 100644 index 0000000..780830c --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/PickAddrMapper.java @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.huoran.nakadai.entity.model.PickAddr; +import org.apache.ibatis.annotations.Mapper; + +/** + * @author lanhai + */ +@Mapper +public interface PickAddrMapper extends BaseMapper { +} \ No newline at end of file diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/PlatformTeamAccountMapper.java b/nakadai/src/main/java/com/huoran/nakadai/mapper/PlatformTeamAccountMapper.java index d67d9ba..280b776 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/mapper/PlatformTeamAccountMapper.java +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/PlatformTeamAccountMapper.java @@ -43,4 +43,8 @@ public interface PlatformTeamAccountMapper extends BaseMapper { + /** + * 根据商品id获取商品评论信息 + * @param prodId + * @return + */ + ProdCommDataDto getProdCommDataByProdId(@Param("prodId") Integer prodId); + + /** + * 根据评价等级和商品id分页获取商品评价 + * @param page + * @param prodId + * @param evaluate + * @return + */ + IPage getProdCommDtoPageByProdId(@Param("page") Page page, @Param("prodId") Integer prodId, @Param("evaluate") Integer evaluate); + + /** + * 根据用户id分页获取评论列表 + * @param page + * @param userId + * @return + */ + IPage getProdCommDtoPageByUserId(Page page, @Param("userId") String userId); + + /** + * 根据参数分页获取商品评论 + * @param page + * @param prodComm + * @return + */ + IPage getProdCommPage(Page page, @Param("prodComm") ProdComm prodComm); +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/ProdImgMapper.java b/nakadai/src/main/java/com/huoran/nakadai/mapper/ProdImgMapper.java new file mode 100644 index 0000000..16b8c21 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/ProdImgMapper.java @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.huoran.nakadai.entity.model.ProdImg; + +/** + * @author lanhai + */ +public interface ProdImgMapper extends BaseMapper { +} \ No newline at end of file diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/ProdPropMapper.java b/nakadai/src/main/java/com/huoran/nakadai/mapper/ProdPropMapper.java new file mode 100644 index 0000000..fa9ffa4 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/ProdPropMapper.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.huoran.nakadai.entity.model.ProdProp; +import com.huoran.nakadai.utils.PageAdapter; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author lanhai + */ +public interface ProdPropMapper extends BaseMapper { + + /** + * 根据参数获取商品属性列表 + * @param adapter + * @param prodProp + * @return + */ + List listPropAndValue(@Param("adapter") PageAdapter adapter, @Param("prodProp") ProdProp prodProp); + + /** + * 根据参数计算商品属性 + * @param prodProp + * @return + */ + long countPropAndValue(@Param("prodProp") ProdProp prodProp); + + /** + * 删除商品属性 + * @param propId + * @param rule + * @param shopId + * @return + */ + int deleteByPropId(@Param("propId") Integer propId, @Param("rule") Integer rule, @Param("shopId") Integer shopId); + + /** + * 根据店铺id和属性名称获取商品属性 + * @param propName + * @param shopId + * @param rule + * @return + */ + ProdProp getProdPropByPropNameAndShopId(@Param("propName") String propName, @Param("shopId") Integer shopId, @Param("rule") Integer rule); +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/ProdPropValueMapper.java b/nakadai/src/main/java/com/huoran/nakadai/mapper/ProdPropValueMapper.java new file mode 100644 index 0000000..334362b --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/ProdPropValueMapper.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.huoran.nakadai.entity.model.ProdPropValue; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author lanhai + */ +public interface ProdPropValueMapper extends BaseMapper { + + /** + * 插入商品属性数值 + * @param propId + * @param prodPropValues + */ + void insertPropValues(@Param("propId") Integer propId, @Param("prodPropValues") List prodPropValues); + + /** + * 删除属性数值 + * @param propId + */ + void deleteByPropId(@Param("propId") Integer propId); +} \ No newline at end of file diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/ProdTagMapper.java b/nakadai/src/main/java/com/huoran/nakadai/mapper/ProdTagMapper.java new file mode 100644 index 0000000..11744d2 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/ProdTagMapper.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.huoran.nakadai.entity.model.ProdTag; + +/** + * 商品分组 + * + * @author hzm + * @date 2019-04-18 09:08:36 + */ +public interface ProdTagMapper extends BaseMapper { + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/ProdTagReferenceMapper.java b/nakadai/src/main/java/com/huoran/nakadai/mapper/ProdTagReferenceMapper.java new file mode 100644 index 0000000..667110b --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/ProdTagReferenceMapper.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.huoran.nakadai.entity.model.ProdTagReference; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 分组标签引用 + * + * @author hzm + * @date 2019-04-18 16:28:01 + */ +@Mapper +public interface ProdTagReferenceMapper extends BaseMapper { + /** + * 插入标签 + * @param shopId + * @param prodId + * @param tagList + */ + void insertBatch(@Param("shopId") Integer shopId, @Param("prodId") Integer prodId, @Param("tagList") List tagList); + + /** + * 根据属性获取标签id列表 + * @param prodId + * @return + */ + List listTagIdByProdId(@Param("prodId") Integer prodId); + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/ProductMapper.java b/nakadai/src/main/java/com/huoran/nakadai/mapper/ProductMapper.java new file mode 100644 index 0000000..cac78a0 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/ProductMapper.java @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.huoran.nakadai.entity.app.dto.ProductDto; +import com.huoran.nakadai.entity.app.dto.TagProductDto; +import com.huoran.nakadai.entity.dto.SearchProdDto; +import com.huoran.nakadai.entity.model.Product; +import com.huoran.nakadai.utils.PageParam; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * @author lanhai + */ +@Mapper +public interface ProductMapper extends BaseMapper { + /** + * 更新商品库存 + * @param product + * @return + */ + int updateStocks(@Param("prod") Product product); + + /** + * 根据商品名称和店铺id获取商品信息 + * @param prodName + * @param shopId + * @return + */ + Product getProductByProdNameAndShopId(@Param("prodName") String prodName, @Param("shopId") Integer shopId); + + /** + * 返回库存 + * @param prodCollect + */ + void returnStock(@Param("prodCollect") Map prodCollect); + + /** + * 根据上架时间分页获取商品 + * @param page + * @return + */ + IPage pageByPutAwayTime(IPage page); + + /** + * 根据标签id分页获取商品信息 + * @param page + * @param tagId + * @return + */ + IPage pageByTagId(Page page, @Param("tagId") Long tagId); + + /** + * 分页获取销量最多的商品 + * @param page + * @return + */ + IPage moreBuyProdList(Page page); + + /** + * 根据分类id分页获取商品 + * @param page + * @param categoryId + * @return + */ + IPage pageByCategoryId(Page page, @Param("categoryId") Long categoryId); + + /** + * 根据商品名称和排序分页获取商品 + * @param page + * @param prodName + * @param sort + * @param orderBy + * @return + */ + IPage getSearchProdDtoPageByProdName(Page page, @Param("prodName") String prodName, @Param("sort") Integer sort, @Param("orderBy") Integer orderBy); + + /** + * 根据标签id获取商品 + * @param tagId + * @return + */ + TagProductDto tagProdList(@Param("tagId") Long tagId); + + /** + * 获取分组商品列表 + * @return + */ + List tagProdList(); + + /** + * 查看店铺的所有活动商品 + * @param shopId + * @param page + * @return + */ + IPage listByShopId(@Param("page") PageParam page, @Param("shopId") Long shopId); + + /** + * 通过优惠券适用商品类型、优惠券id、店铺id获取商品列表 + * @param shopId + * @param page + * @param couponId + * @param suitableProdType + * @return + */ + IPage listBySuitableProdTypeAndCouponIdAndShopId(@Param("page") PageParam page, @Param("shopId") Long shopId, @Param("suitableProdType") Integer suitableProdType, @Param("couponId") Long couponId); + + /** + * 获取用户的收藏商品列表 + * @param page + * @param userId + * @return + */ + IPage collectionProds(@Param("page") PageParam page, @Param("userId") String userId); + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/ShopDetailMapper.java b/nakadai/src/main/java/com/huoran/nakadai/mapper/ShopDetailMapper.java new file mode 100644 index 0000000..0dd3b48 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/ShopDetailMapper.java @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.huoran.nakadai.entity.model.ShopDetail; + +/** + * @author lanhai + */ +public interface ShopDetailMapper extends BaseMapper { +} \ No newline at end of file diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/SkuMapper.java b/nakadai/src/main/java/com/huoran/nakadai/mapper/SkuMapper.java new file mode 100644 index 0000000..1de2cfe --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/SkuMapper.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.huoran.nakadai.entity.model.Sku; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * @author lanhai + */ +@Mapper +public interface SkuMapper extends BaseMapper { + + /** + * 批量插入sku + * @param prodId 商品id + * @param skuList sku列表 + */ + void insertBatch(@Param("prodId") Integer prodId, @Param("skuList") List skuList); + + /** + * 根据商品id获取商品sku列表 + * @param prodId + * @return + */ + List listByProdId(Integer prodId); + + /** + * 更新sku库存 + * @param sku + * @return + */ + int updateStocks(@Param("sku") Sku sku); + + /** + * 根据商品id删除sku + * @param prodId + */ + void deleteByProdId(@Param("prodId") Integer prodId); + + /** + * 返回sku库存 + * @param skuCollect + */ + void returnStock(@Param("skuCollect") Map skuCollect); + +} \ No newline at end of file diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/BasketMapper.xml b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/BasketMapper.xml new file mode 100644 index 0000000..5abbcbf --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/BasketMapper.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + delete from tz_basket where user_id = #{userId} and basket_id in + + #{basketId} + + + + + delete from tz_basket where user_id = #{userId} + + + + + DELETE FROM tz_basket + WHERE basket_id IN( + SELECT basket_id FROM ( + SELECT tb.basket_id basket_id + FROM tz_basket tb + LEFT JOIN tz_shop_detail tsd + ON tb.shop_id = tsd.shop_id + LEFT JOIN tz_prod tp + ON tb.prod_id = tp.prod_id + LEFT JOIN tz_sku ts + ON tb.sku_id = ts.sku_id + WHERE tp.status = 0 OR ts.status = 0 AND tb.user_id = #{userId}) AS temp) + + + + + + UPDATE tz_basket SET discount_id = #{shopCartParam.discountId} where basket_id = #{key} and user_id = #{userId} + + + + + diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/CategoryMapper.xml b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/CategoryMapper.xml new file mode 100644 index 0000000..dcac6a7 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/CategoryMapper.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/CategoryPropMapper.xml b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/CategoryPropMapper.xml new file mode 100644 index 0000000..6dc945d --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/CategoryPropMapper.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + insert into tz_category_prop (category_id,prop_id) values + + (#{categoryId},#{propId}) + + + + + delete from tz_category_prop where category_id = #{categoryId} + + + + delete from tz_category_prop where prop_id = #{propId} + + \ No newline at end of file diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/MessageMapper.xml b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/MessageMapper.xml new file mode 100644 index 0000000..1e79aea --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/MessageMapper.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/NoticeMapper.xml b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/NoticeMapper.xml new file mode 100644 index 0000000..e00dd88 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/NoticeMapper.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/OrderItemMapper.xml b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/OrderItemMapper.xml new file mode 100644 index 0000000..b85f00b --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/OrderItemMapper.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO `tz_order_item` (shop_id,order_number,prod_id,sku_id,sku_name, + prod_count,prod_name,pic,price,user_id,product_total_amount,rec_time,comm_sts, + distribution_card_no,basket_date) VALUES + + (#{orderItem.shopId},#{orderItem.orderNumber},#{orderItem.prodId},#{orderItem.skuId},#{orderItem.skuName}, + #{orderItem.prodCount},#{orderItem.prodName},#{orderItem.pic},#{orderItem.price},#{orderItem.userId},#{orderItem.productTotalAmount},#{orderItem.recTime},#{orderItem.commSts}, + #{orderItem.distributionCardNo},#{orderItem.basketDate}) + + + + + diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/OrderMapper.xml b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/OrderMapper.xml index 923e2aa..abef18d 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/OrderMapper.xml +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/OrderMapper.xml @@ -1,474 +1,355 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + - - update hr_user_account - set platform_id = #{platformId} - where customer_id = #{customerId} - - + select * from tz_order o where o.order_number = #{orderNumber} + - limit #{pageNo},#{pageSize} - + + + + update tz_order set `status`=6,cancel_time = NOW() where is_payed = 0 and order_id in + + #{order.orderId} + + - + select o.*,oi.*,oi.prod_name as item_prod_name,uao.* from tz_order o + left join tz_order_item oi on o.order_number = oi.order_number + left join tz_user_addr_order uao on o.addr_order_id = uao.addr_order_id + where o.order_id in ( + select * from ( + select o.order_id from tz_order o + where 1=1 + + and o.order_number like concat('%',#{order.orderNumber},'%') - - and ho.province_id = #{provinceId} + + and o.status = #{order.status} - - and ho.city_id = #{cityId} + + and o.shop_id = #{order.shopId} - - and ho.order_status = #{orderStatus} + + and o.is_payed = #{order.isPayed} + and o.status != 6 - - and ho.order_type = #{orderType} + + and o.create_time > #{startTime} - - and CONCAT(ho.order_number like '%' #{customerName} '%' or ho.customer_name like '%' #{customerName} '%' - or oo.product_name like '%' #{customerName} '%') + + and o.create_time < #{endTime} + ORDER BY o.create_time DESC + ) + AS limittable) ORDER BY o.create_time DESC - + SELECT *,oi.sku_name as item_sku_name,oi.prod_name as item_prod_name FROM + ( + SELECT * FROM tz_order + + + and order_number = #{orderParam.orderNumber} + + + and status = #{orderParam.status} + + + and shop_id = #{orderParam.shopId} + + + and is_payed = #{orderParam.isPayed} + and status != 6 + + + and create_time > #{orderParam.startTime} + + + and create_time < #{orderParam.endTime} + + + ORDER BY update_time DESC + LIMIT #{adapter.begin} , #{adapter.size} + ) AS o + LEFT JOIN tz_order_item oi + ON o.order_number = oi.order_number + LEFT JOIN tz_user_addr_order uao + ON o.addr_order_id = uao.addr_order_id - - - - - + SELECT COUNT(0) FROM tz_order + + + and order_number = #{orderParam.orderNumber} + + + and status = #{orderParam.status} + + + and shop_id = #{orderParam.shopId} + + + and is_payed = #{orderParam.isPayed} + and status != 6 + + + and create_time > #{orderParam.startTime} + + + and create_time < #{orderParam.endTime} + + - - - + select + oi.prod_id + from tz_order_item oi + join tz_order o on o.order_number = oi.order_number + where o.user_id=#{userId} and o.shop_id = #{shopId} and (o.status = 4 or o.status = 5) + - - ORDER BY create_time asc - - - ORDER BY create_time desc - - - + select + count(o.order_number) as expense_number, + ifnull(SUM(o.actual_total),0) as expense_amount + from tz_order o + where o.user_id=#{userId} and o.shop_id = #{shopId} and (o.status = 4 or o.status = 5) - - + SELECT o.actual_total,oi.pic,oi.price,oi.prod_name,oi.sku_name,oi.prod_count,o.status,o.order_number + FROM ( + SELECT * FROM tz_order temp + WHERE temp.user_id = #{userId} and temp.delete_status = 0 + + AND temp.status = #{status} + ORDER BY temp.create_time DESC + LIMIT #{adapter.begin} , #{adapter.size} + )AS o + LEFT JOIN tz_order_item oi ON o.order_number = oi.order_number + - - AND CONCAT(order_number like '%' #{req.keywords} '%' or product_name like '%' #{req.keywords} '%') - - - and order_status =#{req.orderStatus} + - - - - - - - - - SELECT - o.order_id - FROM - order_other o - LEFT JOIN hr_mall m ON o.mall_id = m.mall_id - LEFT JOIN hr_mall_supplier s ON s.mall_id = o.mall_id - WHERE - o.is_del = 0 - - AND s.supplier_id IN (${supplierId}) - - GROUP BY - o.order_id + COUNT(o.order_id) all_count, + COUNT( CASE WHEN o.status = 1 THEN o.order_id ELSE NULL END ) AS unPay, + COUNT( CASE WHEN o.status = 2 THEN o.order_id ELSE NULL END ) AS payed, + COUNT( CASE WHEN o.status = 3 THEN o.order_id ELSE NULL END ) AS consignment, + COUNT( CASE WHEN o.status = 4 THEN o.order_id ELSE NULL END ) AS confirm, + COUNT( CASE WHEN o.status = 5 THEN o.order_id ELSE NULL END ) AS success, + COUNT( CASE WHEN o.status = 6 THEN o.order_id ELSE NULL END ) AS `close` + FROM tz_order o + WHERE o.user_id =#{userId} diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/OrderSettlementMapper.xml b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/OrderSettlementMapper.xml new file mode 100644 index 0000000..d0419b3 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/OrderSettlementMapper.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + update tz_order_settlement + SET + + pay_no = #{orderSettlement.payNo}, + + + pay_type = #{orderSettlement.payType}, + + + is_clearing = #{orderSettlement.isClearing}, + + + clearing_time = #{orderSettlement.clearingTime}, + + order_number = #{orderSettlement.orderNumber} + WHERE order_number = #{orderSettlement.orderNumber} and user_id = #{orderSettlement.userId} + + + + + + update tz_order_settlement + + set + biz_pay_no = #{transactionId}, + is_clearing = 1, + pay_status = 1 + + where pay_no = #{outTradeNo} + + + + update tz_order_settlement set pay_status = 1, version = version +1 where pay_no = #{payNo} and version = #{version} + + \ No newline at end of file diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/PickAddrMapper.xml b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/PickAddrMapper.xml new file mode 100644 index 0000000..17b6bb9 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/PickAddrMapper.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/PlatformTeamAccountMapper.xml b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/PlatformTeamAccountMapper.xml index 1a23524..44a912a 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/PlatformTeamAccountMapper.xml +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/PlatformTeamAccountMapper.xml @@ -150,4 +150,21 @@ GROUP BY pc.id ORDER BY hpa.manage_id DESC + + diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/ProdCommMapper.xml b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/ProdCommMapper.xml new file mode 100644 index 0000000..ecb2b3c --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/ProdCommMapper.xml @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + pc.prod_comm_id, + pc.reply_content, + pc.rec_time, + pc.score, + pc.is_anonymous, + pc.pics, + pc.user_id, + pc.reply_sts, + pc.evaluate, + pc.content, + u.nick_name, + u.pic + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/ProdImgMapper.xml b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/ProdImgMapper.xml new file mode 100644 index 0000000..e4f0ecc --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/ProdImgMapper.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/ProdPropMapper.xml b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/ProdPropMapper.xml new file mode 100644 index 0000000..b6a9c7f --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/ProdPropMapper.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from tz_prod_prop where prop_id = #{propId} and rule = #{rule} and shop_id = #{shopId} + + + + + diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/ProdPropValueMapper.xml b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/ProdPropValueMapper.xml new file mode 100644 index 0000000..9bac0a4 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/ProdPropValueMapper.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + insert into tz_prod_prop_value (prop_id,prop_value) values + + (#{propId},#{prodPropValue.propValue}) + + + + + delete from tz_prod_prop_value where prop_id = #{propId} + + \ No newline at end of file diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/ProdTagMapper.xml b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/ProdTagMapper.xml new file mode 100644 index 0000000..61965e5 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/ProdTagMapper.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/ProdTagReferenceMapper.xml b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/ProdTagReferenceMapper.xml new file mode 100644 index 0000000..28551cb --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/ProdTagReferenceMapper.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/ProductMapper.xml b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/ProductMapper.xml new file mode 100644 index 0000000..e0efbaf --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/ProductMapper.xml @@ -0,0 +1,227 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + p.`prod_id`, + p.`shop_id`, + p.`prod_name`, + p.`pic`, + p.`price`, + p.`ori_price`, + p.`brief`, + p.`imgs`, + p.`category_id`, + p.`total_stocks` + + + + p.prod_id, + p.pic, + p.prod_name, + p.price, + p.brief, + sd.`shop_name` + + + + update tz_prod set total_stocks = total_stocks - #{prod.totalStocks} ,version = version + 1 where prod_id = #{prod.prodId} and #{prod.totalStocks} <= total_stocks + + + + + + + + + update tz_prod set total_stocks = total_stocks + #{changeStocks} where prod_id = #{prodId} + + + + + + + + + + + + + + + + + + + + diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/ShopDetailMapper.xml b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/ShopDetailMapper.xml new file mode 100644 index 0000000..ce1503b --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/ShopDetailMapper.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/SkuMapper.xml b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/SkuMapper.xml new file mode 100644 index 0000000..b76cea4 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/SkuMapper.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO `tz_sku` ( + `prod_id`,`properties`,`ori_price`,`price`,`stocks`,`actual_stocks`, + `update_time`,`rec_time`,`party_code`,`model_id`, `pic`, + `sku_name`,`prod_name`,`version`,`weight`,`volume`, `status`, `is_delete` + ) + VALUES + + ( + #{prodId},#{sku.properties},#{sku.oriPrice},#{sku.price},#{sku.stocks}, + #{sku.actualStocks}, NOW(),NOW(),#{sku.partyCode},#{sku.modelId}, #{sku.pic}, + #{sku.skuName},#{sku.prodName},0,#{sku.weight},#{sku.volume}, #{sku.status},0 + ) + + + + + + + update tz_sku set stocks = stocks - #{sku.stocks}, version = version + 1,update_time = NOW() where sku_id = #{sku.skuId} and #{sku.stocks} <= stocks + + + + update tz_sku set is_delete = 1 where prod_id = #{prodId} + + + + + update tz_sku set stocks = stocks + #{changeStocks} where sku_id = #{skuId} + + + diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/BasketService.java b/nakadai/src/main/java/com/huoran/nakadai/service/BasketService.java new file mode 100644 index 0000000..abb8aa3 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/service/BasketService.java @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.huoran.nakadai.entity.app.dto.ShopCartDto; +import com.huoran.nakadai.entity.app.dto.ShopCartItemDto; +import com.huoran.nakadai.entity.app.param.ChangeShopCartParam; +import com.huoran.nakadai.entity.app.param.OrderItemParam; +import com.huoran.nakadai.entity.app.param.ShopCartParam; +import com.huoran.nakadai.entity.model.Basket; + + +import java.util.List; +import java.util.Map; + +/** + * @author lgh on 2018/10/18. + */ +public interface BasketService extends IService { + + /** + * 根据购物车id列表删除购物项 + * @param userId 用户id + * @param basketIds 购物车id列表 + */ + void deleteShopCartItemsByBasketIds(String userId, List basketIds); + + /** + * 添加购物车 + * @param param + * @param userId + */ + void addShopCartItem(ChangeShopCartParam param, String userId); + + /** + * 更新购物车 + * @param basket + */ + void updateShopCartItem(Basket basket); + + /** + * 删除所有购物车 + * @param userId + */ + void deleteAllShopCartItems(String userId); + + /** + * 根据用户id获取购物车列表 + * @param userId 用户id + * @return 购物车列表 + */ + List getShopCartItems(String userId); + + /** + * 获取购物车失效列表 + * @param userId 用户id + * @return 失效商品 + */ + List getShopCartExpiryItems(String userId); + + /** + * 清除失效的购物项 + * @param userId 用户id + */ + void cleanExpiryProdList(String userId); + + /** + * 更新满减活动id + * @param userId 用户id + * @param basketIdShopCartParamMap 购物车map + */ + void updateBasketByShopCartParam(String userId, Map basketIdShopCartParamMap); + + /** + * 删除购物车缓存 + * @param userId + */ + void removeShopCartItemsCacheByUserId(String userId); + + /** + * 获取购物车中拥有某件商品的用户,用于清除该用户购物车的缓存 + * @param prodId 商品id + * @return 用户id + */ + List listUserIdByProdId(Integer prodId); + + /** + * 根据店铺组装购车中的商品信息,返回每个店铺中的购物车商品信息 + * @param shopCartItems 指定的购物项目 + * @return 每个店铺的购物车信息 + */ + List getShopCarts(List shopCartItems); + + /** + * 组装获取用户提交的购物车商品项 + * @param orderItem 提交订单时携带的商品信息 + * @param userId 当前用户的用户id + * @param basketId 购物车id + * @return 所有的商品购物项 + */ + List getShopCartItemsByOrderItems(List basketId, OrderItemParam orderItem, String userId); + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/CategoryService.java b/nakadai/src/main/java/com/huoran/nakadai/service/CategoryService.java new file mode 100644 index 0000000..5d28684 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/service/CategoryService.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.service; + + +import com.baomidou.mybatisplus.extension.service.IService; +import com.huoran.nakadai.entity.model.Category; + +import java.util.List; + +/** + * @author lanhai + * 商品分类 + */ +public interface CategoryService extends IService { + + /** + * 根据parentId获取分类 + * @param parentId 0 一级分类 + * @return + */ + List listByParentId(Long parentId); + + /** + * 获取用于页面表单展现的category列表,根据seq排序 + * @param shopId 店铺id + * @return + */ + List tableCategory(Integer shopId); + + /** + * 保存分类、品牌、参数 + * @param category + */ + void saveCategory(Category category); + + /** + * 修改分类、品牌、参数 + * @param category + */ + void updateCategory(Category category); + + /** + * 删除分类、品牌、参数 以及分类对应的图片 + * @param categoryId 分类id + */ + void deleteCategory(Long categoryId); + + /** + * 根据店铺id和层级,获取商品分类树 + * @param shopId + * @param grade + * @return + */ + List treeSelect(Integer shopId,int grade); + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/ICustomerService.java b/nakadai/src/main/java/com/huoran/nakadai/service/ICustomerService.java index fc3e80f..3b9a286 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/service/ICustomerService.java +++ b/nakadai/src/main/java/com/huoran/nakadai/service/ICustomerService.java @@ -9,7 +9,6 @@ import com.huoran.nakadai.entity.req.CustomerReq; import com.huoran.nakadai.entity.req.ListOfClientCommercialManagersReq; import com.huoran.nakadai.entity.req.SalesProgressReq; import com.huoran.nakadai.entity.res.AnnualOperatingAnalysisResp; -import com.huoran.nakadai.entity.res.AnnualOperatingAnalysisToStringResp; import com.huoran.nakadai.entity.res.CustomerDetailRes; import org.apache.ibatis.annotations.Param; @@ -47,7 +46,7 @@ public interface ICustomerService extends IService { int updateEnabled(Integer id, Integer isEnable); - int queryCustomerIsExists(Integer schoolId); + Integer queryCustomerIsExists(Integer schoolId); int delCustomers(List ids); diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/MessageService.java b/nakadai/src/main/java/com/huoran/nakadai/service/MessageService.java index 25895e6..3a29598 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/service/MessageService.java +++ b/nakadai/src/main/java/com/huoran/nakadai/service/MessageService.java @@ -1,11 +1,23 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + package com.huoran.nakadai.service; -import com.huoran.common.response.R; +import com.baomidou.mybatisplus.extension.service.IService; +import com.huoran.nakadai.entity.model.Message; -public interface MessageService { - void createQueue(String accountId); - void sendMessageToUser(String message, String accountId); +/** + * + * @author lgh on 2018/10/15. + */ +public interface MessageService extends IService { - R messagesListener(String accountId,Long deliveryTag); } diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/MyOrderService.java b/nakadai/src/main/java/com/huoran/nakadai/service/MyOrderService.java new file mode 100644 index 0000000..141ef4a --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/service/MyOrderService.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.huoran.nakadai.entity.app.dto.MyOrderDto; +import com.huoran.nakadai.entity.model.Order; + +/** + * 我的订单 + * @author lgh + */ +public interface MyOrderService extends IService { + + /** + * 通过用户id和订单状态分页获取订单信息 + * @param page 分页参数 + * @param userId 用户id + * @param status 订单状态 + * @return + */ + IPage pageMyOrderByUserIdAndStatus(Page page, String userId, Integer status); +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/NoticeService.java b/nakadai/src/main/java/com/huoran/nakadai/service/NoticeService.java new file mode 100644 index 0000000..318042b --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/service/NoticeService.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.service; + + + + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.huoran.nakadai.entity.app.dto.NoticeDto; +import com.huoran.nakadai.entity.model.Notice; + +import java.util.List; + +/** + * 公告管理 + * + * @author hzm + * @date 2019-04-18 21:21:40 + */ +public interface NoticeService extends IService { + + /** + * 获取公告列表 + * @return + */ + List listNotice(); + + /** + * 删除公告缓存 + */ + void removeNoticeList(); + + /** + * 分页获取公布的公告 + * @param page + * @return + */ + Page pageNotice(Page page); + + /** + * 根据公告id获取公告 + * @param noticeId + * @return + */ + Notice getNoticeById(Long noticeId); + + /** + * 根据公告id删除公告 + * @param noticeId + */ + void removeNoticeById(Long noticeId); +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/OrderItemService.java b/nakadai/src/main/java/com/huoran/nakadai/service/OrderItemService.java new file mode 100644 index 0000000..7a66ab6 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/service/OrderItemService.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.service; + + +import com.baomidou.mybatisplus.extension.service.IService; +import com.huoran.nakadai.entity.model.OrderItem; + +import java.util.List; + +/** + * + * @author lgh on 2018/09/15. + */ +public interface OrderItemService extends IService { + + /** + * 根据订单编号获取订单项 + * @param orderNumber + * @return + */ + List getOrderItemsByOrderNumber(String orderNumber); + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/OrderService.java b/nakadai/src/main/java/com/huoran/nakadai/service/OrderService.java new file mode 100644 index 0000000..3b33c2e --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/service/OrderService.java @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.service; + +import cn.hutool.core.date.DateTime; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.huoran.nakadai.entity.app.dto.OrderCountData; +import com.huoran.nakadai.entity.app.dto.ShopCartOrderMergerDto; +import com.huoran.nakadai.entity.model.Order; +import com.huoran.nakadai.entity.param.OrderParam; + + +import java.util.Date; +import java.util.List; + +/** + * @author lgh on 2018/09/15. + */ +public interface OrderService extends IService { + + /** + * 根据订单编号获取订单 + * @param orderNumber + * @return + */ + Order getOrderByOrderNumber(String orderNumber); + + /** + * 新增订单缓存 + * @param userId + * @param shopCartOrderMergerDto + * @return + */ + ShopCartOrderMergerDto putConfirmOrderCache(String userId , ShopCartOrderMergerDto shopCartOrderMergerDto); + + /** + * 根据用户id获取订单缓存 + * @param userId + * @return + */ + ShopCartOrderMergerDto getConfirmOrderCache(String userId); + + /** + * 根据用户id删除订单缓存 + * @param userId + */ + void removeConfirmOrderCache(String userId); + + /** + * 提交订单 + * @param userId + * @param mergerOrder + * @return + */ + List submit(String userId, ShopCartOrderMergerDto mergerOrder); + + /** + * 发货 + * @param order + */ + void delivery(Order order); + + /** + * 根据参数获取订单列表 + * @param orderStatus 订单状态 + * @param lessThanUpdateTime 更新时间 + * @return + */ + List listOrderAndOrderItems(Integer orderStatus, DateTime lessThanUpdateTime); + + /** + * 取消订单 + * @param orders + */ + void cancelOrders(List orders); + + /** + * 订单确认收货 + * @param orders + */ + void confirmOrder(List orders); + + /** + * 根据参数获取订单列表 + * @param order 订单参数 + * @param startTime 开始时间 + * @param endTime 结束时间 + * @return + */ + List listOrdersDetailByOrder(Order order, Date startTime, Date endTime); + + /** + * 根据参数分页获取订单 + * @param page + * @param orderParam + * @return + */ + IPage pageOrdersDetailByOrderParam(Page page, OrderParam orderParam); + + /** + * 删除订单 + * @param orders + */ + void deleteOrders(List orders); + + /** + * 根据用户id获取各个状态的订单数目 + * @param userId + * @return + */ + OrderCountData getOrderCount(String userId); +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/OrderSettlementService.java b/nakadai/src/main/java/com/huoran/nakadai/service/OrderSettlementService.java new file mode 100644 index 0000000..4b12980 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/service/OrderSettlementService.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.huoran.nakadai.entity.model.OrderSettlement; + +/** + * + * @author lgh on 2018/11/10. + */ +public interface OrderSettlementService extends IService { + + /** + * 根据内部订单号更新order settlement + * @param outTradeNo 外部单号 + * @param transactionId 支付单号 + */ + void updateSettlementsByPayNo(String outTradeNo, String transactionId); +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/PayService.java b/nakadai/src/main/java/com/huoran/nakadai/service/PayService.java new file mode 100644 index 0000000..0e7249e --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/service/PayService.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.service; + + + +import com.huoran.nakadai.entity.app.param.PayParam; +import com.huoran.nakadai.entity.pay.PayInfoDto; + +import java.util.List; + +/** + * @author lgh on 2018/09/15. + */ +public interface PayService { + + /** + * 支付 + * @param userId + * @param payParam + * @return + */ + PayInfoDto pay(String userId, PayParam payParam); + + /** + * 支付成功 + * @param payNo + * @param bizPayNo + * @return + */ + List paySuccess(String payNo, String bizPayNo); + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/PickAddrService.java b/nakadai/src/main/java/com/huoran/nakadai/service/PickAddrService.java new file mode 100644 index 0000000..0cb7803 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/service/PickAddrService.java @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.huoran.nakadai.entity.model.PickAddr; + +/** + * + * @author lgh on 2018/10/17. + */ +public interface PickAddrService extends IService { + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/PlatformTeamAccountService.java b/nakadai/src/main/java/com/huoran/nakadai/service/PlatformTeamAccountService.java index cdbe3f9..4e10acf 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/service/PlatformTeamAccountService.java +++ b/nakadai/src/main/java/com/huoran/nakadai/service/PlatformTeamAccountService.java @@ -33,4 +33,6 @@ public interface PlatformTeamAccountService extends IService { + /** + * 根据商品id获取商品评论信息 + * @param prodId + * @return + */ + ProdCommDataDto getProdCommDataByProdId(Integer prodId); + + /** + * 根据用户id分页获取商品评论 + * @param page + * @param userId + * @return + */ + IPage getProdCommDtoPageByUserId(Page page, String userId); + + /** + * 根据商品id和评价等级获取商品评价 + * @param page + * @param prodId + * @param evaluate + * @return + */ + IPage getProdCommDtoPageByProdId(Page page, Integer prodId, Integer evaluate); + + /** + * 根据参数分页获取商品评价 + * @param page + * @param prodComm + * @return + */ + IPage getProdCommPage(Page page,ProdComm prodComm); + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/ProdPropService.java b/nakadai/src/main/java/com/huoran/nakadai/service/ProdPropService.java new file mode 100644 index 0000000..370eebb --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/service/ProdPropService.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.huoran.nakadai.entity.model.ProdProp; + +/** + * + * @author lgh on 2018/07/06. + */ +public interface ProdPropService extends IService { + + /** + * 获取属性与属性值 + * @param prodProp + * @param page + * @return + */ + IPage pagePropAndValue(ProdProp prodProp, Page page); + + /** + * 保存属性、属性值 + * @param prodProp + */ + void saveProdPropAndValues(ProdProp prodProp); + + /** + * 更新属性、属性值 + * @param prodProp + */ + void updateProdPropAndValues(ProdProp prodProp); + + /** + * 删除属性、属性值 + * 如果propRule为2,同时删除分类与属性值之间的关联关系 + * @param propId + * @param propRule + * @param shopId + */ + void deleteProdPropAndValues( Integer propId,Integer propRule,Integer shopId); + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/ProdPropValueService.java b/nakadai/src/main/java/com/huoran/nakadai/service/ProdPropValueService.java new file mode 100644 index 0000000..a05b5f2 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/service/ProdPropValueService.java @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.huoran.nakadai.entity.model.ProdPropValue; + +/** + * @author lanhai + */ +public interface ProdPropValueService extends IService { + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/ProdTagReferenceService.java b/nakadai/src/main/java/com/huoran/nakadai/service/ProdTagReferenceService.java new file mode 100644 index 0000000..d9c8207 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/service/ProdTagReferenceService.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.service; + + +import com.baomidou.mybatisplus.extension.service.IService; +import com.huoran.nakadai.entity.model.ProdTagReference; + +import java.util.List; + +/** + * 分组标签引用 + * + * @author hzm + * @date 2019-04-18 16:28:01 + */ +public interface ProdTagReferenceService extends IService { + /** + * 根据id获取标签id列表 + * @param prodId + * @return + */ + List listTagIdByProdId(Integer prodId); +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/ProdTagService.java b/nakadai/src/main/java/com/huoran/nakadai/service/ProdTagService.java new file mode 100644 index 0000000..8983124 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/service/ProdTagService.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.service; + + +import com.baomidou.mybatisplus.extension.service.IService; +import com.huoran.nakadai.entity.model.ProdTag; + +import java.util.List; + +/** + * 商品分组标签 + * + * @author hzm + * @date 2019-04-18 10:48:44 + */ +public interface ProdTagService extends IService { + /** + * 获取商品分组标签列表 + * @return + */ + List listProdTag(); + + /** + * 删除商品分组标签缓存 + */ + void removeProdTag(); +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/ProductService.java b/nakadai/src/main/java/com/huoran/nakadai/service/ProductService.java new file mode 100644 index 0000000..355cc24 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/service/ProductService.java @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.huoran.nakadai.entity.app.dto.ProductDto; +import com.huoran.nakadai.entity.app.dto.TagProductDto; +import com.huoran.nakadai.entity.dto.SearchProdDto; +import com.huoran.nakadai.entity.model.Product; +import com.huoran.nakadai.utils.PageParam; + + +import java.util.List; + +/** + * 商品 + * @author lanhai + */ +public interface ProductService extends IService { + + /** + * 保存商品 + * + * @param product 商品信息 + */ + void saveProduct(Product product); + + /** + * 更新商品 + * @param dbProduct + * @param product 商品信息 + */ + void updateProduct(Product product, Product dbProduct); + + /** + * 根据商品id获取商品信息 + * + * @param prodId + * @return + */ + Product getProductByProdId(Integer prodId); + + /** + * 根据商品id删除商品 + * @param prodId + */ + void removeProductByProdId(Integer prodId); + + /** + * 根据商品id删除缓存 + * @param prodId + */ + void removeProductCacheByProdId(Integer prodId); + + /** + * 根据上架时间倒序分页获取商品 + * @param page + * @return + */ + IPage pageByPutAwayTime(IPage page); + + /** + * 根据标签分页获取商品 + * @param page + * @param tagId + * @return + */ + IPage pageByTagId(Page page, Long tagId); + + /** + * 分页获取销量较高商品 + * @param page + * @return + */ + IPage moreBuyProdList(Page page); + + /** + * 根据分类id分页获取商品列表 + * @param page + * @param categoryId + * @return + */ + IPage pageByCategoryId(Page page, Long categoryId); + + /** + * 根据商品名称 + * @param page + * @param prodName + * @param sort + * @param orderBy + * @return + */ + IPage getSearchProdDtoPageByProdName(Page page, String prodName, Integer sort, Integer orderBy); + + /** + * 分组获取商品列表 + * @return + */ + List tagProdList(); + + /** + * 分页获取收藏商品 + * @param page + * @param userId + * @return + */ + IPage collectionProds(PageParam page, String userId); +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/ShopDetailService.java b/nakadai/src/main/java/com/huoran/nakadai/service/ShopDetailService.java new file mode 100644 index 0000000..498784e --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/service/ShopDetailService.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.huoran.nakadai.entity.model.ShopDetail; + +/** + * + * @author lgh on 2018/08/29. + */ +public interface ShopDetailService extends IService { + /** + * 更新店铺信息 + * @param shopDetail + * @param dbShopDetail + */ + void updateShopDetail(ShopDetail shopDetail,ShopDetail dbShopDetail); + + /** + * 删除店铺详情 + * @param id + */ + void deleteShopDetailByShopId(Integer id); + + /** + * 根据店铺id获取店铺信息 + * @param shopId + * @return + */ + ShopDetail getShopDetailByShopId(Integer shopId); + + /** + * 根据店铺id删除店铺详情信息 + * @param shopId + */ + void removeShopDetailCacheByShopId(Integer shopId); +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/SkuService.java b/nakadai/src/main/java/com/huoran/nakadai/service/SkuService.java new file mode 100644 index 0000000..b8d2a7d --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/service/SkuService.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.huoran.nakadai.entity.model.Sku; + +import java.util.List; + +/** + * + * @author lgh on 2018/09/29. + */ +public interface SkuService extends IService { + + /** + * 根据商品id获取商品中的sku列表(将会被缓存起来) + * @param prodId 商品id + * @return sku列表 + */ + List listByProdId(Integer prodId); + + /** + * 根据skuId获取sku信息(将会被缓存起来) + * @param skuId + * @return + */ + Sku getSkuBySkuId(Integer skuId); + + /** + * 根据商品id和skuId删除缓存 + * @param skuId + * @param prodId + */ + void removeSkuCacheBySkuId(Integer skuId,Integer prodId); +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/impl/BasketServiceImpl.java b/nakadai/src/main/java/com/huoran/nakadai/service/impl/BasketServiceImpl.java new file mode 100644 index 0000000..7265b65 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/service/impl/BasketServiceImpl.java @@ -0,0 +1,212 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.service.impl; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.google.common.collect.Lists; + +import com.huoran.nakadai.entity.app.dto.ShopCartDto; +import com.huoran.nakadai.entity.app.dto.ShopCartItemDto; +import com.huoran.nakadai.entity.app.param.ChangeShopCartParam; +import com.huoran.nakadai.entity.app.param.OrderItemParam; +import com.huoran.nakadai.entity.app.param.ShopCartParam; +import com.huoran.nakadai.entity.model.Basket; +import com.huoran.nakadai.entity.model.Product; +import com.huoran.nakadai.entity.model.ShopDetail; +import com.huoran.nakadai.entity.model.Sku; +import com.huoran.nakadai.mapper.BasketMapper; +import com.huoran.nakadai.service.BasketService; +import com.huoran.nakadai.service.ProductService; +import com.huoran.nakadai.service.ShopDetailService; +import com.huoran.nakadai.service.SkuService; +import com.huoran.nakadai.utils.Arith; +import com.huoran.nakadai.utils.CacheManagerUtil; +import lombok.AllArgsConstructor; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.context.ApplicationContext; +import org.springframework.stereotype.Service; + +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @author lgh on 2018/10/18. + */ +@Service +@AllArgsConstructor +public class BasketServiceImpl extends ServiceImpl implements BasketService { + + private final BasketMapper basketMapper; + + private final CacheManagerUtil cacheManagerUtil; + + private final ApplicationContext applicationContext; + + private final SkuService skuService; + + private final ShopDetailService shopDetailService; + + private final ProductService productService; + + @Override + @CacheEvict(cacheNames = "ShopCartItems", key = "#userId") + public void deleteShopCartItemsByBasketIds(String userId, List basketIds) { + basketMapper.deleteShopCartItemsByBasketIds(userId, basketIds); + } + + @Override + @CacheEvict(cacheNames = "ShopCartItems", key = "#userId") + public void addShopCartItem(ChangeShopCartParam param, String userId) { + Basket basket = new Basket(); + basket.setBasketCount(param.getCount()); + basket.setBasketDate(new Date()); + basket.setProdId(param.getProdId()); + basket.setShopId(param.getShopId()); + basket.setUserId(userId); + basket.setSkuId(param.getSkuId()); + basket.setDistributionCardNo(param.getDistributionCardNo()); + basketMapper.insert(basket); + } + + @Override + @CacheEvict(cacheNames = "ShopCartItems", key = "#basket.userId") + public void updateShopCartItem(Basket basket) { + basketMapper.updateById(basket); + } + + @Override + @CacheEvict(cacheNames = "ShopCartItems", key = "#userId") + public void deleteAllShopCartItems(String userId) { + basketMapper.deleteAllShopCartItems(userId); + } + + @Override + public List getShopCartItems(String userId) { + // 在这个类里面要调用这里的缓存信息,并没有使用aop,所以不使用注解 + List shopCartItemDtoList = cacheManagerUtil.getCache("ShopCartItems", userId); + if (shopCartItemDtoList != null) { + return shopCartItemDtoList; + } + shopCartItemDtoList = basketMapper.getShopCartItems(userId); + for (ShopCartItemDto shopCartItemDto : shopCartItemDtoList) { + shopCartItemDto.setProductTotalAmount(Arith.mul(shopCartItemDto.getProdCount(), shopCartItemDto.getPrice())); + } + cacheManagerUtil.putCache("ShopCartItems", userId, shopCartItemDtoList); + return shopCartItemDtoList; + } + + @Override + public List getShopCartExpiryItems(String userId) { + return basketMapper.getShopCartExpiryItems(userId); + } + + @Override + @CacheEvict(cacheNames = "ShopCartItems", key = "#userId") + public void cleanExpiryProdList(String userId) { + basketMapper.cleanExpiryProdList(userId); + } + + @Override + @CacheEvict(cacheNames = "ShopCartItems", key = "#userId") + public void updateBasketByShopCartParam(String userId, Map basketIdShopCartParamMap) { + basketMapper.updateDiscountItemId(userId, basketIdShopCartParamMap); + } + + @Override + @CacheEvict(cacheNames = "ShopCartItems", key = "#userId") + public void removeShopCartItemsCacheByUserId(String userId) { + + } + + @Override + public List listUserIdByProdId(Integer prodId) { + return basketMapper.listUserIdByProdId(prodId); + } + + @Override + public List getShopCarts(List shopCartItems) { + // 根据店铺ID划分item + Map> shopCartMap = shopCartItems.stream().collect(Collectors.groupingBy(ShopCartItemDto::getShopId)); + + // 返回一个店铺的所有信息 + List shopCartDtos = Lists.newArrayList(); + for (Integer shopId : shopCartMap.keySet()) { + + //获取店铺的所有商品项 + List shopCartItemDtoList = shopCartMap.get(shopId); + + // 构建每个店铺的购物车信息 + ShopCartDto shopCart = new ShopCartDto(); + + //店铺信息 + shopCart.setShopId(shopId); + shopCart.setShopName(shopCartItemDtoList.get(0).getShopName()); + +// applicationContext.publishEvent(new ShopCartEvent(shopCart, shopCartItemDtoList)); + + shopCartDtos.add(shopCart); + } + + return shopCartDtos; + } + + @Override + public List getShopCartItemsByOrderItems(List basketId, OrderItemParam orderItem, String userId) { + if (orderItem == null && CollectionUtil.isEmpty(basketId)) { + return Collections.emptyList(); + } + + // 当立即购买时,没有提交的订单是没有购物车信息的 + if (CollectionUtil.isEmpty(basketId) && orderItem != null) { + + Sku sku = skuService.getSkuBySkuId(orderItem.getSkuId()); + if (sku == null) { + throw new RuntimeException("订单包含无法识别的商品"); + } + Product prod = productService.getProductByProdId(orderItem.getProdId()); + if (prod == null) { + throw new RuntimeException("订单包含无法识别的商品"); + } + + // 拿到购物车的所有item + ShopCartItemDto shopCartItemDto = new ShopCartItemDto(); + shopCartItemDto.setBasketId(-1L); + shopCartItemDto.setSkuId(orderItem.getSkuId()); + shopCartItemDto.setProdCount(orderItem.getProdCount()); + shopCartItemDto.setProdId(orderItem.getProdId()); + shopCartItemDto.setSkuName(sku.getSkuName()); + shopCartItemDto.setPic(StrUtil.isBlank(sku.getPic())? prod.getPic() : sku.getPic()); + shopCartItemDto.setProdName(sku.getProdName()); + shopCartItemDto.setProductTotalAmount(Arith.mul(sku.getPrice(),orderItem.getProdCount())); + shopCartItemDto.setPrice(sku.getPrice()); + shopCartItemDto.setDistributionCardNo(orderItem.getDistributionCardNo()); + shopCartItemDto.setBasketDate(new Date()); + ShopDetail shopDetail = shopDetailService.getShopDetailByShopId(orderItem.getShopId()); + shopCartItemDto.setShopId(shopDetail.getShopId()); + shopCartItemDto.setShopName(shopDetail.getShopName()); + return Collections.singletonList(shopCartItemDto); + } + List dbShopCartItems = getShopCartItems(userId); + + // 返回购物车选择的商品信息 + return dbShopCartItems + .stream() + .filter(shopCartItemDto -> basketId.contains(shopCartItemDto.getBasketId())) + .collect(Collectors.toList()); + } + + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/impl/CategoryServiceImpl.java b/nakadai/src/main/java/com/huoran/nakadai/service/impl/CategoryServiceImpl.java new file mode 100644 index 0000000..c820380 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/service/impl/CategoryServiceImpl.java @@ -0,0 +1,145 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.service.impl; + +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.google.common.collect.Lists; + +import com.huoran.nakadai.entity.model.Category; +import com.huoran.nakadai.mapper.CategoryMapper; +import com.huoran.nakadai.service.CategoryService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @author lanhai + */ +@Service +public class CategoryServiceImpl extends ServiceImpl implements CategoryService { + + @Autowired + private CategoryMapper categoryMapper; + +// @Autowired +// private CategoryBrandMapper categoryBrandMapper; +// +// @Autowired +// private CategoryPropMapper categoryPropMapper; + + + @Override + public List listByParentId(Long parentId) { + return categoryMapper.listByParentId(parentId); + } + + @Override + public List tableCategory(Integer shopId) { + return categoryMapper.tableCategory(shopId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void saveCategory(Category category) { + category.setRecTime(new Date()); + // 保存分类信息 + categoryMapper.insert(category); + +// insertBrandsAndAttributes(category); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void updateCategory(Category category) { + Category dbCategory = categoryMapper.selectById(category.getCategoryId()); + category.setUpdateTime(new Date()); + // 保存分类信息 + categoryMapper.updateById(category); + // 先删除后增加 +// deleteBrandsAndAttributes(category.getCategoryId()); +// insertBrandsAndAttributes(category); + // 如果以前有图片,并且图片与现在不同,则删除以前的图片 +// if (StrUtil.isNotBlank(dbCategory.getPic()) && !dbCategory.getPic().equals(category.getPic())) { +// attachFileService.deleteFile(dbCategory.getPic()); +// } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteCategory(Long categoryId) { + Category category = categoryMapper.selectById(categoryId); + categoryMapper.deleteById(categoryId); + +// deleteBrandsAndAttributes(categoryId); +// if (StrUtil.isNotBlank(category.getPic())) { +// attachFileService.deleteFile(category.getPic()); +// } + } + + +// private void deleteBrandsAndAttributes(Long categoryId) { +// // 删除所有分类所关联的品牌 +// categoryBrandMapper.deleteByCategoryId(categoryId); +// // 删除所有分类所关联的参数 +// categoryPropMapper.deleteByCategoryId(categoryId); +// } + +// private void insertBrandsAndAttributes(Category category) { +// //保存分类与品牌信息 +// if(CollUtil.isNotEmpty(category.getBrandIds())){ +// categoryBrandMapper.insertCategoryBrand(category.getCategoryId(), category.getBrandIds()); +// } +// +// //保存分类与参数信息 +// if(CollUtil.isNotEmpty(category.getAttributeIds())){ +// categoryPropMapper.insertCategoryProp(category.getCategoryId(), category.getAttributeIds()); +// } +// } + + @Override + public List treeSelect(Integer shopId,int grade) { + List categories = categoryMapper.selectList(new LambdaQueryWrapper().le(Category::getGrade,grade).eq(Category::getShopId,shopId)); + return categoryListToTree(categories); + } + + public List categoryListToTree(List categorys){ + if (CollectionUtils.isEmpty(categorys)) { + return Lists.newArrayList(); + } + Map> categoryMap = categorys.stream().collect(Collectors.groupingBy(Category::getParentId)); + + List rootList = categoryMap.get(0L); + transformCategoryTree(rootList,categoryMap); + return rootList; + } + + public void transformCategoryTree(List categorys,Map> categoryMap) { + for (Category category : categorys) { + List nextList = categoryMap.get(category.getCategoryId()); + if (CollectionUtils.isEmpty(nextList)) { + continue; + } + // 将排序完成的list设为下一层级 + category.setCategories(nextList); + // 处理下 下一层级 + transformCategoryTree(nextList, categoryMap); + } + } + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/impl/CurriculumChapterServiceImpl.java b/nakadai/src/main/java/com/huoran/nakadai/service/impl/CurriculumChapterServiceImpl.java index c4888df..ae3e4ab 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/service/impl/CurriculumChapterServiceImpl.java +++ b/nakadai/src/main/java/com/huoran/nakadai/service/impl/CurriculumChapterServiceImpl.java @@ -112,14 +112,14 @@ public class CurriculumChapterServiceImpl extends ServiceImpl wrapper = new QueryWrapper<>(); wrapper.eq("cid", courseChapter.getCid()); - int count = baseMapper.selectCount(wrapper); - if (count == 0) { - courseChapter.setSort(1); - } else { - //查询课程章节最大排序数 - count = baseMapper.selectMaxSort(); - courseChapter.setSort(count + 1); - } +// Long count = baseMapper.selectCount(wrapper); +// if (count == 0) { +// courseChapter.setSort(1); +// } else { +// //查询课程章节最大排序数 +// count = Long.valueOf(baseMapper.selectMaxSort()); +// courseChapter.setSort((int) (count + 1)); +// } int insert = baseMapper.insert(courseChapter); return insert > 0; } diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/impl/CurriculumServiceImpl.java b/nakadai/src/main/java/com/huoran/nakadai/service/impl/CurriculumServiceImpl.java index 9cd1d41..6560460 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/service/impl/CurriculumServiceImpl.java +++ b/nakadai/src/main/java/com/huoran/nakadai/service/impl/CurriculumServiceImpl.java @@ -275,27 +275,27 @@ public class CurriculumServiceImpl extends ServiceImpl schoolCourse = orderMapper.schoolCourse(schoolId); +// List schoolCourse = orderMapper.schoolCourse(schoolId); /*for (SchoolCourseRes res : schoolCourse) { res.setSystemId(configureMapper.getConfigureSystemId(res.getCid())); }*/ - return R.ok().put("data", schoolCourse); + return R.ok().put("data", null); } @Override public R getSchoolEffectiveCourse(Integer schoolId) { - List schoolCourse = orderMapper.getSchoolEffectiveCourse(schoolId); - return R.ok().put("data", schoolCourse); +// List schoolCourse = orderMapper.getSchoolEffectiveCourse(schoolId); + return R.ok().put("data", null); } @Override public R schoolCourseByAchievement(Integer schoolId) { - List schoolCourse = orderMapper.schoolCourseByAchievement(schoolId); - for (SchoolCourseRes res : schoolCourse) { - res.setSystemId(configureMapper.getConfigureSystemId(res.getCid())); - } - return R.ok().put("data", schoolCourse); +// List schoolCourse = orderMapper.schoolCourseByAchievement(schoolId); +// for (SchoolCourseRes res : schoolCourse) { +// res.setSystemId(configureMapper.getConfigureSystemId(res.getCid())); +// } + return R.ok().put("data", null); } /** @@ -335,20 +335,20 @@ public class CurriculumServiceImpl extends ServiceImpl list = orderMapper.schoolCourse(schoolId); - for (SchoolCourseRes s : list) { - str += s.getCid() + ","; - } +// List list = orderMapper.schoolCourse(schoolId); +// for (SchoolCourseRes s : list) { +// str += s.getCid() + ","; +// } return str.substring(0, str.length() - 1); } @Override public R whetherToRenewTheFee(Integer schoolId, Integer mallId) { - SchoolCourseRes res = orderMapper.whetherToRenewTheFee(schoolId,mallId); - //返回是否续费 0表示没有该月订单的课程(显示续约按钮) 1表示正常显示课程 - if (res==null){ - return R.ok().put("isRenew",0); - } +// SchoolCourseRes res = orderMapper.whetherToRenewTheFee(schoolId,mallId); +// //返回是否续费 0表示没有该月订单的课程(显示续约按钮) 1表示正常显示课程 +// if (res==null){ +// return R.ok().put("isRenew",0); +// } return R.ok().put("isRenew",1); } } diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/impl/CurriculumSubsectionServiceImpl.java b/nakadai/src/main/java/com/huoran/nakadai/service/impl/CurriculumSubsectionServiceImpl.java index c389420..431915b 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/service/impl/CurriculumSubsectionServiceImpl.java +++ b/nakadai/src/main/java/com/huoran/nakadai/service/impl/CurriculumSubsectionServiceImpl.java @@ -50,16 +50,16 @@ public class CurriculumSubsectionServiceImpl extends ServiceImpl wrapper = new QueryWrapper<>(); - wrapper.eq("chapter_id", courseSubsection.getChapterId()); - int count = baseMapper.selectCount(wrapper); - if (count == 0) { - courseSubsection.setSort(1); - } else { - //查询章节小节最大排序数 - count = baseMapper.selectMaxSort(); - courseSubsection.setSort(count + 1); - } +// QueryWrapper wrapper = new QueryWrapper<>(); +// wrapper.eq("chapter_id", courseSubsection.getChapterId()); +// int count = baseMapper.selectCount(wrapper); +// if (count == 0) { +// courseSubsection.setSort(1); +// } else { +// //查询章节小节最大排序数 +// count = baseMapper.selectMaxSort(); +// courseSubsection.setSort(count + 1); +// } int insert = baseMapper.insert(courseSubsection); return insert > 0; } diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/impl/CustomerServiceImpl.java b/nakadai/src/main/java/com/huoran/nakadai/service/impl/CustomerServiceImpl.java index 44032fc..e61b962 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/service/impl/CustomerServiceImpl.java +++ b/nakadai/src/main/java/com/huoran/nakadai/service/impl/CustomerServiceImpl.java @@ -201,17 +201,17 @@ public class CustomerServiceImpl extends ServiceImpl i //根据数据权限查询客户 //查询课程的数据权限订单id HashSet orderIds = new HashSet<>(); - if (!cIds.isEmpty()) { - orderIds = orderMapper.dataPermissionOrderId(cIds); - } - //查询数据产品的数据权限订单id - HashSet dataProductOrderIds = orderMapper.dataPermissionOrderIdByDataProduct(customerListReq.getSupplierId()); - orderIds.addAll(dataProductOrderIds); - //查询增值权限订单id - HashSet valueOrderIds = orderMapper.valuePermissionOrderIds(); - orderIds.addAll(valueOrderIds); - List customerIds = baseMapper.selectDataPermissionCustomer(orderIds); - customerListReq.setCustomerIds(customerIds); +// if (!cIds.isEmpty()) { +// orderIds = orderMapper.dataPermissionOrderId(cIds); +// } +// //查询数据产品的数据权限订单id +// HashSet dataProductOrderIds = orderMapper.dataPermissionOrderIdByDataProduct(customerListReq.getSupplierId()); +// orderIds.addAll(dataProductOrderIds); +// //查询增值权限订单id +// HashSet valueOrderIds = orderMapper.valuePermissionOrderIds(); +// orderIds.addAll(valueOrderIds); +// List customerIds = baseMapper.selectDataPermissionCustomer(orderIds); + customerListReq.setCustomerIds(null); } IPage positionVO = baseMapper.pageByCondition(new Page(page, size), customerListReq); return new PageUtils(positionVO); @@ -307,7 +307,7 @@ public class CustomerServiceImpl extends ServiceImpl i } @Override - public int queryCustomerIsExists(Integer schoolId) { + public Integer queryCustomerIsExists(Integer schoolId) { return this.baseMapper.selectCount(new QueryWrapper().eq("is_del", 0).eq("school_id", schoolId)); } @@ -437,17 +437,17 @@ public class CustomerServiceImpl extends ServiceImpl i //根据数据权限查询客户 //查询课程的数据权限订单id HashSet orderIds = new HashSet<>(); - if (!cIds.isEmpty()) { - orderIds = orderMapper.dataPermissionOrderId(cIds); - } - //查询数据产品的数据权限订单id - HashSet dataProductOrderIds = orderMapper.dataPermissionOrderIdByDataProduct(customerListReq.getSupplierId()); - orderIds.addAll(dataProductOrderIds); - //查询增值权限订单id - HashSet valueOrderIds = orderMapper.valuePermissionOrderIds(); - orderIds.addAll(valueOrderIds); - List customerIds = baseMapper.selectDataPermissionCustomer(orderIds); - customerListReq.setCustomerIds(customerIds); +// if (!cIds.isEmpty()) { +// orderIds = orderMapper.dataPermissionOrderId(cIds); +// } +// //查询数据产品的数据权限订单id +// HashSet dataProductOrderIds = orderMapper.dataPermissionOrderIdByDataProduct(customerListReq.getSupplierId()); +// orderIds.addAll(dataProductOrderIds); +// //查询增值权限订单id +// HashSet valueOrderIds = orderMapper.valuePermissionOrderIds(); +// orderIds.addAll(valueOrderIds); +// List customerIds = baseMapper.selectDataPermissionCustomer(orderIds); + customerListReq.setCustomerIds(null); } // IPage positionVO = baseMapper.pageByCondition(new Page(customerListReq.getPage(), customerListReq.getSize()), customerListReq); diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/impl/MallServiceImpl.java b/nakadai/src/main/java/com/huoran/nakadai/service/impl/MallServiceImpl.java index 6120116..905ba15 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/service/impl/MallServiceImpl.java +++ b/nakadai/src/main/java/com/huoran/nakadai/service/impl/MallServiceImpl.java @@ -12,6 +12,7 @@ import com.huoran.common.exception.ExceptionEnum; import com.huoran.common.response.R; import com.huoran.common.utils.TokenUtils; import com.huoran.nakadai.entity.*; +import com.huoran.nakadai.entity.model.OrderItem; import com.huoran.nakadai.entity.req.GoodsListReq; import com.huoran.nakadai.entity.res.GoodsRes; import com.huoran.nakadai.entity.vo.GoodsVo; @@ -298,6 +299,7 @@ public class MallServiceImpl extends ServiceImpl implements Ma public R createEmptyPage() { IPage iPage = new IPage() { + @Override public List getRecords() { return null; diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/impl/MessageServiceImpl.java b/nakadai/src/main/java/com/huoran/nakadai/service/impl/MessageServiceImpl.java index 650aaca..c8e074d 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/service/impl/MessageServiceImpl.java +++ b/nakadai/src/main/java/com/huoran/nakadai/service/impl/MessageServiceImpl.java @@ -1,89 +1,31 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + package com.huoran.nakadai.service.impl; -import com.huoran.common.constant.RabbitmqConstant; -import com.huoran.common.response.R; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.huoran.nakadai.entity.model.Message; +import com.huoran.nakadai.mapper.MessageMapper; import com.huoran.nakadai.service.MessageService; -import com.huoran.nakadai.utils.ContextUtils; -import com.rabbitmq.client.Channel; -import org.springframework.amqp.core.AmqpAdmin; -import org.springframework.amqp.core.Binding; -import org.springframework.amqp.core.Message; -import org.springframework.amqp.core.Queue; -import org.springframework.amqp.rabbit.core.RabbitTemplate; -import org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer; -import org.springframework.amqp.rabbit.listener.api.ChannelAwareMessageListener; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.ArrayList; -import java.util.List; - +/** + * + * @author lgh on 2018/10/15. + */ @Service -public class MessageServiceImpl implements MessageService { +public class MessageServiceImpl extends ServiceImpl implements MessageService { @Autowired - private AmqpAdmin amqpAdmin; - - @Autowired - private RabbitTemplate rabbitTemplate; - - @Override - public void createQueue(String accountId) { - //根据当前用户创建队列并绑定交换机 - String queueName = accountId + RabbitmqConstant.COMMENT_QUEUE; - Queue queue = new Queue(queueName,true,false,false,null); - amqpAdmin.declareQueue(queue); - String routingKey = accountId + RabbitmqConstant.COMMENT_ROUTING_KEY; - /* - * String destination, 目的地 - * DestinationType destinationType, 目的地类型 - * String exchange,交换机 - * String routingKey,路由键 - * @Nullable Map arguments 自定义参数 - */ - Binding binding = new Binding(queueName, - Binding.DestinationType.QUEUE, - RabbitmqConstant.COMMENT_EXCHANGE,routingKey,null); - amqpAdmin.declareBinding(binding); - } - - @Override - public void sendMessageToUser(String message, String accountId) { - String routingKey = accountId + RabbitmqConstant.COMMENT_ROUTING_KEY; - rabbitTemplate.convertAndSend(RabbitmqConstant.COMMENT_EXCHANGE, routingKey,message); - } - - @Override - public R messagesListener(String accountId,Long deliveryTag){ - SimpleMessageListenerContainer container = ContextUtils.getBean(SimpleMessageListenerContainer.class); - String oneQueueNames = accountId + RabbitmqConstant.COMMENT_QUEUE; - - List list = new ArrayList<>(); - container.addQueueNames(oneQueueNames); - container.setMessageListener(new ChannelAwareMessageListener() { - - @Override - public void onMessage(Message message, Channel channel) { - System.out.println(message); - /*list.add(message.getBody().toString()); - try { - if (deliveryTag!=null){ - //消息确认 - channel.basicAck(deliveryTag,false); - } - -*//* long deliveryTagM = message.getMessageProperties().getDeliveryTag(); - if (deliveryTag==null || deliveryTagM!=deliveryTag){ - //消息返回 - channel.basicNack(deliveryTagM,false,true); - }*//* - } catch (IOException e) { - throw new RuntimeException(e); - } -*/ - } - }); - return R.ok().put("list",list); - } + private MessageMapper messageMapper; } diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/impl/MyOrderServiceImpl.java b/nakadai/src/main/java/com/huoran/nakadai/service/impl/MyOrderServiceImpl.java new file mode 100644 index 0000000..e96d1fd --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/service/impl/MyOrderServiceImpl.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +import com.huoran.nakadai.entity.app.dto.MyOrderDto; +import com.huoran.nakadai.entity.model.Order; +import com.huoran.nakadai.mapper.OrderMapper; +import com.huoran.nakadai.service.MyOrderService; +import com.huoran.nakadai.utils.PageAdapter; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * @author lgh on 2018/09/15. + */ +@Service +public class MyOrderServiceImpl extends ServiceImpl implements MyOrderService { + + @Autowired + private OrderMapper orderMapper; + + @Override + public IPage pageMyOrderByUserIdAndStatus(Page page, String userId, Integer status) { + page.setRecords(orderMapper.listMyOrderByUserIdAndStatus(new PageAdapter(page), userId, status)); + page.setTotal(orderMapper.countMyOrderByUserIdAndStatus(userId, status)); + return page; + } + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/impl/NoticeServiceImpl.java b/nakadai/src/main/java/com/huoran/nakadai/service/impl/NoticeServiceImpl.java new file mode 100644 index 0000000..b12bfea --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/service/impl/NoticeServiceImpl.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.service.impl; + + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +import com.huoran.nakadai.entity.app.dto.NoticeDto; +import com.huoran.nakadai.entity.model.Notice; +import com.huoran.nakadai.mapper.NoticeMapper; +import com.huoran.nakadai.service.NoticeService; +import lombok.AllArgsConstructor; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 公告管理 + * + * @author hzm + * @date 2019-04-18 21:21:40 + */ +@Service +@AllArgsConstructor +public class NoticeServiceImpl extends ServiceImpl implements NoticeService { + + private NoticeMapper noticeMapper; + + @Override + @Cacheable(cacheNames = "notices", key = "'notices'") + public List listNotice() { + return noticeMapper.selectList(new LambdaQueryWrapper() + .eq(Notice::getStatus, 1) + .eq(Notice::getIsTop, 1) + .orderByDesc(Notice::getPublishTime)); + } + + @Override + @CacheEvict(cacheNames = "notices", key = "'notices'") + public void removeNoticeList() { + } + + @Override + public Page pageNotice(Page page) { + return noticeMapper.pageNotice(page); + } + + @Override + @Cacheable(cacheNames = "notice", key = "#noticeId") + public Notice getNoticeById(Long noticeId) { + return noticeMapper.selectById(noticeId); + } + + @Override + @CacheEvict(cacheNames = "notice", key = "#noticeId") + public void removeNoticeById(Long noticeId) { + } + + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/impl/OrderItemServiceImpl.java b/nakadai/src/main/java/com/huoran/nakadai/service/impl/OrderItemServiceImpl.java new file mode 100644 index 0000000..35fdf84 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/service/impl/OrderItemServiceImpl.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +import com.huoran.nakadai.entity.model.OrderItem; +import com.huoran.nakadai.mapper.OrderItemMapper; +import com.huoran.nakadai.service.OrderItemService; +import lombok.AllArgsConstructor; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * + * @author lgh on 2018/09/15. + */ +@Service +@AllArgsConstructor +public class OrderItemServiceImpl extends ServiceImpl implements OrderItemService { + + private final OrderItemMapper orderItemMapper; + + @Override + @Cacheable(cacheNames = "OrderItems", key = "#orderNumber") + public List getOrderItemsByOrderNumber(String orderNumber) { + return orderItemMapper.listByOrderNumber(orderNumber); + } + + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/impl/OrderOtherServiceImpl.java b/nakadai/src/main/java/com/huoran/nakadai/service/impl/OrderOtherServiceImpl.java index d824d8c..655f997 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/service/impl/OrderOtherServiceImpl.java +++ b/nakadai/src/main/java/com/huoran/nakadai/service/impl/OrderOtherServiceImpl.java @@ -72,12 +72,12 @@ public class OrderOtherServiceImpl extends ServiceImpl 0; } @@ -95,12 +95,12 @@ public class OrderOtherServiceImpl extends ServiceImpl0){ orderOtherList.forEach(orderOther -> { //产品到期、查询客户所有订单产品是否都到期 - if (orderOther.getRemainingPeriod()==0){ - Integer orderId = orderOther.getOrderId(); - Order order = orderMapper.selectById(orderId); - List customerList = orderMapper.selectList(new QueryWrapper(). - eq("customer_id", order.getCustomerId())); - List type = new ArrayList<>(); - // 订单类型(1、正式 2、试用) - for (Order orderInfo : customerList){ - type.add(orderInfo.getOrderType()); - } - List allOrderOther = new ArrayList<>(); - customerList.forEach(customerOrder -> { - List other = baseMapper.selectList(new QueryWrapper() - .eq("order_id", customerOrder.getOrderId())); - if (ObjectUtil.isNotNull(other) && other.size()>0){ - allOrderOther.addAll(other); - } - }); - List remainingPeriod = new ArrayList<>(); - allOrderOther.forEach(customerOrderOther -> { - remainingPeriod.add(customerOrderOther.getRemainingPeriod()); - }); - Customer customer = customerMapper.selectById(order.getCustomerId()); - HashSet set = new HashSet<>(remainingPeriod); - //订单产品都过期,更新客户类型为到期 - if (set.size()==1&&set.contains(0)){ - customer.setCustomerType(3); - }else { - //有正式订单 - boolean contains = type.contains(1); - if (contains) { - customer.setCustomerType(1); - }else { - customer.setCustomerType(2); - } - } - //更新客户类型 - customerMapper.updateById(customer); - } +// if (orderOther.getRemainingPeriod()==0){ +// Integer orderId = orderOther.getOrderId(); +// Order order = orderMapper.selectById(orderId); +// List customerList = orderMapper.selectList(new QueryWrapper(). +// eq("customer_id", order.getCustomerId())); +// List type = new ArrayList<>(); +// // 订单类型(1、正式 2、试用) +// for (Order orderInfo : customerList){ +// type.add(orderInfo.getOrderType()); +// } +// List allOrderOther = new ArrayList<>(); +// customerList.forEach(customerOrder -> { +// List other = baseMapper.selectList(new QueryWrapper() +// .eq("order_id", customerOrder.getOrderId())); +// if (ObjectUtil.isNotNull(other) && other.size()>0){ +// allOrderOther.addAll(other); +// } +// }); +// List remainingPeriod = new ArrayList<>(); +// allOrderOther.forEach(customerOrderOther -> { +// remainingPeriod.add(customerOrderOther.getRemainingPeriod()); +// }); +// Customer customer = customerMapper.selectById(order.getCustomerId()); +// HashSet set = new HashSet<>(remainingPeriod); +// //订单产品都过期,更新客户类型为到期 +// if (set.size()==1&&set.contains(0)){ +// customer.setCustomerType(3); +// }else { +// //有正式订单 +// boolean contains = type.contains(1); +// if (contains) { +// customer.setCustomerType(1); +// }else { +// customer.setCustomerType(2); +// } +// } +// //更新客户类型 +// customerMapper.updateById(customer); +// } }); } } @@ -226,8 +226,8 @@ public class OrderOtherServiceImpl extends ServiceImpl().eq("school_id", schoolId)); //查询客户订单 - List orderList = orderMapper.selectList(new QueryWrapper().eq("customer_id", customer.getCustomerId())); - //查询所有订单内容 - ArrayList orderOthers = Lists.newArrayList(); - orderList.forEach(order -> { - //已发货、课程权限、启用、未过期 - List orderOtherList = baseMapper.selectList(new QueryWrapper() - .eq("order_id", order.getOrderId()) - .eq("ship",1) - .eq("authority",1) - .eq("is_enable",1) - .ge("remaining_period",0)); - orderOthers.addAll(orderOtherList); - }); +// List orderList = orderMapper.selectList(new QueryWrapper().eq("customer_id", customer.getCustomerId())); +// //查询所有订单内容 +// ArrayList orderOthers = Lists.newArrayList(); +// orderList.forEach(order -> { +// //已发货、课程权限、启用、未过期 +// List orderOtherList = baseMapper.selectList(new QueryWrapper() +// .eq("order_id", order.getOrderId()) +// .eq("ship",1) +// .eq("authority",1) +// .eq("is_enable",1) +// .ge("remaining_period",0)); +// orderOthers.addAll(orderOtherList); +// }); ArrayList curriculumConfigures = Lists.newArrayList(); //查询购买的所有课程中系统的项目 - orderOthers.forEach(orderOther -> { - //展示、未删除、系统查询 - List curriculumConfigureList = configureMapper.selectList(new QueryWrapper() - .eq("cid", orderOther.getDataOrCourseId()) - .eq("is_show", 0) - .eq("is_del", 0) - .eq("system_id", systemId)); - curriculumConfigures.addAll(curriculumConfigureList); - }); +// orderOthers.forEach(orderOther -> { +// //展示、未删除、系统查询 +// List curriculumConfigureList = configureMapper.selectList(new QueryWrapper() +// .eq("cid", orderOther.getDataOrCourseId()) +// .eq("is_show", 0) +// .eq("is_del", 0) +// .eq("system_id", systemId)); +// curriculumConfigures.addAll(curriculumConfigureList); +// }); //获取项目集合 HashSet set = new HashSet<>(); diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/impl/OrderServiceImpl.java b/nakadai/src/main/java/com/huoran/nakadai/service/impl/OrderServiceImpl.java index efb4333..75e4fc4 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/service/impl/OrderServiceImpl.java +++ b/nakadai/src/main/java/com/huoran/nakadai/service/impl/OrderServiceImpl.java @@ -1,759 +1,169 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + package com.huoran.nakadai.service.impl; -import cn.afterturn.easypoi.excel.ExcelExportUtil; -import cn.afterturn.easypoi.excel.entity.ExportParams; -import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.StrUtil; -import cn.hutool.json.JSONObject; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.date.DateTime; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.huoran.common.constant.OrderConstant; -import com.huoran.common.response.R; -import com.huoran.common.utils.DateUtils; -import com.huoran.nakadai.entity.*; -import com.huoran.nakadai.entity.req.GetTheSystemUnderTheProductReq; -import com.huoran.nakadai.entity.req.ListOfClientCommercialManagersReq; -import com.huoran.nakadai.entity.req.OrderListReq; -import com.huoran.nakadai.entity.req.OrderRecordParametersReq; -import com.huoran.nakadai.entity.res.*; -import com.huoran.nakadai.entity.vo.OrderVo; -import com.huoran.nakadai.entity.vo.WxMssVo; -import com.huoran.nakadai.mapper.*; -import com.huoran.nakadai.service.IOrderService; -import com.huoran.nakadai.service.MallClassificationService; -import com.huoran.nakadai.service.MallTypeService; -import com.huoran.nakadai.service.ProductTypeService; -import com.huoran.nakadai.utils.ExcelStyleUtil; -import com.huoran.nakadai.utils.WeChatUtil; -import org.apache.commons.lang3.StringUtils; -import org.apache.poi.ss.usermodel.Workbook; -import org.springframework.beans.factory.annotation.Autowired; + +import com.huoran.nakadai.entity.app.dto.OrderCountData; +import com.huoran.nakadai.entity.app.dto.ShopCartOrderMergerDto; +import com.huoran.nakadai.entity.model.Order; +import com.huoran.nakadai.entity.model.OrderItem; +import com.huoran.nakadai.entity.param.OrderParam; +import com.huoran.nakadai.mapper.OrderItemMapper; +import com.huoran.nakadai.mapper.OrderMapper; +import com.huoran.nakadai.mapper.ProductMapper; +import com.huoran.nakadai.mapper.SkuMapper; +import com.huoran.nakadai.service.OrderService; +import com.huoran.nakadai.utils.PageAdapter; +import lombok.AllArgsConstructor; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.CachePut; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.context.ApplicationEventPublisher; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.net.URLEncoder; -import java.text.ParseException; -import java.text.SimpleDateFormat; import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.ThreadPoolExecutor; import java.util.stream.Collectors; /** - *

- * 订单表 服务实现类 - *

- * - * @author huoran - * @since 2021-06-28 + * @author lgh on 2018/09/15. */ @Service -public class OrderServiceImpl extends ServiceImpl implements IOrderService { - - @Autowired - private OrderOtherMapper orderOtherMapper; - - @Autowired - private DataProductMapper dataProductMapper; - - @Autowired - private CurriculumMapper curriculumMapper; - - @Autowired - private HrContractInformationMapper contractInformationMapper; +@AllArgsConstructor +public class OrderServiceImpl extends ServiceImpl implements OrderService { - @Autowired - private CustomerMapper customerMapper; + private final OrderMapper orderMapper; - @Autowired - private HrStaffMapper staffMapper; + private final SkuMapper skuMapper; - @Autowired - private PartnerAccountMapper partnerAccountMapper; + private final OrderItemMapper orderItemMapper; - @Autowired - private PartnerClassificationMapper classificationMapper; + private final ProductMapper productMapper; - @Autowired - ThreadPoolExecutor executor; - @Autowired - private PartnerTeamMapper teamMapper; + private final ApplicationEventPublisher eventPublisher; - @Autowired - private MallClassificationService mallClassificationService; - - @Autowired - private MallTypeService mallTypeService; - - @Autowired - private ProductTypeService productTypeService; - - @Autowired - private MallNonAssociatedLinksMapper mallNonAssociatedLinksMapper; - - /** - * 为客户添加订单,保存订单客户信息、订单内容、合同信息 - * 订单生成后根据订单内容相关数据权限将该客户添加所属平台 - * 新客户并成为该平台下的超级管理员,拥有该平台的所有权限 - * - * @param orderVo 订单信息 - * @return true/false - */ @Override - @Transactional - public R addOrder(OrderVo orderVo) throws ExecutionException, InterruptedException { - Order order = orderVo.getOrder(); - List orderOtherList = orderVo.getOrderOther(); - HrContractInformation contractInformation = orderVo.getContractInformation(); - - CompletableFuture orderFuture = CompletableFuture.supplyAsync(() -> { - //根据时间戳生成订单号 - String orderNumber = String.valueOf(new Date().getTime()); - order.setOrderNumber(orderNumber); - //添加订单基本信息 - baseMapper.insert(order); - return order.getOrderId(); - }, executor); - - CompletableFuture contractInformationFuture = orderFuture.thenAcceptAsync(orderId -> { - //如果合同存在,则保存合同信息 - if (ObjectUtil.isNotNull(contractInformation)) { - contractInformation.setOrderId(orderId); - contractInformationMapper.insert(contractInformation); - } - }, executor); - - //根据订单类型修改客户类型 - CompletableFuture customerFuture = orderFuture.thenAcceptAsync(orderId -> { - List type = new ArrayList<>(); - Customer customer = customerMapper.selectById(order.getCustomerId()); - //查询客户所有订单 - List customerOrderList = baseMapper.selectList(new QueryWrapper().eq("customer_id", order.getCustomerId())); - // 订单类型(1、正式 2、试用) - for (Order orderInfo : customerOrderList) { - type.add(orderInfo.getOrderType()); - } - //有正式订单 - boolean contains = type.contains(1); - if (contains) { - customer.setCustomerType(1); - } else { - customer.setCustomerType(2); - } - //更新客户类型 - customerMapper.updateById(customer); - }, executor); - - List ship = new ArrayList<>(); - - CompletableFuture orderOtherFuture = orderFuture.thenAcceptAsync(orderId -> { - //添加订单其他信息 - for (OrderOther orderOther : orderOtherList) { - //开始时间取前一天的后一分钟,达成续费无缝连接 - orderOther.setStartTime(getDateAfterTime(orderOther.getStartTime())); - Integer dataId = orderOther.getDataOrCourseId(); - //添加数据平台信息,对应订单数量增加 - if (OrderConstant.DATA_AUTHORITY.equals(orderOther.getAuthority())) { - DataProduct dataProduct = dataProductMapper.selectById(dataId); - dataProduct.setOrderNum(dataProduct.getOrderNum() + 1); - dataProductMapper.updateById(dataProduct); - } - - orderOther.setOrderId(orderId); - //是否发货(0未发货,1已发货,默认不发货) - if (orderOther.getShip().equals(OrderConstant.SHIPPED)) { - //添加发货时间 - orderOther.setShipTime(new Date()); - } - - orderOtherMapper.insert(orderOther); - ship.add(orderOther.getShip()); - } - }, executor); - - CompletableFuture updateFuture = orderOtherFuture.thenRunAsync(() -> { - //更新订单发货状态 - boolean contains = ship.contains(0); - if (!contains) { - order.setOrderStatus(OrderConstant.SHIPPED); - } - baseMapper.updateById(order); - }, executor); - - CompletableFuture updateCustomerExpireDateFuture = orderOtherFuture.thenRunAsync(() -> { - //更新客户过期时间 - //查询客户产品最后的过期时间 - String ExpireDate = baseMapper.selectCustomerExpireDate(order.getCustomerId()); - Customer customer = new Customer(); - customer.setCustomerId(order.getCustomerId()); - customer.setExpireDate(DateUtil.parseDate(ExpireDate)); - //更新时间 - customerMapper.updateById(customer); - }, executor); - - //等待所有任务都完成 - CompletableFuture.allOf(contractInformationFuture, orderOtherFuture, updateFuture, customerFuture, updateCustomerExpireDateFuture).get(); - - if (orderFuture.get() > 0) { - return R.ok().put("orderId", order.getOrderId()); - } - return R.error(); + public Order getOrderByOrderNumber(String orderNumber) { + return orderMapper.getOrderByOrderNumber(orderNumber); } - /** - * 获取某个时间,前一天的后一分钟 - * @param startTime s - */ - public static Date getDateAfterTime(Date startTime) { - try { -// SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - Calendar cal = Calendar.getInstance(); - cal.setTime(startTime); - cal.add(Calendar.DATE, -1); - cal.add(Calendar.MINUTE, 1); -// System.out.println(df.format(cal.getTime())); - return cal.getTime(); - } catch (Exception e) { - e.printStackTrace(); - return null; - } + @Override + @CachePut(cacheNames = "ConfirmOrderCache", key = "#userId") + public ShopCartOrderMergerDto putConfirmOrderCache(String userId, ShopCartOrderMergerDto shopCartOrderMergerDto) { + return shopCartOrderMergerDto; } @Override - public HashMap orderList(OrderListReq orderListReq) { - if (orderListReq.getSort() == null) { - orderListReq.setSort(0); - } - //查询包含供应商配置的课程 - List cIds = curriculumMapper.selectCurriculumBySupplier(orderListReq.getSupplierId()); - //查询课程的数据权限订单id - HashSet orderIds = new HashSet<>(); - if (!cIds.isEmpty()) { - orderIds = baseMapper.dataPermissionOrderId(cIds); - } - //查询数据产品的数据权限订单id - HashSet dataProductOrderIds = baseMapper.dataPermissionOrderIdByDataProduct(orderListReq.getSupplierId()); - orderIds.addAll(dataProductOrderIds); - //查询增值权限订单id - HashSet valueOrderIds = baseMapper.valuePermissionOrderIds(); - orderIds.addAll(valueOrderIds); - //查询商品管理的相关数据订单id - HashSet goodsOrderIds = baseMapper.selectGoodsOrderId(orderListReq.getSupplierId()); - orderIds.addAll(goodsOrderIds); - - orderListReq.setOrderIds(orderIds); - orderListReq.setPageNo((orderListReq.getPageNo() - 1) * orderListReq.getPageSize()); - List orders = baseMapper.selectOrderPage(orderListReq); - orders.forEach(order -> { - Integer orderId = order.getOrderId(); - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("order_id", orderId); - List orderOtherList = orderOtherMapper.selectList(wrapper); - String orderContent = ""; - if (orderOtherList != null && orderOtherList.size() != 0) { - for (OrderOther orderOther : orderOtherList) { - orderContent += orderOther.getProductName() + ","; - } - order.setOrderContent(orderContent.substring(0, orderContent.length() - 1)); - } - }); - int total = baseMapper.selectTotalNum(orderListReq); - HashMap hashMap = new HashMap<>(); - hashMap.put("orders", orders); - hashMap.put("total", total); - return hashMap; + @Cacheable(cacheNames = "ConfirmOrderCache", key = "#userId") + public ShopCartOrderMergerDto getConfirmOrderCache(String userId) { + return null; } @Override - public OrderVo queryOrderDetails(Integer orderId) { - OrderVo orderVo = new OrderVo(); - Order order = baseMapper.selectById(orderId); - String city = baseMapper.selectCity(order.getCityId(), order.getProvinceId()); - String province = baseMapper.selectProvince(order.getProvinceId()); - order.setCityName(city); - order.setProvinceName(province); - - //查询商务经理信息,删除数据也查询 - if (order.getTeamId() != null) { - PartnerClassification partnerClassification = classificationMapper.selectTeamNameById(order.getTeamId()); - order.setTeamName(partnerClassification.getPartnerClassificationName()); - String businessManagerId = order.getBusinessManagerId(); - if (StrUtil.isNotEmpty(businessManagerId)) { - PartnerAccount partnerAccount = partnerAccountMapper.selectAccountByPartnerId(businessManagerId); - Integer accountId = partnerAccount.getAccountId(); - Integer userId = staffMapper.getUserId(accountId); - String userNameById = staffMapper.selectUserNameById(userId); - order.setBusinessManagerName(userNameById); - String openid = baseMapper.selectOpenid(accountId); - //查询用户openid - order.setOpenid(openid); - } - } - - - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("order_id", orderId); - List orderOtherList = orderOtherMapper.selectList(wrapper); - - orderOtherList.forEach(orderOther -> { - //课程产品 区分权限(0为数据平台权限,1为课程权限,2为职站增值模块,3为实训课程(非集成),4为实验工具,对应id为商城管理中的产品) - if (orderOther.getAuthority() == 1) { - /*QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.or().eq( "is_del", DelConstant.IS_DEL); - queryWrapper.eq("cid",orderOther.getDataOrCourseId());*/ - Curriculum curriculum = curriculumMapper.courseListDeletedNotDeleted(orderOther.getDataOrCourseId()); - if (curriculum!=null){ - orderOther.setProductType(curriculum.getCurriculumType()); - orderOther.setMiniProgramPictureAddress(curriculum.getMiniProgramPictureAddress()); - orderOther.setOriginalSettlementPrice(curriculum.getSettlementPrice()); - orderOther.setSettlementMethod(curriculum.getSettlementMethod()); - orderOther.setSupplier(curriculum.getSupplier()); - orderOther.setBusinessProportion(curriculum.getBusinessProportion()); - orderOther.setManufacturerProportion(curriculum.getManufacturerProportion()); - orderOther.setMarketPrice(curriculum.getMarketPrice()); - orderOther.setIsShelves(curriculum.getIsShelves()); - } - } else if (orderOther.getAuthority() == 0) { - //数据产品 - DataProduct dataProduct = dataProductMapper.selectById(orderOther.getDataOrCourseId()); - if (dataProduct!=null){ - orderOther.setOriginalSettlementPrice(dataProduct.getSettlementPrice()); - orderOther.setProductType(3); - orderOther.setSettlementMethod(dataProduct.getSettlementMethod()); - orderOther.setSupplier(dataProduct.getSupplier()); - orderOther.setBusinessProportion(dataProduct.getBusinessProportion()); - orderOther.setManufacturerProportion(dataProduct.getManufacturerProportion()); -// orderOther.setMarketPrice(new BigDecimal(dataProduct.getMarket())); - } - }else { - //查询产品链接 - if (orderOther.getMallId()!=null){ - List mallNonAssociatedLinks = mallNonAssociatedLinksMapper.selectList(new QueryWrapper().eq("mall_id", orderOther.getMallId())); - orderOther.setMallNonAssociatedLinks(mallNonAssociatedLinks); - } - } - - if (orderOther.getMallId()!=null){ - //查询分类 - List classifications = mallClassificationService.list(new QueryWrapper().eq("mall_id", orderOther.getMallId())); - List classificationIds = classifications.stream().map(MallClassification::getClassificationId).collect(Collectors.toList()); - for (Integer classificationId : classificationIds) { - orderOther.setMallClassificationId(classificationId); - } - //查询类型 - List mallTypes = mallTypeService.list(new QueryWrapper().eq("mall_id", orderOther.getMallId())); - List mallTypeIds = mallTypes.stream().map(MallType::getTypeId).collect(Collectors.toList()); - for (Integer typeId : mallTypeIds) { - orderOther.setTypeId(typeId); - ProductType productType = productTypeService.getById(typeId); - orderOther.setTypeName(productType.getTypeName()); - } - } - }); - orderVo.setOrder(order); - orderVo.setOrderOther(orderOtherList); - - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("order_id", orderId); - HrContractInformation hrContractInformation = contractInformationMapper.selectOne(queryWrapper); - orderVo.setContractInformation(hrContractInformation); - return orderVo; + @CacheEvict(cacheNames = "ConfirmOrderCache", key = "#userId") + public void removeConfirmOrderCache(String userId) { } @Override - public boolean deleteOrders(List orderIds) { - //先删除订单其他信息,再删除基本信息 - if (orderIds.size() > 1) { - orderIds.forEach(orderId -> { - orderOtherMapper.delete(new QueryWrapper().eq("order_id", orderId)); - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("order_id", orderId); - contractInformationMapper.delete(queryWrapper); - }); - } else { - orderOtherMapper.delete(new QueryWrapper().eq("order_id", orderIds.get(0))); - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("order_id", orderIds.get(0)); - contractInformationMapper.delete(queryWrapper); - } + @Transactional(rollbackFor = Exception.class) + public List submit(String userId, ShopCartOrderMergerDto mergerOrder) { + List orderList = new ArrayList<>(); + // 通过事务提交订单 +// eventPublisher.publishEvent(new SubmitOrderEvent(mergerOrder, orderList)); + + // 插入订单 + saveBatch(orderList); + List orderItems = orderList.stream().flatMap(order -> order.getOrderItems().stream()).collect(Collectors.toList()); + // 插入订单项,返回主键 + orderItemMapper.insertBatch(orderItems); + return orderList; + } - int deleteBatchIds = baseMapper.deleteBatchIds(orderIds); - return deleteBatchIds > 0; + @Override + @Transactional(rollbackFor = Exception.class) + public void delivery(Order order) { + orderMapper.updateById(order); } - /** - * 更新订单信息,订单其他信息中的状态都为已发货,修改该订单状态为已完成 - * - * @param orderVo 订单信息 - * @return boolean - */ @Override - public boolean updateOrder(OrderVo orderVo) { - Order order = orderVo.getOrder(); - List ship = new ArrayList<>(); - orderOtherMapper.delete(new QueryWrapper().eq("order_id",order.getOrderId())); - - List orderOtherList = orderVo.getOrderOther(); - StringBuilder productName = new StringBuilder(); - orderOtherList.forEach(orderOther -> { - orderOther.setOrderId(order.getOrderId()); - orderOtherMapper.insert(orderOther); - ship.add(orderOther.getShip()); - productName.append(orderOther.getProductName() + ","); - }); - String productNames; - if (productName.length() >= 20) { - productNames = "包含" + orderOtherList.size() + "个产品,点击查看详情!"; - } else { - productNames = productName.substring(0, productName.toString().length() - 1); - } - boolean contains = ship.contains(0); - if (!contains) { - order.setOrderStatus(OrderConstant.SHIPPED); - orderOtherList.forEach(orderOther -> { - - if (orderOther.getShipTime() == null) { - //添加发货时间 - orderOther.setShipTime(new Date()); - } - orderOtherMapper.updateById(orderOther); - - }); - //通知一次之后修改订单不在通知 - if (order.getNotification()==0 && StringUtils.isNotEmpty(order.getBusinessManagerId())) { - order.setNotification(1); - //发货成功后小程序服务通知商务经理 - PartnerAccount partnerAccount = partnerAccountMapper.selectAccountByPartnerId(order.getBusinessManagerId()); - Integer accountId = partnerAccount.getAccountId(); - String openid = baseMapper.selectOpenid(accountId); - WxMssVo wxMssVo = new WxMssVo(); - //设置模板id - wxMssVo.setTemplate_id("8pDVfWYqh9c-nn3CeA1NXJtBxdd1FYiCtrl5BeLvbgU"); - //跳转小程序类型:developer为开发版;trial为体验版;formal为正式版;默认为正式版 - wxMssVo.setMiniprogram_state("trial"); - wxMssVo.setLang("zh_CN"); - String accessToken = null; - try { - //设置openId - wxMssVo.setTouser(openid); - //设置accessToken - accessToken = WeChatUtil.getAccessToken(); - } catch (IOException e) { - e.printStackTrace(); - } - //设置小程序 跳转页面 - wxMssVo.setPage("/order/orderDetail/orderDetail?orderId=" + order.getOrderId() + "&show=1"); - - wxMssVo.setRequest_url("https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token=" + accessToken); - //将模板中的值一一赋值 发送到小程序的数据要转化为json格式 可以使用下面的方法直接拼接成JSONObject - JSONObject jsonObject = new JSONObject(); - JSONObject dataInfo = new JSONObject(); - dataInfo.putOpt("value", new Date()); - jsonObject.putOpt("time5", dataInfo); - - //使用map结合模板 后续再加遍历拼接成JSONObject - HashMap map = new HashMap<>(3); - //根据模板写值 - //订阅消息参数值内容限制说明 - //---摘自微信小程序官方:https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/subscribe-message/subscribeMessage.send.html - //参数类别 参数说明 参数值限制 说明 - //thing.DATA 事物 20个以内字符 可汉字、数字、字母或符号组合 - //number.DATA 数字 32位以内数字 只能数字,可带小数 - //letter.DATA 字母 32位以内字母 只能字母 - //symbol.DATA 符号 5位以内符号 只能符号 - //character_string.DATA 字符串 32位以内数字、字母或符号 可数字、字母或符号组合 - //time.DATA 时间 24小时制时间格式(支持+年月日) 例如:15:01,或:2019年10月1日 15:01 - //date.DATA 日期 年月日格式(支持+24小时制时间) 例如:2019年10月1日,或:2019年10月1日 15:01 - //amount.DATA 金额 1个币种符号+10位以内纯数字,可带小数,结尾可带“元” 可带小数 - //phone_number.DATA 电话 17位以内,数字、符号 电话号码,例:+86-0766-66888866 - //car_number.DATA 车牌 8位以内,第一位与最后一位可为汉字,其余为字母或数字 车牌号码:粤A8Z888挂 - //name.DATA 姓名 10个以内纯汉字或20个以内纯字母或符号 中文名10个汉字内;纯英文名20个字母内;中文和字母混合按中文名算,10个字内 - //phrase.DATA 汉字 5个以内汉字 5个以内纯汉字,例如:配送中 - map.put("thing12", order.getCustomerName());//客户名称 - map.put("thing8", productNames);//订单内容 - map.put("amount13", order.getOrderAmount()+"元");//订单金额 - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - String format = sdf.format(order.getCreateTime()); -// System.out.println(format); - map.put("time14", format);//下单日期 - map.put("phrase15", "已完成");//订单状态 - wxMssVo.setMap(map); - WeChatUtil.sendTemplateMessage(wxMssVo); - } - - } - HrContractInformation contractInformation = orderVo.getContractInformation(); - //更新合同信息 - if (contractInformation.getContractId() != null) { - contractInformationMapper.updateById(contractInformation); - } - int update = baseMapper.updateById(order); - - //根据订单类型修改客户类型 - List type = new ArrayList<>(); - Customer customer = customerMapper.selectById(order.getCustomerId()); - //查询客户所有订单 - List customerOrderList = baseMapper.selectList(new QueryWrapper().eq("customer_id", order.getCustomerId())); - // 订单类型(1、正式 2、试用) - for (Order orderInfo : customerOrderList) { - type.add(orderInfo.getOrderType()); - } - //有正式订单 - boolean typeContains = type.contains(1); - if (typeContains) { - customer.setCustomerType(1); - } else { - customer.setCustomerType(2); - } - //更新客户类型 - customerMapper.updateById(customer); - - return update > 0; + public List listOrderAndOrderItems(Integer orderStatus, DateTime lessThanUpdateTime) { + return orderMapper.listOrderAndOrderItems(orderStatus, lessThanUpdateTime); } - /** - * @Description : 客户当前已订阅产品 - * @Param customeId - * @Author Rong---2022/5/16 - */ @Override - public R getProductsSubscribedByCustomers(Integer customeId) { - //获取当前客户下的订单信息 (data_or_course_id、authority) - List orderOtherList = orderOtherMapper.getProductsSubscribedByCustomers(customeId); - /** - * 1 实训课程 - * 2 理论课程 - * 3 职站增值应用 - * 4 实训课程(非集成) - * 5 数据前瞻 - * 6 实验工具 - */ - for (OrderOther orderOther : orderOtherList) { - orderOther.setProductDel(1); - //authority:区分权限(0为数据平台权限,1为课程权限,对应data_or_course_id) - switch (orderOther.getAuthority()) { - case 0: - DataProduct dataProduct = dataProductMapper.selectById(orderOther.getDataOrCourseId()); - if (dataProduct != null) { - orderOther.setProductDel(0); - orderOther.setProductName(dataProduct.getProductName()); - orderOther.setProductType(5);//产品类型(3-数据产品) - List dataStartAndEndTimeList = orderOtherMapper.permissionToGetOrders(customeId, orderOther.getAuthority(), orderOther.getMallId()); - orderOther.setStartAndEndTimeList(dataStartAndEndTimeList); - break; - } - case 1: - Curriculum curriculum = curriculumMapper.selectById(orderOther.getDataOrCourseId()); - if (curriculum != null) { - orderOther.setProductDel(0); -// orderOther.setProductName(curriculum.getCurriculumName()); - orderOther.setProductName(orderOther.getGoodsName()); - - //产品类型(0->理论 1-实训) 1更改为1为实训课程 0更改2理论课程 - if (curriculum.getCurriculumType() == 0) { - orderOther.setProductType(2); - } else if (curriculum.getCurriculumType() == 1) { - orderOther.setProductType(1); - } - - orderOther.setMiniProgramPictureAddress(curriculum.getMiniProgramPictureAddress()); - List curriculumStartAndEndTimeList = orderOtherMapper.permissionToGetOrders(customeId, orderOther.getAuthority(), orderOther.getMallId()); - orderOther.setStartAndEndTimeList(curriculumStartAndEndTimeList); - break; - } - - case 2: - orderOther.setProductDel(0); - orderOther.setProductType(3); - orderOther.setProductName("大赛系统"); - List curriculumStartAndEndTimeList = orderOtherMapper.permissionToGetOrders(customeId, orderOther.getAuthority(), orderOther.getMallId()); - orderOther.setStartAndEndTimeList(curriculumStartAndEndTimeList); - break; - - //区分权限(0为数据平台权限,1为课程权限,2为职站增值模块,3为实训课程(非集成),4为实验工具,对应id为商城管理中的产品) - case 3: - orderOther.setProductDel(0); - orderOther.setProductType(4); - orderOther.setProductName("实训课程(非集成)"); - List trainingCourses = orderOtherMapper.permissionToGetOrders(customeId, orderOther.getAuthority(), orderOther.getMallId()); - orderOther.setStartAndEndTimeList(trainingCourses); - break; - - case 4: - orderOther.setProductDel(0); - orderOther.setProductType(6); - orderOther.setProductName("实验工具)"); - List experimentalTool = orderOtherMapper.permissionToGetOrders(customeId, orderOther.getAuthority(), orderOther.getMallId()); - orderOther.setStartAndEndTimeList(experimentalTool); - break; - - - } - - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); - long currentTimestamp = System.currentTimeMillis(); // 当前时间戳 - - String inActiveStartTime = null; // 生效中的开始时间 - String inActiveEndTime = null; // 生效中的截止时间 - - String continuousStartTime = null; // 连续订单的开始时间 - String continuousEndTime = null; // 连续订单的截止时间 - - String lastDateTime = null; // 上一笔订单截止时间 - String lastStartDateTime = null; // 上一笔订单开始时间 - - List notActiveList = new ArrayList(); // 非连续订单并未失效的时间 - - if (orderOther.getStartAndEndTimeList() != null) { - for (PermissiontogetordersResp getTime : orderOther.getStartAndEndTimeList()) { - - if (orderOther.getStartAndEndTimeList().size() > 1) {//表示当前集合中大于一条数据以上 少于2条不作判断 - if (lastDateTime == null) { - lastStartDateTime = getTime.getStartTime(); - lastDateTime = getTime.getEndTime(); - continue; - } - boolean check = true; // 用于排除生效中的时间 - String startDateTime = getTime.getStartTime(); - String endDateTime = getTime.getEndTime(); - try { - //intervalDays:获取间隔天数 - Integer intervalDays = DateUtils.getTheNumberOfDaysBetweenTwoDates(startDateTime, lastDateTime); - if (intervalDays == 1) {//为1表示 刚好间隔一天,为连续订单 - if (continuousStartTime == null || continuousEndTime != null) { // continuousEndTime不等于null的话,代表有多次的连续订单 - continuousStartTime = lastStartDateTime; - continuousEndTime = null; - } - } else { - if (continuousStartTime != null) { // 赋值连续订单的结束时间 - continuousEndTime = lastDateTime; - } - - // 正在生效的时间 当前时间大于等于开始时间 并 小于等于截止时间 - long startTimestamp = df.parse(startDateTime).getTime(); - long endTimestamp = df.parse(endDateTime).getTime(); - if (currentTimestamp >= startTimestamp && currentTimestamp <= endTimestamp) { // 非连续订单 - inActiveStartTime = startDateTime; - inActiveEndTime = endDateTime; - check = false; - } else if (continuousEndTime != null) { // 连续订单 - startTimestamp = df.parse(continuousStartTime).getTime(); - endTimestamp = df.parse(continuousEndTime).getTime(); - if (currentTimestamp >= startTimestamp && currentTimestamp <= endTimestamp) { - inActiveStartTime = continuousStartTime; - inActiveEndTime = continuousEndTime; - check = false; - } - - } - } - - if (inActiveEndTime != null && check) { // 有生效中的结束时间,则都丢进未生效的订单时间集合 - notActiveList.add(getTime); - } - } catch (ParseException e) { - e.printStackTrace(); - } - lastStartDateTime = getTime.getStartTime(); - lastDateTime = getTime.getEndTime(); - } else { - try { - orderOther.setStartTime(df.parse(getTime.getStartTime())); - orderOther.setEndTime(df.parse(getTime.getEndTime())); - } catch (ParseException e) { - e.printStackTrace(); - } - } - } - - orderOther.setNotActiveList(notActiveList);//还未生效订单的订单时间 - - try { - if (inActiveStartTime != null) { // 生效中的订单 - orderOther.setStartTime(df.parse(inActiveStartTime)); - orderOther.setEndTime(df.parse(inActiveEndTime)); - } else if (inActiveStartTime == null && notActiveList.size() > 0) { // 没有生效中的订单 且 有未生效的订单 - PermissiontogetordersResp notContinuousTime = notActiveList.get(0); - notActiveList.remove(0); - orderOther.setStartTime(df.parse(notContinuousTime.getStartTime())); - orderOther.setEndTime(df.parse(notContinuousTime.getEndTime())); - } - } catch (ParseException e) { - e.printStackTrace(); - } - } + @Transactional(rollbackFor = Exception.class) + public void cancelOrders(List orders) { + + orderMapper.cancelOrders(orders); + List allOrderItems = new ArrayList<>(); + for (Order order : orders) { + List orderItems = order.getOrderItems(); + allOrderItems.addAll(orderItems); +// eventPublisher.publishEvent(new CancelOrderEvent(order)); } - return R.ok().put("data", orderOtherList); - } + if (CollectionUtil.isEmpty(allOrderItems)) { + return; + } + Map prodCollect = new HashMap<>(16); + Map skuCollect = new HashMap<>(16); - @Override - public void exportSubscribedRecords(List listOfExportSub, HttpServletResponse response) throws Exception { - // 告诉浏览器用什么软件可以打开此文件 - response.setHeader("content-Type", "application/vnd.ms-excel"); - // 下载文件的默认名称 - response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("产品已订阅记录", "UTF-8") + ".xls"); - //编码 - response.setCharacterEncoding("UTF-8"); - Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), ExportSubscribedRecordsResp.class, listOfExportSub); - ExportParams exportParams = new ExportParams(null, "delivery", ExcelType.XSSF); - exportParams.setStyle(ExcelStyleUtil.class); - workbook.write(response.getOutputStream()); + allOrderItems.stream().collect(Collectors.groupingBy(OrderItem::getProdId)).forEach((prodId, orderItems) -> { + int prodTotalNum = orderItems.stream().mapToInt(OrderItem::getProdCount).sum(); + prodCollect.put(prodId, prodTotalNum); + }); + productMapper.returnStock(prodCollect); + + allOrderItems.stream().collect(Collectors.groupingBy(OrderItem::getSkuId)).forEach((skuId, orderItems) -> { + int prodTotalNum = orderItems.stream().mapToInt(OrderItem::getProdCount).sum(); + skuCollect.put(skuId, prodTotalNum); + }); + skuMapper.returnStock(skuCollect); } @Override - public R getAListOfClientBusinessManagers(ListOfClientCommercialManagersReq req) { - Page page = new Page(req.getPageNum(), req.getPageSize()); - IPage pageList = orderOtherMapper.getAListOfClientBusinessManagersByCustomerId(page, req); - for (ListOfClientCommercialManagersResp resp : pageList.getRecords()) { - //查询当前商务经理所在的团队(可存在多个团队中) - //2022.07-05 所属团队展示更改需求为:只展示当前客户下单后订单里面选择的团队信息(可以是同一人不同团队下的下订单为同一个客户,此时就是多条) - List teamInformationRespList = classificationMapper.getTeamInformationByCustomerId(req.getCustomerId(), resp.getBusinessManagerId()); - String productName = orderOtherMapper.getTheProductPurchasedByTheBusinessManager(resp.getBusinessManagerId(), req.getCustomerId(), teamInformationRespList); - resp.setTeamInformationRespList(teamInformationRespList); - resp.setProductName(productName); + @Transactional(rollbackFor = Exception.class) + public void confirmOrder(List orders) { + orderMapper.confirmOrder(orders); + for (Order order : orders) { +// eventPublisher.publishEvent(new ReceiptOrderEvent(order)); } - return R.ok().put("data", pageList); } @Override - public R getBusinessManagerOrder(ListOfClientCommercialManagersReq req) { - Page page = new Page(req.getPageNum(), req.getPageSize()); - IPage pageList = orderOtherMapper.getBusinessManagerOrder(page, req); - return R.ok().put("data", pageList); + public List listOrdersDetailByOrder(Order order, Date startTime, Date endTime) { + return orderMapper.listOrdersDetailByOrder(order, startTime, endTime); } @Override - public R getOrderBasedOnBusinessManagerId(ListOfClientCommercialManagersReq req) { - Page page = new Page(req.getPageNum(), req.getPageSize()); - IPage pageList = baseMapper.getOrderBasedOnBusinessManagerId(page, req); - //查询费率 - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("classification_id", req.getTeamId()); -// queryWrapper.eq("partner_id", req.getBusinessManagerId()); - PartnerTeam rateInformation = teamMapper.selectOne(queryWrapper); - return R.ok().put("data", pageList).put("annualMarketingFee", rateInformation.getAnnualMarketingFee()); + public IPage pageOrdersDetailByOrderParam(Page page, OrderParam orderParam) { + page.setRecords(orderMapper.listOrdersDetailByOrderParam(new PageAdapter(page), orderParam)); + page.setTotal(orderMapper.countOrderDetail(orderParam)); + return page; } @Override - public R miniProgramOrderRecord(OrderRecordParametersReq req) { - Page page = new Page(req.getPageNum(), req.getPageSize()); - IPage pageList = baseMapper.miniProgramOrderRecord(page, req); - return R.ok().put("data", pageList); + @Transactional(rollbackFor = Exception.class) + public void deleteOrders(List orders) { + orderMapper.deleteOrders(orders); } @Override - public R getSystemByCustomers(GetTheSystemUnderTheProductReq req) { - Page page = new Page(req.getPageNum(), req.getPageSize()); - IPage pageList = orderOtherMapper.getSystemByCustomers(page, req); - return R.ok().put("data", pageList); + public OrderCountData getOrderCount(String userId) { + return orderMapper.getOrderCount(userId); } diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/impl/OrderSettlementServiceImpl.java b/nakadai/src/main/java/com/huoran/nakadai/service/impl/OrderSettlementServiceImpl.java new file mode 100644 index 0000000..8546fa0 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/service/impl/OrderSettlementServiceImpl.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +import com.huoran.nakadai.entity.model.OrderSettlement; +import com.huoran.nakadai.mapper.OrderSettlementMapper; +import com.huoran.nakadai.service.OrderSettlementService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * + * @author lgh on 2018/11/10. + */ +@Service +public class OrderSettlementServiceImpl extends ServiceImpl implements OrderSettlementService { + + @Autowired + private OrderSettlementMapper orderSettlementMapper; + + @Override + public void updateSettlementsByPayNo(String outTradeNo, String transactionId) { + orderSettlementMapper.updateSettlementsByPayNo(outTradeNo, transactionId); + } + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/impl/PartnerAccountServiceImpl.java b/nakadai/src/main/java/com/huoran/nakadai/service/impl/PartnerAccountServiceImpl.java index 170fc46..c520dc0 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/service/impl/PartnerAccountServiceImpl.java +++ b/nakadai/src/main/java/com/huoran/nakadai/service/impl/PartnerAccountServiceImpl.java @@ -641,14 +641,14 @@ public class PartnerAccountServiceImpl extends ServiceImpl orders = orderMapper.selectList(new QueryWrapper(). - eq("business_manager_id", adminAccount.getPartnerId()). - eq("team_id", transferAdminReq.getPartnerClassificationId())); - - for (Order order : orders) { - order.setBusinessManagerId(memberAccount.getPartnerId().toString()); - orderMapper.updateById(order); - } +// List orders = orderMapper.selectList(new QueryWrapper(). +// eq("business_manager_id", adminAccount.getPartnerId()). +// eq("team_id", transferAdminReq.getPartnerClassificationId())); +// +// for (Order order : orders) { +// order.setBusinessManagerId(memberAccount.getPartnerId().toString()); +// orderMapper.updateById(order); +// } //更新团队名称 PartnerClassification partnerClassification = partnerClassificationMapper.selectById(transferAdminReq.getPartnerClassificationId()); @@ -714,14 +714,14 @@ public class PartnerAccountServiceImpl extends ServiceImpl orders = orderMapper.selectList(new QueryWrapper(). - eq("business_manager_id", adminAccount.getPartnerId()). - eq("team_id", transferAdminReq.getPartnerClassificationId())); - - for (Order order : orders) { - order.setBusinessManagerId(memberAccount.getPartnerId().toString()); - orderMapper.updateById(order); - } +// List orders = orderMapper.selectList(new QueryWrapper(). +// eq("business_manager_id", adminAccount.getPartnerId()). +// eq("team_id", transferAdminReq.getPartnerClassificationId())); +// +// for (Order order : orders) { +// order.setBusinessManagerId(memberAccount.getPartnerId().toString()); +// orderMapper.updateById(order); +// } //更新团队名称 PartnerClassification partnerClassification1 = partnerClassificationMapper.selectById(transferAdminReq.getPartnerClassificationId()); @@ -821,14 +821,14 @@ public class PartnerAccountServiceImpl extends ServiceImpl orders = orderMapper.selectList(new QueryWrapper(). - eq("business_manager_id", adminAccount.getPartnerId()). - eq("team_id", transferAdminReq.getPartnerClassificationId())); - - for (Order order : orders) { - order.setBusinessManagerId(partnerAccount.getPartnerId().toString()); - orderMapper.updateById(order); - } +// List orders = orderMapper.selectList(new QueryWrapper(). +// eq("business_manager_id", adminAccount.getPartnerId()). +// eq("team_id", transferAdminReq.getPartnerClassificationId())); +// +// for (Order order : orders) { +// order.setBusinessManagerId(partnerAccount.getPartnerId().toString()); +// orderMapper.updateById(order); +// } //更新团队名称 PartnerClassification partnerClassification1 = partnerClassificationMapper.selectById(transferAdminReq.getPartnerClassificationId()); @@ -883,14 +883,14 @@ public class PartnerAccountServiceImpl extends ServiceImpl orders = orderMapper.selectList(new QueryWrapper(). - eq("business_manager_id", adminPartnerId). - eq("team_id", adminTeamId)); - - for (Order order : orders) { - order.setBusinessManagerId(memberPartnerId.toString()); - orderMapper.updateById(order); - } +// List orders = orderMapper.selectList(new QueryWrapper(). +// eq("business_manager_id", adminPartnerId). +// eq("team_id", adminTeamId)); +// +// for (Order order : orders) { +// order.setBusinessManagerId(memberPartnerId.toString()); +// orderMapper.updateById(order); +// } //更新团队名称 PartnerClassification partnerClassification = partnerClassificationMapper.selectById(adminTeamId); @@ -1103,7 +1103,7 @@ public class PartnerAccountServiceImpl extends ServiceImpl 0 && addAccount > 0){ - return R.ok().put("token", JwtUtils.getJwtToken(userAccount.getId().toString())).put("teamId",partnerClassification.getId()); + return R.ok().put("token", "").put("teamId",partnerClassification.getId()); } return R.error(); } diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/impl/PartnerTeamServiceImpl.java b/nakadai/src/main/java/com/huoran/nakadai/service/impl/PartnerTeamServiceImpl.java index e0937ec..1bc2b58 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/service/impl/PartnerTeamServiceImpl.java +++ b/nakadai/src/main/java/com/huoran/nakadai/service/impl/PartnerTeamServiceImpl.java @@ -128,53 +128,53 @@ public class PartnerTeamServiceImpl extends ServiceImpl settlements = orderSettlementMapper.getSettlementsByPayNo(payNo); + // 应支付的总金额 + double payAmount = 0.0; + for (OrderSettlement orderSettlement : settlements) { + payAmount = Arith.add(payAmount, orderSettlement.getPayAmount()); + } + + prodName.substring(0, Math.min(100, prodName.length() - 1)); + + PayInfoDto payInfoDto = new PayInfoDto(); + payInfoDto.setBody(prodName.toString()); + payInfoDto.setPayAmount(payAmount); + payInfoDto.setPayNo(payNo); + return payInfoDto; + } + + + @Override + @Transactional(rollbackFor = Exception.class) + public List paySuccess(String payNo, String bizPayNo) { + List orderSettlements = orderSettlementMapper.selectList(new LambdaQueryWrapper().eq(OrderSettlement::getPayNo, payNo)); + + OrderSettlement settlement = orderSettlements.get(0); + + // 订单已支付 + if (settlement.getPayStatus() == 1) { + throw new YamiShopBindException("订单已支付"); + } + // 修改订单结算信息 + if (orderSettlementMapper.updateToPay(payNo, settlement.getVersion()) < 1) { + throw new YamiShopBindException("结算信息已更改"); + } + + + List orderNumbers = orderSettlements.stream().map(OrderSettlement::getOrderNumber).collect(Collectors.toList()); + + // 将订单改为已支付状态 +// orderMapper.updateByToPaySuccess(orderNumbers, PayType.WECHATPAY.value()); + + List orders = orderNumbers.stream().map(orderNumber -> orderMapper.getOrderByOrderNumber(orderNumber)).collect(Collectors.toList()); +// eventPublisher.publishEvent(new PaySuccessOrderEvent(orders)); + return orderNumbers; + } + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/impl/PickAddrServiceImpl.java b/nakadai/src/main/java/com/huoran/nakadai/service/impl/PickAddrServiceImpl.java new file mode 100644 index 0000000..30b8f21 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/service/impl/PickAddrServiceImpl.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.huoran.nakadai.entity.model.PickAddr; +import com.huoran.nakadai.mapper.PickAddrMapper; +import com.huoran.nakadai.service.PickAddrService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * + * @author lgh on 2018/10/17. + */ +@Service +public class PickAddrServiceImpl extends ServiceImpl implements PickAddrService { + + @Autowired + private PickAddrMapper pickAddrMapper; + + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/impl/PlatformTeamAccountServiceImpl.java b/nakadai/src/main/java/com/huoran/nakadai/service/impl/PlatformTeamAccountServiceImpl.java index 4a8d4b9..8d72cd7 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/service/impl/PlatformTeamAccountServiceImpl.java +++ b/nakadai/src/main/java/com/huoran/nakadai/service/impl/PlatformTeamAccountServiceImpl.java @@ -114,7 +114,7 @@ public class PlatformTeamAccountServiceImpl extends ServiceImpl implements ProdCommService { + + @Autowired + private ProdCommMapper prodCommMapper; + + @Override + public ProdCommDataDto getProdCommDataByProdId(Integer prodId) { + ProdCommDataDto prodCommDataDto=prodCommMapper.getProdCommDataByProdId(prodId); + //计算出好评率 + if(prodCommDataDto.getPraiseNumber() == 0||prodCommDataDto.getNumber() == 0){ + prodCommDataDto.setPositiveRating(0.0); + }else{ + prodCommDataDto.setPositiveRating(Arith.mul(Arith.div(prodCommDataDto.getPraiseNumber(),prodCommDataDto.getNumber()),100)); + } + return prodCommDataDto; + } + + @Override + public IPage getProdCommDtoPageByUserId(Page page, String userId) { + return prodCommMapper.getProdCommDtoPageByUserId(page,userId); + } + + @Override + public IPage getProdCommDtoPageByProdId(Page page, Integer prodId, Integer evaluate) { + + IPage prodCommDtos = prodCommMapper.getProdCommDtoPageByProdId(page, prodId, evaluate); + prodCommDtos.getRecords().forEach(prodCommDto -> { + // 匿名评价 + if (prodCommDto.getIsAnonymous() == 1) { + prodCommDto.setNickName(null); + } + }); + return prodCommDtos; + } + + @Override + public IPage getProdCommPage(Page page,ProdComm prodComm) { + return prodCommMapper.getProdCommPage(page,prodComm); + } +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/impl/ProdPropServiceImpl.java b/nakadai/src/main/java/com/huoran/nakadai/service/impl/ProdPropServiceImpl.java new file mode 100644 index 0000000..c408fb0 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/service/impl/ProdPropServiceImpl.java @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.service.impl; + +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +import com.huoran.common.exception.YamiShopBindException; +import com.huoran.nakadai.entity.enums.ProdPropRule; +import com.huoran.nakadai.entity.model.ProdProp; +import com.huoran.nakadai.mapper.CategoryPropMapper; +import com.huoran.nakadai.mapper.ProdPropMapper; +import com.huoran.nakadai.mapper.ProdPropValueMapper; +import com.huoran.nakadai.service.ProdPropService; +import com.huoran.nakadai.utils.PageAdapter; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.validation.Valid; +import java.util.Objects; + +/** + * @author lanhai + */ +@Service +public class ProdPropServiceImpl extends ServiceImpl implements ProdPropService { + + @Autowired + private ProdPropMapper prodPropMapper; + + @Autowired + private ProdPropValueMapper prodPropValueMapper; + + @Autowired + private CategoryPropMapper categoryPropMapper; + + @Override + public IPage pagePropAndValue(ProdProp prodProp, Page page) { + + page.setRecords(prodPropMapper.listPropAndValue(new PageAdapter(page), prodProp)); + page.setTotal(prodPropMapper.countPropAndValue(prodProp)); + return page; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void saveProdPropAndValues(@Valid ProdProp prodProp) { + ProdProp dbProdProp = prodPropMapper.getProdPropByPropNameAndShopId(prodProp.getPropName(), prodProp.getShopId(), prodProp.getRule()); + if (dbProdProp != null) { + throw new YamiShopBindException("已有相同名称规格"); + } + prodPropMapper.insert(prodProp); + if (CollUtil.isEmpty(prodProp.getProdPropValues())) { + return; + } + prodPropValueMapper.insertPropValues(prodProp.getPropId(), prodProp.getProdPropValues()); + + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void updateProdPropAndValues(ProdProp prodProp) { + ProdProp dbProdProp = prodPropMapper.getProdPropByPropNameAndShopId(prodProp.getPropName(), prodProp.getShopId(), prodProp.getRule()); + if (dbProdProp != null && !Objects.equals(prodProp.getPropId(), dbProdProp.getPropId())) { + throw new YamiShopBindException("已有相同名称规格"); + } + prodPropMapper.updateById(prodProp); + // 先删除原有的属性值,再添加新的属性值 + prodPropValueMapper.deleteByPropId(prodProp.getPropId()); + if (CollUtil.isEmpty(prodProp.getProdPropValues())) { + return; + } + prodPropValueMapper.insertPropValues(prodProp.getPropId(), prodProp.getProdPropValues()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteProdPropAndValues( Integer propId, Integer propRule, Integer shopId) { + int deleteRows = prodPropMapper.deleteByPropId(propId, propRule, shopId); + if (deleteRows == 0) { + return; + } + // 删除原有的属性值 + prodPropValueMapper.deleteByPropId(propId); + + // 如果是参数,删除参数与分类关联信息 + if (ProdPropRule.ATTRIBUTE.value().equals(propRule)) { + categoryPropMapper.deleteByPropId(propId); + } + } +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/impl/ProdPropValueServiceImpl.java b/nakadai/src/main/java/com/huoran/nakadai/service/impl/ProdPropValueServiceImpl.java new file mode 100644 index 0000000..1c9cf7d --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/service/impl/ProdPropValueServiceImpl.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +import com.huoran.nakadai.entity.model.ProdPropValue; +import com.huoran.nakadai.mapper.ProdPropValueMapper; +import com.huoran.nakadai.service.ProdPropValueService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * @author lanhai + */ +@Service +public class ProdPropValueServiceImpl extends ServiceImpl implements ProdPropValueService { + + @Autowired + private ProdPropValueMapper prodPropValueMapper; + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/impl/ProdTagReferenceServiceImpl.java b/nakadai/src/main/java/com/huoran/nakadai/service/impl/ProdTagReferenceServiceImpl.java new file mode 100644 index 0000000..8514e24 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/service/impl/ProdTagReferenceServiceImpl.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.service.impl; + + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +import com.huoran.nakadai.entity.model.ProdTagReference; +import com.huoran.nakadai.mapper.ProdTagReferenceMapper; +import com.huoran.nakadai.service.ProdTagReferenceService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 分组标签引用 + * + * @author hzm + * @date 2019-04-18 16:28:01 + */ +@Service +public class ProdTagReferenceServiceImpl extends ServiceImpl implements ProdTagReferenceService { + + @Autowired + private ProdTagReferenceMapper prodTagReferenceMapper; + + @Override + public List listTagIdByProdId(Integer prodId) { + return prodTagReferenceMapper.listTagIdByProdId(prodId); + } +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/impl/ProdTagServiceImpl.java b/nakadai/src/main/java/com/huoran/nakadai/service/impl/ProdTagServiceImpl.java new file mode 100644 index 0000000..2f4281f --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/service/impl/ProdTagServiceImpl.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.service.impl; + + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.huoran.nakadai.entity.model.ProdTag; +import com.huoran.nakadai.mapper.ProdTagMapper; +import com.huoran.nakadai.service.ProdTagService; +import lombok.AllArgsConstructor; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 商品分组标签 + * + * @author hzm + * @date 2019-04-18 10:48:44 + */ +@Service +@AllArgsConstructor +public class ProdTagServiceImpl extends ServiceImpl implements ProdTagService { + + private ProdTagMapper prodTagMapper; + + @Override + @Cacheable(cacheNames = "prodTag", key = "'prodTag'") + public List listProdTag() { + return prodTagMapper.selectList(new LambdaQueryWrapper() + .eq(ProdTag::getStatus, 1) + .orderByDesc(ProdTag::getSeq)); + } + + @Override + @CacheEvict(cacheNames = "prodTag", key = "'prodTag'") + public void removeProdTag() { + } +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/impl/ProductServiceImpl.java b/nakadai/src/main/java/com/huoran/nakadai/service/impl/ProductServiceImpl.java new file mode 100644 index 0000000..608a645 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/service/impl/ProductServiceImpl.java @@ -0,0 +1,201 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.service.impl; + +import cn.hutool.core.collection.CollectionUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.huoran.nakadai.entity.app.dto.ProductDto; +import com.huoran.nakadai.entity.app.dto.TagProductDto; +import com.huoran.nakadai.entity.dto.SearchProdDto; +import com.huoran.nakadai.entity.model.ProdTagReference; +import com.huoran.nakadai.entity.model.Product; +import com.huoran.nakadai.entity.model.Sku; +import com.huoran.nakadai.mapper.ProdTagReferenceMapper; +import com.huoran.nakadai.mapper.ProductMapper; +import com.huoran.nakadai.mapper.SkuMapper; +import com.huoran.nakadai.service.ProductService; +import com.huoran.nakadai.utils.Arith; +import com.huoran.nakadai.utils.PageParam; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.cache.annotation.Caching; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @author lanhai + */ +@Service +public class ProductServiceImpl extends ServiceImpl implements ProductService { + + @Autowired + private ProductMapper productMapper; + @Autowired + private SkuMapper skuMapper; + @Autowired + private ProdTagReferenceMapper prodTagReferenceMapper; + + private static final Logger log = LoggerFactory.getLogger(ProductServiceImpl.class); + + @Override + @Transactional(rollbackFor = Exception.class) + public void saveProduct(Product product) { + productMapper.insert(product); + if (CollectionUtil.isNotEmpty(product.getSkuList())) { + skuMapper.insertBatch(product.getProdId(), product.getSkuList()); + } +// prodTagReferenceMapper.insertBatch(product.getShopId(), product.getProdId(), product.getTagList()); + + } + + @Override + @Transactional(rollbackFor = Exception.class) + @Caching(evict = { + @CacheEvict(cacheNames = "product", key = "#product.prodId"), + @CacheEvict(cacheNames = "skuList", key = "#product.prodId") + }) + public void updateProduct(Product product, Product dbProduct) { + + productMapper.updateById(product); + List dbSkuIds = dbProduct.getSkuList().stream().map(Sku::getSkuId).collect(Collectors.toList()); + // 将所有该商品的sku标记为已删除状态 + skuMapper.deleteByProdId(product.getProdId()); + + // 接口传入sku列表 + List skuList = product.getSkuList(); + + if (CollectionUtil.isEmpty(skuList)) { + return; + } + + List insertSkuList = new ArrayList<>(); + for (Sku sku : skuList) { + sku.setIsDelete(0); + // 如果数据库中原有sku就更新,否者就插入 + if (dbSkuIds.contains(sku.getSkuId())) { + skuMapper.updateById(sku); + } else { + insertSkuList.add(sku); + } + } + // 批量插入sku + if (CollectionUtil.isNotEmpty(insertSkuList)) { + skuMapper.insertBatch(product.getProdId(), insertSkuList); + } + + //更新分组信息 + List tagList = product.getTagList(); + if (CollectionUtil.isNotEmpty(tagList)) { + prodTagReferenceMapper.delete(new LambdaQueryWrapper().eq(ProdTagReference::getProdId, product.getProdId())); + prodTagReferenceMapper.insertBatch(dbProduct.getShopId(), product.getProdId(), tagList); + } + } + + + @Override + @Cacheable(cacheNames = "product", key = "#prodId") + public Product getProductByProdId(Integer prodId) { + return productMapper.selectById(prodId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + @Caching(evict = { + @CacheEvict(cacheNames = "product", key = "#prodId"), + @CacheEvict(cacheNames = "skuList", key = "#prodId") + }) + public void removeProductByProdId(Integer prodId) { +// Product dbProduct = getProductByProdId(prodId); + + productMapper.deleteById(prodId); + + skuMapper.deleteByProdId(prodId); + + //删除商品关联的分组标签 +// prodTagReferenceMapper.delete(new LambdaQueryWrapper() +// .eq(ProdTagReference::getProdId, prodId)); + + // 删除数据库中的商品图片 +// if (StrUtil.isNotBlank(dbProduct.getImgs())) { +// String[] imgs = dbProduct.getImgs().split(StrUtil.COMMA); +// for (String img : imgs) { +// attachFileService.deleteFile(img); +// } +// } + } + + @Override + @Caching(evict = { + @CacheEvict(cacheNames = "product", key = "#prodId"), + @CacheEvict(cacheNames = "skuList", key = "#prodId") + }) + public void removeProductCacheByProdId(Integer prodId) { + + + } + + @Override + public IPage pageByPutAwayTime(IPage page) { + return productMapper.pageByPutAwayTime(page); + } + + @Override + public IPage pageByTagId(Page page, Long tagId) { + return productMapper.pageByTagId(page, tagId); + } + + @Override + public IPage moreBuyProdList(Page page) { + return productMapper.moreBuyProdList(page); + } + + @Override + public IPage pageByCategoryId(Page page, Long categoryId) { + return productMapper.pageByCategoryId(page, categoryId); + } + + @Override + public IPage getSearchProdDtoPageByProdName(Page page, String prodName, Integer sort, Integer orderBy) { + IPage searchProdDtoPage = productMapper.getSearchProdDtoPageByProdName(page, prodName, sort, orderBy); + for (SearchProdDto searchProdDto : searchProdDtoPage.getRecords()) { + //计算出好评率 + if (searchProdDto.getPraiseNumber() == 0 || searchProdDto.getProdCommNumber() == 0) { + searchProdDto.setPositiveRating(0.0); + } else { + searchProdDto.setPositiveRating(Arith.mul(Arith.div(searchProdDto.getPraiseNumber(), searchProdDto.getProdCommNumber()), 100)); + } + } + return searchProdDtoPage; + } + + @Override + public List tagProdList() { + return productMapper.tagProdList(); + } + + @Override + public IPage collectionProds(PageParam page, String userId) { + return productMapper.collectionProds(page, userId); + } + + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/impl/ShopDetailServiceImpl.java b/nakadai/src/main/java/com/huoran/nakadai/service/impl/ShopDetailServiceImpl.java new file mode 100644 index 0000000..f53792b --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/service/impl/ShopDetailServiceImpl.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.service.impl; + + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.huoran.nakadai.entity.model.ShopDetail; +import com.huoran.nakadai.mapper.ShopDetailMapper; +import com.huoran.nakadai.service.ShopDetailService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author lgh on 2018/08/29. + */ +@Service +public class ShopDetailServiceImpl extends ServiceImpl implements ShopDetailService { + + @Autowired + private ShopDetailMapper shopDetailMapper; + +// @Autowired +// private AttachFileService attachFileService; + + @Override + @Transactional(rollbackFor=Exception.class) + @CacheEvict(cacheNames = "shop_detail", key = "#shopDetail.shopId") + public void updateShopDetail(ShopDetail shopDetail,ShopDetail dbShopDetail) { + // 更新除数据库中的信息,再删除图片 + shopDetailMapper.updateById(shopDetail); +// if (!Objects.equals(dbShopDetail.getShopLogo(), shopDetail.getShopLogo())) { +// // 删除logo +// attachFileService.deleteFile(shopDetail.getShopLogo()); +// } +// // 店铺图片 +// String shopPhotos = shopDetail.getShopPhotos(); +// String[] shopPhotoArray =StrUtil.isBlank(shopPhotos)?new String[]{}: shopPhotos.split(","); +// +// // 数据库中的店铺图片 +// String dbShopPhotos = dbShopDetail.getShopPhotos(); +// String[] dbShopPhotoArray =StrUtil.isBlank(dbShopPhotos)?new String[]{}: dbShopPhotos.split(","); +// for (String dbShopPhoto : dbShopPhotoArray) { +// // 如果新插入的图片中没有旧数据中的图片,则删除旧数据中的图片 +// if (!ArrayUtil.contains(shopPhotoArray, dbShopPhoto)) { +// attachFileService.deleteFile(dbShopPhoto); +// } +// } + } + + @Override + @Transactional(rollbackFor=Exception.class) + @CacheEvict(cacheNames = "shop_detail", key = "#shopId") + public void deleteShopDetailByShopId(Integer shopId) { + shopDetailMapper.deleteById(shopId); + } + + @Override + @Cacheable(cacheNames = "shop_detail", key = "#shopId") + public ShopDetail getShopDetailByShopId(Integer shopId) { + return shopDetailMapper.selectById(shopId); + } + + @Override + @CacheEvict(cacheNames = "shop_detail", key = "#shopId") + public void removeShopDetailCacheByShopId(Integer shopId) { + } +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/impl/SkuServiceImpl.java b/nakadai/src/main/java/com/huoran/nakadai/service/impl/SkuServiceImpl.java new file mode 100644 index 0000000..5ac961b --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/service/impl/SkuServiceImpl.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.service.impl; + + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.huoran.nakadai.entity.model.Sku; +import com.huoran.nakadai.mapper.SkuMapper; +import com.huoran.nakadai.service.SkuService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.cache.annotation.Caching; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * + * @author lgh on 2018/09/29. + */ +@Service +public class SkuServiceImpl extends ServiceImpl implements SkuService { + + @Autowired + private SkuMapper skuMapper; + + @Override + @Cacheable(cacheNames = "skuList", key = "#prodId") + public List listByProdId(Integer prodId) { + return skuMapper.listByProdId(prodId); + } + + @Override + @Cacheable(cacheNames = "sku", key = "#skuId") + public Sku getSkuBySkuId(Integer skuId) { + return skuMapper.selectById(skuId); + } + + @Override + @Caching(evict = { + @CacheEvict(cacheNames = "sku", key = "#skuId"), + @CacheEvict(cacheNames = "skuList", key = "#prodId") + }) + public void removeSkuCacheBySkuId(Integer skuId,Integer prodId) { + + } + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/utils/Arith.java b/nakadai/src/main/java/com/huoran/nakadai/utils/Arith.java new file mode 100644 index 0000000..0d52184 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/utils/Arith.java @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.utils; + +import java.math.BigDecimal; +import java.math.RoundingMode; + +/** + * @author lanhai + */ +public class Arith { + /** + * 默认除法运算精度 + */ + private static final int DEF_DIV_SCALE = 2; + + /** + * 这个类不能实例化 + */ + private Arith() { + } + + /** + * 提供精确的加法运算。. + * + * @param v1 被加数 + * @param v2 加数 + * @return 两个参数的和 + */ + public static double add(double v1, double v2) { + // 必须转换成String + String s1 = Double.toString(v1); + String s2 = Double.toString(v2); + BigDecimal b1 = new BigDecimal(s1); + BigDecimal b2 = new BigDecimal(s2); + return b1.add(b2).doubleValue(); + } + + /** + * 提供精确的减法运算。. + * + * @param v1 被减数 + * @param v2 减数 + * @return 两个参数的差 + */ + public static double sub(double v1, double v2) { + String s1 = Double.toString(v1); + String s2 = Double.toString(v2); + BigDecimal b1 = new BigDecimal(s1); + BigDecimal b2 = new BigDecimal(s2); + return b1.subtract(b2).doubleValue(); + } + + /** + * 提供精确的乘法运算。. + * + * @param v1 被乘数 + * @param v2 乘数 + * @return 两个参数的积 + */ + public static double mul(double v1, double v2) { + String s1 = Double.toString(v1); + String s2 = Double.toString(v2); + BigDecimal b1 = new BigDecimal(s1); + BigDecimal b2 = new BigDecimal(s2); + return b1.multiply(b2).doubleValue(); + } + + /** + * 提供(相对)精确的除法运算,当发生除不尽的情况时,精确到 小数点以后10位,以后的数字四舍五入。. + * + * @param v1 被除数 + * @param v2 除数 + * @return 两个参数的商 + */ + public static double div(double v1, double v2) { + return div(v1, v2, DEF_DIV_SCALE); + } + + /** + * 提供(相对)精确的除法运算。当发生除不尽的情况时,由scale参数指 定精度,以后的数字四舍五入。. + * + * @param v1 被除数 + * @param v2 除数 + * @param scale 表示表示需要精确到小数点以后几位。 + * @return 两个参数的商 + */ + public static double div(double v1, double v2, int scale) { + if (scale < 0) { + throw new IllegalArgumentException("The scale must be a positive integer or zero"); + } + String s1 = Double.toString(v1); + String s2 = Double.toString(v2); + BigDecimal b1 = new BigDecimal(s1); + BigDecimal b2 = new BigDecimal(s2); + return b1.divide(b2, scale, RoundingMode.HALF_EVEN).doubleValue(); + } + + /** + * 提供精确的小数位四舍五入处理。. + * + * @param v 需要四舍五入的数字 + * @param scale 小数点后保留几位 + * @return 四舍五入后的结果 + */ + public static double round(double v, int scale) { + if (scale < 0) { + throw new IllegalArgumentException("The scale must be a positive integer or zero"); + } + String s = Double.toString(v); + BigDecimal b = new BigDecimal(s); + BigDecimal one = new BigDecimal("1"); + return b.divide(one, scale, RoundingMode.HALF_EVEN).doubleValue(); + } + + + /** + * @param bigDecimal + * @param bigDecimal2 + * @param bigDecimal3 + * @return + */ + public static double add(BigDecimal bigDecimal, BigDecimal bigDecimal2, BigDecimal bigDecimal3) { + return bigDecimal.add(bigDecimal2).add(bigDecimal3).doubleValue(); + } + + /** + * @param preDepositPrice + * @param finalPrice + * @return + */ + public static double add(BigDecimal preDepositPrice, BigDecimal finalPrice) { + return preDepositPrice.add(finalPrice).doubleValue(); + } +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/utils/CacheManagerUtil.java b/nakadai/src/main/java/com/huoran/nakadai/utils/CacheManagerUtil.java new file mode 100644 index 0000000..8fac757 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/utils/CacheManagerUtil.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.utils; + +import lombok.AllArgsConstructor; +import org.springframework.cache.Cache; +import org.springframework.cache.CacheManager; +import org.springframework.stereotype.Component; + +/** + * @author lanhai + */ +@Component +@AllArgsConstructor +public class CacheManagerUtil { + + private CacheManager cacheManager; + + @SuppressWarnings({"unchecked"}) + public T getCache(String cacheName,String key) { + Cache cache = cacheManager.getCache(cacheName); + if (cache == null) { + return null; + } + Cache.ValueWrapper valueWrapper = cache.get(key); + if (valueWrapper == null) { + return null; + } + return (T)valueWrapper.get(); + } + + public void putCache(String cacheName,String key, Object value) { + Cache cache = cacheManager.getCache(cacheName); + if (cache != null) { + cache.put(key, value); + } + } + + public void evictCache(String cacheName,String key) { + Cache cache = cacheManager.getCache(cacheName); + if (cache != null) { + cache.evict(key); + } + } +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/utils/HttpContextUtils.java b/nakadai/src/main/java/com/huoran/nakadai/utils/HttpContextUtils.java new file mode 100644 index 0000000..c7ea8d1 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/utils/HttpContextUtils.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.utils; + +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; + +/** + * @author lanhai + */ +public class HttpContextUtils { + + public static HttpServletRequest getHttpServletRequest() { + return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + } + + public static String getDomain(){ + HttpServletRequest request = getHttpServletRequest(); + StringBuffer url = request.getRequestURL(); + return url.delete(url.length() - request.getRequestURI().length(), url.length()).toString(); + } + + public static String getOrigin(){ + HttpServletRequest request = getHttpServletRequest(); + return request.getHeader("Origin"); + } +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/utils/IdUtil.java b/nakadai/src/main/java/com/huoran/nakadai/utils/IdUtil.java new file mode 100644 index 0000000..9fd47b4 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/utils/IdUtil.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.utils; + +import cn.hutool.core.lang.Snowflake; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.HashMap; +import java.util.Map; + +/** + * 进制转换工具,最大支持十进制和DICT.length()进制的转换 + * 1、将十进制的数字转换为指定进制的字符串; + * 2、将其它进制的数字(字符串形式)转换为十进制的数字 + * @author xuliugen + * @date 2018/04/23 + */ +@Component +public class IdUtil { + + @Autowired + private Snowflake snowflake; + + private static final String DICT = "0123456789abcdefghijkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"; + + private static final int SEED = DICT.length(); + + private static final int ID_MIN_LENGTH = 6; + /** + * 数字->字符映射 + */ + private static final char[] CHARS = DICT.toCharArray(); + /** + * 字符->数字映射 + */ + private static final Map NUMBERS = new HashMap<>(); + + static { + int len = CHARS.length; + for (int i = 0; i 0) { + int r = (int) (id % SEED); + shortUrl.insert(0, CHARS[r]); + id = id / SEED; + } + int len = shortUrl.length(); + while (len < ID_MIN_LENGTH) { + shortUrl.insert(0, CHARS[0]); + len++; + } + return shortUrl.toString(); + } + + /** + * 根据获得的短网址编码解析出数据库中对应的记录ID + * @param key 短网址 eg. RwTji8, GijT7Y等等 + * @return + */ + public static long decode(String key) { + char[] shorts = key.toCharArray(); + int len = shorts.length; + long id = 0L; + for (int i = 0; i < len; i++) { + id = id + (long) (NUMBERS.get(shorts[i]) * Math.pow(SEED, len-i-1)); + } + return id; + } + + + public String nextShortId() { + return encode(snowflake.nextId()); + } +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/utils/IpHelper.java b/nakadai/src/main/java/com/huoran/nakadai/utils/IpHelper.java new file mode 100644 index 0000000..588dcfc --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/utils/IpHelper.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.utils; + + +import javax.servlet.http.HttpServletRequest; + +/** + * IP帮助工具 + * @author lanhai + */ +public class IpHelper { + private static final String UNKNOWN = "unknown"; + + /** + * 得到用户的真实地址,如果有多个就取第一个 + * + * @return + */ + public static String getIpAddr() { + HttpServletRequest request = HttpContextUtils.getHttpServletRequest(); + if (request == null) { + return null; + } + String ip = request.getHeader("x-forwarded-for"); + if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) { + ip = request.getHeader("Proxy-Client-IP"); + } + if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) { + ip = request.getHeader("WL-Proxy-Client-IP"); + } + if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) { + ip = request.getRemoteAddr(); + } + String[] ips = ip.split(","); + return ips[0].trim(); + } + + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/utils/Json.java b/nakadai/src/main/java/com/huoran/nakadai/utils/Json.java new file mode 100644 index 0000000..51a34c2 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/utils/Json.java @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.utils; + + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.json.JsonWriteFeature; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import lombok.extern.slf4j.Slf4j; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +/** + * @author lanhai + */ +@Slf4j +public class Json { + + private static ObjectMapper objectMapper = new ObjectMapper(); + + static { + // 如果为空则不输出 + objectMapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY); + // 对于空的对象转json的时候不抛出错误 + objectMapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS); + // 禁用序列化日期为timestamps + objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + // 禁用遇到未知属性抛出异常 + objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); + // 取消对非ASCII字符的转码 + objectMapper.configure(JsonWriteFeature.ESCAPE_NON_ASCII.mappedFeature(), false); + + } + + /** + * 对象转json + * @param object + * @return + */ + public static String toJsonString(Object object) { + try { + return objectMapper.writeValueAsString(object); + } catch (JsonProcessingException e) { + log.error("对象转json错误:", e); + } + return null; + } + + /** + * json转换换成对象 + * @param json + * @param clazz + * @return + */ + public static T parseObject(String json, Class clazz) { + T result = null; + try { + result = objectMapper.readValue(json, clazz); + } catch (Exception e) { + log.error("对象转json错误:", e); + } + return result; + } + + public static ObjectMapper getObjectMapper() { + return objectMapper; + } + + + /** + * * https://stackoverflow.com/questions/6349421/how-to-use-jackson-to-deserialise-an-array-of-objects + * * List myObjects = Arrays.asList(mapper.readValue(json, MyClass[].class)) + * * works up to 10 time faster than TypeRefence. + * @return + */ + public static List parseArray(String json, Class clazz){ + T[] result = null; + try { + result = objectMapper.readValue(json, clazz); + } catch (Exception e) { + log.error("Json转换错误:", e); + } + if (result == null) { + return Collections.emptyList(); + } + return Arrays.asList(result); + } + + + /** + * 转换成json节点,即map + * @param jsonStr + * @return + */ + public static JsonNode parseJson(String jsonStr) { + JsonNode jsonNode = null; + try { + jsonNode = objectMapper.readTree(jsonStr); + } catch (Exception e) { + log.error("Json转换错误:", e); + } + return jsonNode; + } +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/utils/MyBatisPlusCodeGenerator.java b/nakadai/src/main/java/com/huoran/nakadai/utils/MyBatisPlusCodeGenerator.java index a89e7ef..bb5af0c 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/utils/MyBatisPlusCodeGenerator.java +++ b/nakadai/src/main/java/com/huoran/nakadai/utils/MyBatisPlusCodeGenerator.java @@ -50,7 +50,7 @@ public class MyBatisPlusCodeGenerator { // 开启 BaseResultMap gc.setBaseResultMap(true); // 指定生成的主键的ID类型 - gc.setIdType(IdType.ID_WORKER); + gc.setIdType(IdType.AUTO); // 时间类型对应策略: 只使用 java.utils.date 代替 gc.setDateType(DateType.ONLY_DATE); mpg.setGlobalConfig(gc); diff --git a/nakadai/src/main/java/com/huoran/nakadai/utils/PageAdapter.java b/nakadai/src/main/java/com/huoran/nakadai/utils/PageAdapter.java new file mode 100644 index 0000000..ba07e9a --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/utils/PageAdapter.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.utils; + +import cn.hutool.core.util.PageUtil; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.Data; + +/** + * @author lh + */ +@Data +public class PageAdapter{ + + private int begin; + + private int size; + + public PageAdapter(Page page) { + int[] startEnd = PageUtil.transToStartEnd((int) page.getCurrent() - 1, (int) page.getSize()); + this.begin = startEnd[0]; + this.size = (int)page.getSize(); + } +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/utils/PageParam.java b/nakadai/src/main/java/com/huoran/nakadai/utils/PageParam.java new file mode 100644 index 0000000..cc3dca6 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/utils/PageParam.java @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.utils; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.fasterxml.jackson.annotation.JsonIgnore; + + +import java.util.List; +/** + * @author lanhai + */ +public class PageParam extends Page { + + + /** + * 每页显示条数,默认 10 + */ +// @Schema(description = "每页大小,默认10") + private long size = 10; + + /** + * 当前页 + */ +// @Schema(description = "当前页,默认1") + private long current = 1; + + /** + * 查询数据列表 + */ +// @Hidden + private List records; + /** + * 总数 + */ +// @Hidden + private long total = 0; + + + /** + * 是否进行 count 查询 + */ + @JsonIgnore + private boolean isSearchCount = true; + + @JsonIgnore + private String countId; + @JsonIgnore + private Long maxLimit; + @JsonIgnore + private boolean optimizeCountSql; + + @Override + public List getRecords() { + return this.records; + } + + @Override + public Page setRecords(List records) { + this.records = records; + return this; + } + + @Override + public long getTotal() { + return this.total; + } + + @Override + public Page setTotal(long total) { + this.total = total; + return this; + } + + @JsonIgnore + public boolean getSearchCount() { + if (total < 0) { + return false; + } + return isSearchCount; + } + +// @Override +// public Page setSearchCount(boolean isSearchCount) { +// this.isSearchCount = isSearchCount; +// return this; +// } + + @Override + public long getSize() { + return this.size; + } + + @Override + public Page setSize(long size) { + int maxSize = 100; + if (size > maxSize) { + this.size = maxSize; + } else { + this.size = size; + } + return this; + } + + @Override + public long getCurrent() { + return this.current; + } + + @Override + public Page setCurrent(long current) { + this.current = current; + return this; + } +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/utils/PrincipalUtil.java b/nakadai/src/main/java/com/huoran/nakadai/utils/PrincipalUtil.java new file mode 100644 index 0000000..3026d58 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/utils/PrincipalUtil.java @@ -0,0 +1,57 @@ +package com.huoran.nakadai.utils; + +import cn.hutool.core.util.StrUtil; + +import java.util.regex.Pattern; + +/** + * 正则表达式工具 + * @author LGH + */ +public class PrincipalUtil { + + /** + * 以1开头,后面跟10位数 + */ + public static final String MOBILE_REGEXP = "1[0-9]{10}"; + + /** + * 数字字母下划线 4-16位 + */ + public static final String USER_NAME_REGEXP = "([a-zA-Z0-9_]{4,16})"; + + /** + * 由简单的字母数字拼接而成的字符串 不含有下划线,大写字母 + */ + public static final String SIMPLE_CHAR_REGEXP = "([a-z0-9]+)"; + + public static boolean isMobile(String value) { + if(StrUtil.isBlank(value)) { + return false; + } + return Pattern.matches(MOBILE_REGEXP, value); + } + + public static boolean isUserName(String value) { + if(StrUtil.isBlank(value)) { + return false; + } + return Pattern.matches(USER_NAME_REGEXP, value); + } + + public static boolean isMatching(String regexp, String value) { + if (StrUtil.isBlank(value)) { + return false; + } + return Pattern.matches(regexp, value); + } + + /** + * 是否是由简单的字母数字拼接而成的字符串 + * @param value 输入值 + * @return 匹配结果 + */ + public static boolean isSimpleChar(String value) { + return isMatching(SIMPLE_CHAR_REGEXP, value); + } +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/utils/RedisUtil.java b/nakadai/src/main/java/com/huoran/nakadai/utils/RedisUtil.java new file mode 100644 index 0000000..29d0bf2 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/utils/RedisUtil.java @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.utils; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.StringRedisTemplate; + +import java.util.Arrays; +import java.util.concurrent.TimeUnit; + +/** + * @author lh + */ +@Slf4j +public class RedisUtil { + private static RedisTemplate redisTemplate = SpringContextUtils.getBean("redisTemplate", RedisTemplate.class); + + public static final StringRedisTemplate STRING_REDIS_TEMPLATE = SpringContextUtils.getBean("stringRedisTemplate",StringRedisTemplate.class); + + //=============================common============================ + + /** + * 指定缓存失效时间 + * + * @param key 键 + * @param time 时间(秒) + * @return + */ + public static boolean expire(String key, long time) { + try { + if (time > 0) { + redisTemplate.expire(key, time, TimeUnit.SECONDS); + } + return true; + } catch (Exception e) { + log.error("设置redis指定key失效时间错误:", e); + return false; + } + } + + /** + * 根据key 获取过期时间 + * + * @param key 键 不能为null + * @return 时间(秒) 返回0代表为永久有效 失效时间为负数,说明该主键未设置失效时间(失效时间默认为-1) + */ + public static Long getExpire(String key) { + return redisTemplate.getExpire(key, TimeUnit.SECONDS); + } + + /** + * 判断key是否存在 + * + * @param key 键 + * @return true 存在 false 不存在 + */ + public static Boolean hasKey(String key) { + try { + return redisTemplate.hasKey(key); + } catch (Exception e) { + log.error("redis判断key是否存在错误:", e); + return false; + } + } + + /** + * 删除缓存 + * + * @param key 可以传一个值 或多个 + */ + @SuppressWarnings("unchecked") + public static void del(String... key) { + if (key != null && key.length > 0) { + if (key.length == 1) { + redisTemplate.delete(key[0]); + } else { + redisTemplate.delete(Arrays.asList(key)); + } + } + } + + //============================String============================= + + /** + * 普通缓存获取 + * + * @param key 键 + * @return 值 + */ + @SuppressWarnings("unchecked") + public static T get(String key) { + return key == null ? null : (T) redisTemplate.opsForValue().get(key); + } + + /** + * 普通缓存放入 + * + * @param key 键 + * @param value 值 + * @return true成功 false失败 + */ + public static boolean set(String key, Object value) { + try { + redisTemplate.opsForValue().set(key, value); + return true; + } catch (Exception e) { + log.error("设置redis缓存错误:", e); + return false; + } + + } + + /** + * 普通缓存放入并设置时间 + * + * @param key 键 + * @param value 值 + * @param time 时间(秒) time要大于0 如果time小于等于0 将设置无限期 + * @return true成功 false 失败 + */ + public static boolean set(String key, Object value, long time) { + try { + if (time > 0) { + redisTemplate.opsForValue().set(key, value, time, TimeUnit.SECONDS); + } else { + set(key, value); + } + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 递增 此时value值必须为int类型 否则报错 + * + * @param key 键 + * @param delta 要增加几(大于0) + * @return + */ + public static Long incr(String key, long delta) { + if (delta < 0) { + throw new RuntimeException("递增因子必须大于0"); + } + return STRING_REDIS_TEMPLATE.opsForValue().increment(key, delta); + } + + /** + * 递减 + * + * @param key 键 + * @param delta 要减少几(小于0) + * @return + */ + public static Long decr(String key, long delta) { + if (delta < 0) { + throw new RuntimeException("递减因子必须大于0"); + } + return STRING_REDIS_TEMPLATE.opsForValue().increment(key, -delta); + } +} \ No newline at end of file diff --git a/nakadai/src/main/java/com/huoran/nakadai/utils/SpelUtil.java b/nakadai/src/main/java/com/huoran/nakadai/utils/SpelUtil.java new file mode 100644 index 0000000..073715a --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/utils/SpelUtil.java @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.utils; + +import cn.hutool.core.util.ArrayUtil; +import cn.hutool.core.util.StrUtil; +import org.springframework.context.expression.MethodBasedEvaluationContext; +import org.springframework.core.LocalVariableTableParameterNameDiscoverer; +import org.springframework.expression.ExpressionParser; +import org.springframework.expression.spel.standard.SpelExpressionParser; +import org.springframework.expression.spel.support.StandardEvaluationContext; + +import java.lang.reflect.Method; + +/** + * 解析SPEL 表达式 + * @author huxingnan + * @date 2018/5/21 10:51 + */ +public class SpelUtil { + + /** + * 支持 #p0 参数索引的表达式解析 + * @param rootObject 根对象,method 所在的对象 + * @param spel 表达式 + * @param method ,目标方法 + * @param args 方法入参 + * @return 解析后的字符串 + */ + public static String parse(Object rootObject,String spel, Method method, Object[] args) { + if (StrUtil.isBlank(spel)) { + return StrUtil.EMPTY; + } + //获取被拦截方法参数名列表(使用Spring支持类库) + LocalVariableTableParameterNameDiscoverer u = + new LocalVariableTableParameterNameDiscoverer(); + String[] paraNameArr = u.getParameterNames(method); + if (ArrayUtil.isEmpty(paraNameArr)) { + return spel; + } + //使用SPEL进行key的解析 + ExpressionParser parser = new SpelExpressionParser(); + //SPEL上下文 + StandardEvaluationContext context = new MethodBasedEvaluationContext(rootObject,method,args,u); + //把方法参数放入SPEL上下文中 + for (int i = 0; i < paraNameArr.length; i++) { + context.setVariable(paraNameArr[i], args[i]); + } + return parser.parseExpression(spel).getValue(context, String.class); + } +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/utils/SpringContextUtils.java b/nakadai/src/main/java/com/huoran/nakadai/utils/SpringContextUtils.java new file mode 100644 index 0000000..c628678 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/utils/SpringContextUtils.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + +package com.huoran.nakadai.utils; + +import org.springframework.beans.BeansException; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.stereotype.Component; + +/** + * Spring Context 工具类 + * @author lgh + */ +@Component +public class SpringContextUtils implements ApplicationContextAware { + public static ApplicationContext applicationContext; + + @Override + public void setApplicationContext(ApplicationContext applicationContext) + throws BeansException { + SpringContextUtils.applicationContext = applicationContext; + } + + public static Object getBean(String name) { + return applicationContext.getBean(name); + } + + public static T getBean(String name, Class requiredType) { + return applicationContext.getBean(name, requiredType); + } + + public static boolean containsBean(String name) { + return applicationContext.containsBean(name); + } + + public static boolean isSingleton(String name) { + return applicationContext.isSingleton(name); + } + + public static Class getType(String name) { + return applicationContext.getType(name); + } + +} \ No newline at end of file diff --git a/nakadai/src/main/resources/admin.properties b/nakadai/src/main/resources/admin.properties new file mode 100644 index 0000000..d8bf33e --- /dev/null +++ b/nakadai/src/main/resources/admin.properties @@ -0,0 +1,2 @@ +admin.datacenterId=1 +admin.workerId=0 diff --git a/nakadai/src/main/resources/bootstrap.properties b/nakadai/src/main/resources/bootstrap.properties index 10226b4..f915376 100644 --- a/nakadai/src/main/resources/bootstrap.properties +++ b/nakadai/src/main/resources/bootstrap.properties @@ -22,14 +22,14 @@ kindergarten.wxopen.appid=wxd210bb4686c9c580 kindergarten.wxopen.appsecret=23b2ecfdd893f1feef31fd1a8ce65379 kindergarten.wxopen.redirect_url=http://192.168.31.116:9000/apiHrmsAuth/hrms/auth/userlogin/user/callback -#spring.mail.host=smtp.qq.com -#spring.mail.port=587 -#spring.mail.username=1251790704@qq.com -#spring.mail.password=tgbteukyosdnhadh -#spring.mail.default-encoding=UTF-8 -#spring.mail.properties.mail.smtp.socketFactoryClass=javax.net.ssl.SSLSocketFactory -#spring.mail.properties.mail.debug=true -#spring.mail.from=1251790704@qq.com +spring.mail.host=smtp.qq.com +spring.mail.port=587 +spring.mail.username=1251790704@qq.com +spring.mail.password=tgbteukyosdnhadh +spring.mail.default-encoding=UTF-8 +spring.mail.properties.mail.smtp.socketFactoryClass=javax.net.ssl.SSLSocketFactory +spring.mail.properties.mail.debug=true +spring.mail.from=1251790704@qq.com #email.url=D:/copyWriting/ diff --git a/occupationlab/pom.xml b/occupationlab/pom.xml deleted file mode 100644 index cf083ce..0000000 --- a/occupationlab/pom.xml +++ /dev/null @@ -1,165 +0,0 @@ - - - 4.0.0 - - - huoran - com.huoran.parent - 1.0-SNAPSHOT - - - com.huoran - occupationlab - 1.0.0 - occupationlab - - 职站微服务 - - 1.8 - - - - - - - - - - - - commons-codec - commons-codec - 1.15 - - - - - org.springframework.boot - spring-boot-starter-actuator - - - - com.huoran.common - common - 0.0.1-SNAPSHOT - - - - - com.huoran.api - api - 1.0-SNAPSHOT - compile - - - - com.alibaba - easyexcel - - - - org.apache.poi - poi-ooxml - - - org.apache.poi - poi - - - - - cn.afterturn - easypoi-base - - - guava - com.google.guava - - - guava - com.google.guava - - - poi-ooxml-schemas - org.apache.poi - - - - - cn.afterturn - easypoi-web - - - cn.afterturn - easypoi-annotation - - - org.freemarker - freemarker - - - org.apache.shiro - shiro-spring - - - - org.quartz-scheduler - quartz - - - com.mchange - c3p0 - - - com.zaxxer - HikariCP-java6 - - - - - - - - - - - src/main/java - - **/*.xml - - - - src/main/resources - - **/*.properties - **/*.xlsx - **/*.ftl - - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.22.2 - - true - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/OccupationlabApplication.java b/occupationlab/src/main/java/com/huoran/occupationlab/OccupationlabApplication.java deleted file mode 100644 index 843d767..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/OccupationlabApplication.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.huoran.occupationlab; - -import org.mybatis.spring.annotation.MapperScan; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.cloud.client.discovery.EnableDiscoveryClient; -import org.springframework.cloud.openfeign.EnableFeignClients; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.scheduling.annotation.EnableScheduling; - -//@EnableScheduling//定时任务 -//@EnableRabbit//开启rabbitmq -@SpringBootApplication -@EnableDiscoveryClient -@EnableFeignClients(basePackages = "com.huoran.api") -@MapperScan(basePackages = "com.huoran.occupationlab.mapper") -@ComponentScan(basePackages = {"com.huoran"}) -public class OccupationlabApplication { - - public static void main(String[] args) { - SpringApplication.run(OccupationlabApplication.class, args); - } - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/config/MyThreadConfig.java b/occupationlab/src/main/java/com/huoran/occupationlab/config/MyThreadConfig.java deleted file mode 100644 index 65e63cb..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/config/MyThreadConfig.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.huoran.occupationlab.config; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import java.util.concurrent.Executors; -import java.util.concurrent.LinkedBlockingDeque; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - -//@EnableConfigurationProperties(ThreadPoolConfigProperties.class) -@Configuration -public class MyThreadConfig { - - @Bean - public ThreadPoolExecutor threadPoolExecutor(ThreadPoolConfigProperties pool) { - return new ThreadPoolExecutor(pool.getCoreSize(), - pool.getMaxSize(), - pool.getKeepAliveTime(), - TimeUnit.SECONDS, - new LinkedBlockingDeque<>(100000), - Executors.defaultThreadFactory(), - new ThreadPoolExecutor.AbortPolicy()); - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/config/RabbitConfig.java b/occupationlab/src/main/java/com/huoran/occupationlab/config/RabbitConfig.java deleted file mode 100644 index 033a166..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/config/RabbitConfig.java +++ /dev/null @@ -1,52 +0,0 @@ -/* -package com.huoran.occupationlab.config; - -import com.huoran.common.constant.RabbitmqConstant; -import org.springframework.amqp.core.Binding; -import org.springframework.amqp.core.DirectExchange; -import org.springframework.amqp.core.Exchange; -import org.springframework.amqp.core.Queue; -import org.springframework.amqp.rabbit.core.RabbitTemplate; -import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter; -import org.springframework.amqp.support.converter.MessageConverter; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - - -@Configuration -public class RabbitConfig { - - @Autowired - RabbitTemplate rabbitTemplate; - - */ -/** - * mq消息转换json格式 - * @return json - *//* - - @Bean - public MessageConverter messageConverter(){ - return new Jackson2JsonMessageConverter(); - } - - @Bean - public Exchange courseExchange(){ - return new DirectExchange(RabbitmqConstant.COURSE_EXCHANGE,true,false); - } - - @Bean - public Queue courseQueue(){ - return new Queue(RabbitmqConstant.COURSE_QUEUE,true,false,false); - } - - @Bean - public Binding courseBind(){ - return new Binding(RabbitmqConstant.COURSE_QUEUE, - Binding.DestinationType.QUEUE, - RabbitmqConstant.COURSE_EXCHANGE, - RabbitmqConstant.COURSE_ROUTING_KEY,null); - } -} -*/ diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/config/SwaggerConfig.java b/occupationlab/src/main/java/com/huoran/occupationlab/config/SwaggerConfig.java deleted file mode 100644 index d7fc6d1..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/config/SwaggerConfig.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.huoran.occupationlab.config; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import springfox.documentation.builders.ApiInfoBuilder; -import springfox.documentation.builders.ParameterBuilder; -import springfox.documentation.builders.PathSelectors; -import springfox.documentation.builders.RequestHandlerSelectors; -import springfox.documentation.schema.ModelRef; -import springfox.documentation.service.ApiInfo; -import springfox.documentation.service.Parameter; -import springfox.documentation.spi.DocumentationType; -import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger.web.*; -import springfox.documentation.swagger2.annotations.EnableSwagger2; - -import java.util.ArrayList; -import java.util.List; - -@Configuration -@EnableSwagger2 -@Profile({"dev","test"}) -public class SwaggerConfig { - - @Bean - public Docket createRestApi() { - // 构造token给测试的时候填写 - ParameterBuilder tokenPar = new ParameterBuilder(); - List pars = new ArrayList(); - tokenPar.name("token").description("用户令牌(不需用户鉴权的不需要传)").modelRef(new ModelRef("string")).parameterType("header") - .required(false).build(); - pars.add(tokenPar.build()); - - return new Docket(DocumentationType.SWAGGER_2) - .apiInfo(apiInfo()) - .select() - .apis(RequestHandlerSelectors.basePackage("com.huoran.occupationlab.controller")) - .apis(RequestHandlerSelectors.withClassAnnotation(Api.class)) - .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) - .paths(PathSelectors.any()) - .build().globalOperationParameters(pars); - } - - - @Bean - UiConfiguration uiConfig() { - return UiConfigurationBuilder.builder() - .docExpansion(DocExpansion.LIST) - .deepLinking(true) - .displayOperationId(false) - // 隐藏UI上的Models模块 - .defaultModelsExpandDepth(-1) - .defaultModelExpandDepth(0) - .defaultModelRendering(ModelRendering.EXAMPLE) - .displayRequestDuration(false) - .docExpansion(DocExpansion.NONE) - .filter(false) - .maxDisplayedTags(null) - .operationsSorter(OperationsSorter.ALPHA) - .showExtensions(false) - .tagsSorter(TagsSorter.ALPHA) - .validatorUrl(null) - .build(); - } - - private ApiInfo apiInfo() { - return new ApiInfoBuilder() - .title("职站微服务接口文档") - .description("Rong") - .contact("developer@mail.com") - .version("1.0") - .build(); - } - -} \ No newline at end of file diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/config/SysLogAspect.java b/occupationlab/src/main/java/com/huoran/occupationlab/config/SysLogAspect.java deleted file mode 100644 index 6d06f4e..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/config/SysLogAspect.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.huoran.occupationlab.config; - -import com.alibaba.fastjson.JSON; -import com.huoran.api.UserClient; -import com.huoran.common.aop.annotation.LogAnnotation; -import com.huoran.common.utils.HttpContextUtils; -import com.huoran.common.utils.IPUtils; -import com.huoran.common.utils.TokenUtils; -import com.huoran.occupationlab.entity.SysLog; -import com.huoran.occupationlab.mapper.SysLogMapper; -import lombok.extern.slf4j.Slf4j; -import org.aspectj.lang.ProceedingJoinPoint; -import org.aspectj.lang.annotation.Around; -import org.aspectj.lang.annotation.Aspect; -import org.aspectj.lang.annotation.Pointcut; -import org.aspectj.lang.reflect.MethodSignature; -import org.springframework.context.annotation.Lazy; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.lang.reflect.Method; - -/** - * 日志切面 - * - * @author cheney - * @version V1.0 - * @date 2022年7月28日 - */ -@Aspect -@Component -@Slf4j -public class SysLogAspect { - @Lazy - @Resource - private SysLogMapper sysLogMapper; - - @Lazy - @Resource - private UserClient userClient; - - /** - * 此处的切点是注解的方式 - * 只要出现 @LogAnnotation注解都会进入 - */ - @Pointcut("@annotation(com.huoran.common.aop.annotation.LogAnnotation)") - public void logPointCut() { - - } - - /** - * 环绕增强,相当于MethodInterceptor - */ - @Around("logPointCut()") - public Object around(ProceedingJoinPoint point) throws Throwable { - long beginTime = System.currentTimeMillis(); - //执行方法 - Object result = point.proceed(); - //执行时长(毫秒) - long time = System.currentTimeMillis() - beginTime; - - //保存日志 - try { - saveSysLog(point, time); - } catch (Exception e) { - log.error("sysLog,exception:{}", e, e); - } - - return result; - } - - /** - * 把日志保存 - */ - private void saveSysLog(ProceedingJoinPoint joinPoint, long time) { - MethodSignature signature = (MethodSignature) joinPoint.getSignature(); - Method method = signature.getMethod(); - - SysLog sysLog = new SysLog(); - LogAnnotation logAnnotation = method.getAnnotation(LogAnnotation.class); - if (logAnnotation != null) { - //注解上的描述 - sysLog.setOperation(logAnnotation.title() + "-" + logAnnotation.action()); - } - - //请求的方法名 - String className = joinPoint.getTarget().getClass().getName(); - String methodName = signature.getName(); - sysLog.setMethod(className + "." + methodName + "()"); - log.info("请求{}.{}耗时{}毫秒", className, methodName, time); - try { - //请求的参数 - Object[] args = joinPoint.getArgs(); - String params = null; - if (args.length != 0) { - params = JSON.toJSONString(args); - } - - sysLog.setParams(params); - } catch (Exception e) { - log.error("sysLog,exception:{}", e, e); - } - //获取request - HttpServletRequest request = HttpContextUtils.getHttpServletRequest(); - //设置IP地址 - sysLog.setIp(IPUtils.getIpAddr(request)); - log.info("Ip{},接口地址{},请求方式{},入参:{}", sysLog.getIp(), request.getRequestURL(), request.getMethod(), sysLog.getParams()); - //用户名 - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - sysLog.setUserName(userClient.getUserName(Integer.valueOf(accountId))); - sysLog.setUserId(accountId); - sysLog.setSchoolId(schoolId); - sysLog.setTime((int) time); - log.info(sysLog.toString()); - sysLogMapper.insert(sysLog); - - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/config/ThreadPoolConfigProperties.java b/occupationlab/src/main/java/com/huoran/occupationlab/config/ThreadPoolConfigProperties.java deleted file mode 100644 index 2a68831..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/config/ThreadPoolConfigProperties.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.huoran.occupationlab.config; - -import lombok.Data; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.stereotype.Component; - -@ConfigurationProperties(prefix = "occupationlab.thread") -@Component -@Data -public class ThreadPoolConfigProperties { - private Integer coreSize; - private Integer maxSize; - private Integer keepAliveTime; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/AchievementController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/AchievementController.java deleted file mode 100644 index e9da03d..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/AchievementController.java +++ /dev/null @@ -1,754 +0,0 @@ -package com.huoran.occupationlab.controller; - -import cn.hutool.core.util.StrUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.api.UserClient; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.occupationlab.entity.*; -import com.huoran.occupationlab.entity.Class; -import com.huoran.occupationlab.entity.req.*; -import com.huoran.occupationlab.entity.resp.*; -import com.huoran.occupationlab.entity.vo.ActivityDerivationVO; -import com.huoran.occupationlab.entity.vo.PerformanceManagementPracticeActivityVO; -import com.huoran.occupationlab.entity.vo.PracticeTheHighestScoreListVO; -import com.huoran.occupationlab.entity.vo.ProductClassInformationVO; -import com.huoran.occupationlab.mapper.ArchitectureMapper; -import com.huoran.occupationlab.service.*; -import com.huoran.occupationlab.utils.DelTagsUtil; -import com.huoran.occupationlab.utils.ImgUtil; -import freemarker.cache.ClassTemplateLoader; -import freemarker.template.Configuration; -import freemarker.template.Template; -import freemarker.template.TemplateException; -import freemarker.template.Version; -import io.swagger.annotations.ApiParam; -import lombok.SneakyThrows; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import java.io.*; -import java.net.URLEncoder; -import java.util.*; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -/** - * @描述:成绩管理 - * @作者: Rong - * @日期: 2021-09-06 - */ -@RestController -@RequestMapping("/occupationlab/achievement") -@Api(value = "职站:成绩管理", tags = "职站:成绩管理") -public class AchievementController { - - @Autowired - public ExperimentalReportService experimentalReportService; - @Autowired - public AssessmentService assessmentService; - - @Autowired - public StudentService studentService; - @Autowired - public ClassService classService; - - @Autowired - private ProjectManageService projectManageService; - - @Autowired - private ArchitectureMapper architectureMapper; - @Autowired - private UserClient userClient; - - /** - * @Description: 管理端成绩管理 - * @auther: Rong - * @date: 2021/9/8 10:27 - */ - @PostMapping("/getAchievementInfo") - @ApiOperation(value = " 管理端成绩管理", response = AchievementResp.class) - public R getAchievementInfo(@RequestBody @Valid PageAchievementByTeacherReq req, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - req.setAccountId(Integer.valueOf(accountId)); - req.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - return experimentalReportService.getAchievementInfo(req); - } - - /** - * @Description: 教师端:我的班级 - * @auther: Rong - * @date: 2021/9/8 10:27 - */ - @PostMapping("/myClass") - @ApiOperation(value = "教师端:我的班级", response = Class.class) - public R myClass(HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - return assessmentService.getMineClass(Integer.valueOf(accountId)); - } - - /** - * @Description: 学生端:我的班级 - * @auther: Rong - * @date: 2021/9/8 10:27 - */ - @PostMapping("/myClassByStudent") - @ApiOperation(value = "学生端:我的班级", response = Class.class) - public R myClassByStudent(HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - /*QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("account_id", accountId); - queryWrapper.eq("is_del", DelConstant.NOT_DEL); - List studentList = studentService.list(queryWrapper); - List classList = new ArrayList<>(); - studentList.stream().forEach(student -> { - for (String cid : student.getClassId().split(",")) { - Class cla = classService.getById(Integer.valueOf(cid)); - classList.add(cla); - } - });*/ - List classList = new ArrayList<>(); - Set set = assessmentService.myClassByStudent(Integer.valueOf(accountId), userClient.getSchoolIdByAccountId(accountId)); - Iterator it = set.iterator(); - while (it.hasNext()) { - String classId = (String) it.next(); - Class cla = classService.getById(Integer.valueOf(classId)); - classList.add(cla); - } - return R.ok().put("data", classList); - } - - /** - * @Description: 管理端练习成绩详情 - * @auther: Rong - * @date: 2021/9/8 10:28 - */ - @PostMapping("/getPracticeDetail") - @ApiOperation(value = "管理端练习成绩详情", response = AchievementResp.class) - public R getPracticeDetail(@ApiParam(value = "项目id", required = true) @RequestParam("projectId") Integer projectId, - @ApiParam(value = "当前页数", required = true) @RequestParam("pageNum") Integer pageNum, - @ApiParam(value = "当前页需要显示的数量", required = true) @RequestParam("pageSize") Integer pageSize, - @ApiParam(value = "班级id", required = false) @RequestParam("classId") Integer classId, - @ApiParam(value = "关键词", required = false) @RequestParam("keyWord") String keyWord, - @ApiParam(value = "商品id", required = false) @RequestParam("mallId") Integer mallId, - HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - return experimentalReportService.getPracticeDetail(projectId, pageNum, pageSize, schoolId, classId, keyWord,mallId); - - } - - /** - * @Description: 管理端考核成绩详情 - * @auther: Rong - * @date: 2021/9/8 15:11 - */ - @PostMapping("/getAssessmentDetail") - @ApiOperation(value = "管理端考核成绩详情", response = AchievementResp.class) - public R getAssessmentDetail(@ApiParam(value = "考核id", required = true) @RequestParam("assessmentId") Integer assessmentId, - @ApiParam(value = "班级id", required = false) @RequestParam("classId") Integer classId, - @ApiParam(value = "当前页数", required = true) @RequestParam("pageNum") Integer pageNum, - @ApiParam(value = "当前页需要显示的数量", required = true) @RequestParam("pageSize") Integer pageSize, - @ApiParam(value = "关键词", required = true) @RequestParam("keyword") String keyword, - HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - return experimentalReportService.getAssessmentDetail(assessmentId, classId, pageNum, pageSize,keyword); - } - - /** - * @Description:单个、批量删除实验报告 - * @auther: Rong - * @date: 2021/9/8 15:05 - */ - @ApiOperation(value = "单个、批量删除实验报告") - @PostMapping("/deleteExperimentalReport") - public R deleteExperimentalReport(@RequestBody List ids) { - boolean ret = experimentalReportService.removeByIds(ids); - return ret ? R.ok() : R.error(); - } - - /** - * @Description: 批量导出练习成绩 - * @auther: Rong - * @date: 2021/9/8 15:40 - */ - @ApiOperation(value = "教师端:批量导出练习成绩") - @GetMapping("/exportPracticeInfo") - public void exportPracticeInfo( - @ApiParam(value = "要导出的id", required = false) @RequestParam(value = "ids", required = false) String ids, - @RequestParam("projectId") @ApiParam(value = "项目id", required = true) @NotNull(message = "项目id不能为空") Integer projectId, - @RequestParam("mallId") @ApiParam(value = "商品id", required = true) @NotNull(message = "商品id不能为空") Integer mallId, - HttpServletResponse response, HttpServletRequest request) throws Exception { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - experimentalReportService.exportPracticeInfo(ids, response, schoolId, projectId,mallId); - } - - /** - * @Description: 批量导出考核成绩 - * @auther: Rong - * @date: 2021/9/8 16:39 - */ - @ApiOperation(value = "教师端:批量导出考核成绩") - @GetMapping("/exportAssessmentInfo") - public void exportAssessmentInfo( - @ApiParam(value = "要导出的id", required = false) @RequestParam(value = "ids", required = false) String ids, - @RequestParam("assessmentId") @ApiParam(value = "考核id", required = true) @NotNull(message = "考核id不能为空") Integer assessmentId, - @RequestParam(value = "classId", required = false) @ApiParam(value = "班级id", required = false) Integer classId, - HttpServletResponse response, HttpServletRequest request) throws Exception { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - experimentalReportService.exportAssessmentInfo(ids, response, schoolId, assessmentId, classId); - } - - /** - * @Description: 实验概览 - * @auther: Rong - * @date: 2021/9/8 17:14 - */ - @ApiOperation(value = "实验概览") - @GetMapping("/experimentOverview") - public R experimentOverview(HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - return experimentalReportService.getExperimentOverview(Integer.valueOf(accountId)); - } - - /** - * @Description: 学生端-学生端练习成绩列表 - * @auther: Rong - * @date: 2021/9/9 10:02 - */ - @PostMapping("/queryPracticeByStudent") - @ApiOperation(value = " 学生端练习成绩列表", response = AchievementResp.class) - public R queryPracticeByStudent(@RequestBody @Valid PageAchievementByStuReq req, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - req.setAccountId(Integer.valueOf(accountId)); - return experimentalReportService.queryPracticeByStudent(req); - } - - /** - * @Description: 学生端-学生端练习实验情况 - * @auther: Rong - * @date: 2021/9/30 15:39 - */ - @PostMapping("/practiceByStudentDetail") - @ApiOperation(value = " 学生端练习实验情况", response = AchievementResp.class) - public R practiceByStudentDetail(@RequestParam("curriculumId") @ApiParam(value = "课程id", required = true) @NotNull(message = "课程id不能为空") Integer curriculumId, - @RequestParam("projectId") @ApiParam(value = "项目id", required = true) @NotNull(message = "项目id不能为空") Integer projectId, - @ApiParam(value = "当前页数", required = true) @RequestParam("pageNum") Integer pageNum, - @ApiParam(value = "当前页需要显示的数量", required = true) @RequestParam("pageSize") Integer pageSize, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - //Integer curriculumId, Integer projectId, Integer accountId, Integer pageNum, Integer pageSize - return experimentalReportService.practiceByStudentDetail(curriculumId, projectId, Integer.valueOf(accountId), pageNum, pageSize); - } - - /** - * @Description: 学生端-导出学生端练习实验情况 - * @auther: Rong - * @date: 2021/9/30 15:39 - */ - @ApiOperation(value = "导出学生端练习实验情况") - @GetMapping("/exportPracticeByStudentDetail") - public void exportPracticeByStudentDetail( - @ApiParam(value = "要导出的id(非必填)", required = false) @RequestParam(value = "ids", required = false) String ids, - @ApiParam(value = "项目id(必填)") @RequestParam(value = "projectId", required = true) Integer projectId, - HttpServletResponse response, HttpServletRequest request) throws Exception { - String accountId = TokenUtils.getIdByJwtToken(request); - experimentalReportService.exportPracticeByStudentDetail(ids, projectId, Integer.valueOf(accountId), response); - } - - /** - * @Description: 学生端-考核成绩列表 - * @auther: Rong - * @date: 2021/9/9 10:02 - */ - @PostMapping("/queryAssessmentByStudent") - @ApiOperation(value = " 学生端考核成绩列表", response = AchievementResp.class) - public R queryAssessmentByStudent(@RequestBody @Valid PageAchievementByStuReq req, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - req.setAccountId(Integer.valueOf(accountId)); - return experimentalReportService.queryAssessmentByStudent(req); - } - - /** - * @Description: 批量删除成绩管理中的项目/批量删除成绩管理中的考核 - * 实际做的是隐藏操作 - * @auther: Rong - * @date: 2021/9/23 10:28 - */ - @ApiOperation(value = "批量删除成绩管理中的项目/批量删除成绩管理中的考核") - @GetMapping("/deleteReportById") - public R deleteReportByIds(@ApiParam(name = "projectIds", value = "要删除的项目ids") @RequestParam(required = false) List projectIds, - @ApiParam(name = "projectPermissions", value = "0、练习 1、考核 ") @RequestParam(required = false) Integer projectPermissions, - @ApiParam(name = "ids", value = "要删除的考核ids") @RequestParam(required = false) List ids) { - return experimentalReportService.deleteReportById(projectIds, projectPermissions, ids); - } - - /** - * @Description: 学生批量导出练习成绩 - * @auther: Rong - * @date: 2021/9/8 15:40 - */ - @ApiOperation(value = "学生-批量导出练习成绩") - @GetMapping("/exportPracticeByStudent") - public void exportPracticeByStudent( - /* @ApiParam(value = "要导出的id", required = false) @RequestParam("ids") String ids,*/ - @RequestParam("curriculumId") @ApiParam(value = "课程id", required = true) @NotNull(message = "课程id不能为空") Integer curriculumId, - HttpServletResponse response, HttpServletRequest request) throws Exception { - String accountId = TokenUtils.getIdByJwtToken(request); - - experimentalReportService.exportPracticeByStudent(curriculumId, Integer.valueOf(accountId), response); - } - - /** - * @Description: 学生批量导出考核成绩 - * @auther: Rong - * @date: 2021/9/8 16:39 - */ - @ApiOperation(value = "学生-批量导出考核成绩") - @GetMapping("/exportAssessmentByStudent") - public void exportAssessmentByStudent( - @ApiParam(value = "要导出的id(非必填)") @RequestParam(value = "ids", required = false) String ids, - @RequestParam("curriculumId") @ApiParam(value = "课程id", required = true) @NotNull(message = "课程id不能为空") Integer curriculumId, - HttpServletResponse response, HttpServletRequest request) throws Exception { - String accountId = TokenUtils.getIdByJwtToken(request); - //Integer accountId,Integer curriculumId,String ids - experimentalReportService.exportAssessmentByStudent(Integer.valueOf(accountId), curriculumId, ids, response); - } - - @ApiOperation(value = "学生-成绩报告详情", response = ExperimentalReport.class) - @GetMapping("/reportDetail") - public R reportDetail(@RequestParam("reportId") Integer reportId) { - return experimentalReportService.reportDetail(reportId); - } - - @ApiOperation(value = "学生-修改成绩报告") - @PostMapping("/updateReport") - public R updateReport(@RequestBody com.huoran.common.entity.ExperimentalReport experimentalReport) { - return R.toR(experimentalReportService.updateById(experimentalReport)); - } - - /** - * @Description: 拼接班级 - * @auther: Rong - * @date: 2021/9/8 10:27 - */ - @PostMapping("/spliceClass") - @ApiOperation(value = "拼接班级", response = Class.class) - public R spliceClass(@RequestParam("assessmentId") @ApiParam(value = "考核id", required = true) @NotNull(message = "考核id不能为空") Integer assessmentId, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - return assessmentService.spliceClass(assessmentId); - } - - @PostMapping("/exportLabReport") - @ApiOperation(value = "导出实验报告", httpMethod = "POST", produces = "application/json", notes = "导出用户doc", response = ExperimentalReportResp.class) - public R exportLabReport(@RequestBody ExperimentalReportResp report, HttpServletResponse response) throws IOException, TemplateException { - Configuration configuration = new Configuration(new Version("2.3.28")); - //既能保证本地运行找得到模板文件,又能保证jar包运行能找到得到模板文件 - configuration.setClassForTemplateLoading(this.getClass(), "/excel-template"); - configuration.setTemplateLoader(new ClassTemplateLoader(this.getClass(), "/excel-template")); - Template template = configuration.getTemplate("python.ftl", "utf-8"); - - //定义下载的类型,标明是word文件(这种是浏览器下载的方式) - - response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("导出模板", "UTF-8") + ".doc"); - //response.setContentType("application/octet-stream;charset=UTF-8"); - Map dataMap = new HashMap<>(); - if (report.getUserName() != null) { - dataMap.put("userName", DelTagsUtil.getTextFromHtml(report.getUserName())); - } - - if (report.getPeriod() != null) { - dataMap.put("period", DelTagsUtil.getTextFromHtml(report.getPeriod())); - } - - if (report.getWorkNumber() != null) { - dataMap.put("workNumber", DelTagsUtil.getTextFromHtml(report.getWorkNumber())); - } - - - if (report.getClassName() != null) { - dataMap.put("className", DelTagsUtil.getTextFromHtml(report.getClassName())); - } - - if (report.getProjectName() != null) { - dataMap.put("projectName", DelTagsUtil.getTextFromHtml(report.getProjectName())); - } - - if (report.getSummarize() != null) { - dataMap.put("summarize", DelTagsUtil.getTextFromHtml(report.getSummarize())); - } - if (report.getInstructor() != null) { - dataMap.put("instructor", DelTagsUtil.getTextFromHtml(report.getInstructor())); - } - - dataMap.put("submitTime", String.valueOf(report.getSubmitTime())); - dataMap.put("score", report.getScore()); - dataMap.put("timeSum", report.getTimeSum()); - - if (report.getPurpose() != null) { - dataMap.put("purpose", report.getPurpose()); - } - - List experimentalDataList = new ArrayList<>(); - - for (UserScore userScore : report.getExperimentalData()) { - if (userScore.getJudgmentName() != null) { - userScore.setJudgmentName(DelTagsUtil.getTextFromHtml(userScore.getJudgmentName())); - } - - if (userScore.getAnswer() != null) { - userScore.setAnswer(DelTagsUtil.getTextFromHtml(userScore.getAnswer())); - - } - - if (userScore.getRunResult() != null) { - userScore.setRunResult(DelTagsUtil.getTextFromHtml(userScore.getRunResult())); - - } - - if (userScore.getReferenceAnswer() != null) { - userScore.setReferenceAnswer(DelTagsUtil.getTextFromHtml(userScore.getReferenceAnswer())); - - } - - /*if (userScore.getRunThePicture() != null) { - userScore.setRunThePicture(ImgUtil.imgToBase64(userScore.getRunThePicture())); - - }*/ - - - List imgUrl = new ArrayList<>(); - if (userScore.getRunThePicture() != null) { - if (userScore.getRunThePictureList().size() > 0) { - for (String url : userScore.getRunThePictureList()) { - imgUrl.add(ImgUtil.imgToBase64(url)); - } - userScore.setRunThePictureList(imgUrl); - } - } - - experimentalDataList.add(userScore); - } - dataMap.put("experimentalDataList", experimentalDataList); - - Writer out = null; - out = new BufferedWriter(new OutputStreamWriter(response.getOutputStream(), "UTF-8")); - try { - template.process(dataMap, out); - out.flush(); - out.close(); - } catch (TemplateException e) { - e.printStackTrace(); - return null; - } - - return R.ok(); - } - - @SneakyThrows - @PostMapping("/exportBankExperimentReport") - @ApiOperation(value = "导出银行实验报告", httpMethod = "POST", produces = "application/json", notes = "导出银行实验报告doc", response = ExperimentaForBanklReportReq.class) - public R exportBankExperimentReport(@RequestBody ExperimentaForBanklReportReq req, HttpServletResponse response) throws IOException { - Configuration configuration = new Configuration(new Version("2.3.28")); - //既能保证本地运行找得到模板文件,又能保证jar包运行能找到得到模板文件 - configuration.setClassForTemplateLoading(this.getClass(), "/excel-template"); - configuration.setTemplateLoader(new ClassTemplateLoader(this.getClass(), "/excel-template")); - Template template = configuration.getTemplate("bank1.ftl", "utf-8"); - - //定义下载的类型,标明是word文件(这种是浏览器下载的方式) - - response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("导出模板", "UTF-8") + ".doc"); - Map dataMap = new HashMap<>(); - List experimentalDataList = new ArrayList<>(); - for (BankExperimentDataReq dataReq : req.getExperimentalData()) { - experimentalDataList.add(dataReq); - } - dataMap.put("experimentalDataList", experimentalDataList); - dataMap.put("userName", req.getUserName()); - dataMap.put("workNumber", req.getWorkNumber()); - dataMap.put("className", req.getClassName()); - dataMap.put("projectName", req.getProjectName()); - dataMap.put("summarize", req.getSummarize()); - dataMap.put("instructor", req.getInstructor()); - dataMap.put("submitTime", String.valueOf(req.getSubmitTime())); - dataMap.put("score", req.getScore()); - dataMap.put("timeSum", req.getTimeSum()); - dataMap.put("purpose", req.getPurpose()); - - Writer out = null; - out = new BufferedWriter(new OutputStreamWriter(response.getOutputStream(), "UTF-8")); - try { - template.process(dataMap, out); - out.flush(); - out.close(); - } catch (TemplateException e) { - e.printStackTrace(); - return null; - } - - return R.ok(); - } - - - @PostMapping("/practiceActivity") - @ApiOperation(value = "管理端练习活跃度列表", response = PerformanceManagementPracticeActivityVO.class) - public R practiceActivity(@ApiParam(value = "项目id", required = true) @RequestParam("projectId") Integer projectId, - @ApiParam(value = "当前页数", required = true) @RequestParam("pageNum") Integer pageNum, - @ApiParam(value = "当前页需要显示的数量", required = true) @RequestParam("pageSize") Integer pageSize, - @ApiParam(value = "班级id", required = false) @RequestParam("classId") Integer classId, - @ApiParam(value = "关键词", required = false) @RequestParam("keyWord") String keyWord, - @ApiParam(value = "商品id", required = true) @NotNull(message = "商品id不能为空") Integer mallId, - HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - return experimentalReportService.practiceActivity(projectId, pageNum, pageSize, schoolId, classId, keyWord,mallId); - - } - - - @ApiOperation(value = "导出练习活跃度全部数据", response = PerformanceManagementPracticeActivityVO.class) - @GetMapping("/exportAllData") - public void exportAllData( - @ApiParam(name = "projectId", value = "项目id", required = true) - @RequestParam("projectId") Integer projectId,@ApiParam(name = "mallId", value = "产品id", required = true) - @RequestParam("projectId") Integer mallId, HttpServletRequest request, HttpServletResponse response) { - try { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - experimentalReportService.exportAllData(projectId, schoolId, response,mallId); - } catch (IOException e) { - e.printStackTrace(); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - @ApiOperation(value = "批量练习活跃度导出数据") - @PostMapping(value = "/exportDataInBatches", produces = "application/json;multipart/form-data;charset=utf-8") - public void exportSubscribedRecords( - @RequestBody List listOfExportSub, - HttpServletResponse response, HttpServletRequest request) throws Exception { - experimentalReportService.exportDataInBatches(listOfExportSub, response); - } - - - @PostMapping("/maximumPracticeScoreList") - @ApiOperation(value = "练习列表最高分列表", response = PracticeTheHighestScoreListVO.class) - public R maximumPracticeScoreList(@ApiParam(value = "项目id", required = true) @RequestParam("projectId") Integer projectId, - @ApiParam(value = "当前页数", required = true) @RequestParam("pageNum") Integer pageNum, - @ApiParam(value = "当前页需要显示的数量", required = true) @RequestParam("pageSize") Integer pageSize, - @ApiParam(value = "商品id", required = true) @RequestParam("mallId") Integer mallId, - HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - return experimentalReportService.maximumPracticeScoreList(projectId, pageNum, pageSize, schoolId,mallId); - - } - - - @PostMapping("/practiceByProduct") - @ApiOperation(value = "管理端练习依据产品维度读取", response = ProductClassInformationVO.class) - public R practiceByProduct(@RequestBody AchievementProductDimensionReq req, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - - List newList = new ArrayList<>(); - - //获取本校全部班级列表 - List classList = classService.getClassesUnderTheSchool(schoolId); - for (Class cla : classList) { - //拿到班级的上级年级以及上上级专业 - if (cla.getId() != 1) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("id", cla.getArchitectureId()); - Architecture getGrade = architectureMapper.selectOne(wrapper); - //根据年级拿到专业信息 - QueryWrapper wrapper1 = new QueryWrapper<>(); - wrapper1.eq("id", getGrade.getParentId()); - Architecture getProfessional = architectureMapper.selectOne(wrapper1); - cla.setClassName(getProfessional.getOrganizationName() + "/" + getGrade.getOrganizationName() + "/" + cla.getClassName()); - } - } - - //获取本校购买的产品列表 - List getProduct = experimentalReportService.getProduct(schoolId); - for (ProductClassInformationVO addClass : getProduct) { - for (Class clasInfo : classList) { - addClass.setClassName(clasInfo.getClassName()); - addClass.setClassId(clasInfo.getId()); - - ProductClassInformationVO vo = new ProductClassInformationVO(); - vo.setClassId(clasInfo.getId()); - vo.setClassName(clasInfo.getClassName()); - vo.setMallId(addClass.getMallId()); - vo.setCurriculumName(addClass.getCurriculumName()); - vo.setCid(addClass.getCid()); - newList.add(vo); - } - - } - - Integer builtInTotalNumberOfExercises = 0;//内置的练习项目总数 - Integer builtTntotalNumberOfAssessmentItems = 0;//内置的考核项目总数 - - Integer totalNumberOfSchoolPracticeProjects = 0;//学校练习项目总数 - Integer totalNumberOfSchoolAssessmentItems = 0;//学校考核项目总数 - - Integer classSize = 0;//班级人总数 - - - //循环统计 练习项目数、考核项目数 - for (ProductClassInformationVO proList : newList) { - //统计内置项目+学校自己创建在产品下的项目 - builtInTotalNumberOfExercises = projectManageService.getCurriculumCountByType(proList.getCid(), 0); - - totalNumberOfSchoolPracticeProjects = projectManageService.projectCreatedUnderProduct(proList.getMallId(), 0, schoolId); - builtTntotalNumberOfAssessmentItems = projectManageService.getCurriculumCountByType(proList.getCid(), 1); - totalNumberOfSchoolAssessmentItems = projectManageService.projectCreatedUnderProduct(proList.getMallId(), 1, schoolId); - proList.setNumberOfPracticeItems(builtInTotalNumberOfExercises + totalNumberOfSchoolPracticeProjects); - proList.setNumberOfAssessmentItems(builtTntotalNumberOfAssessmentItems + totalNumberOfSchoolAssessmentItems); - proList.setClassSize(studentService.countClassSizes(schoolId, proList.getClassId())); - } - - Stream stream = newList.stream(); - if (req.getClassId() != null) { - // 筛选班级id - stream = stream.filter(e -> req.getClassId().equals(e.getClassId())); - } - - if (req.getMallId() != null) { - // 筛选产品id - stream = stream.filter(e -> req.getMallId().equals(e.getMallId())); - } - newList = stream.collect(Collectors.toList()); - // 处理分页 - int total = newList.size(); - newList = newList.stream().skip((long) req.getPageSize() * (req.getPageNum() - 1)).limit(req.getPageSize()).collect(Collectors.toList()); - return R.ok().put("data", newList).put("total", total); - } - - @PostMapping("/allClassesInOurSchool") - @ApiOperation(value = "获取本校创建的班级", response = ProductClassInformationVO.class) - public R allClassesInOurSchool(HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - //获取本校全部班级列表 - List classList = classService.getClassesUnderTheSchool(schoolId); - for (Class cla : classList) { - //拿到班级的上级年级以及上上级专业 - - if (cla.getId() != 1) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("id", cla.getArchitectureId()); - Architecture getGrade = architectureMapper.selectOne(wrapper); - //根据年级拿到专业信息 - QueryWrapper wrapper1 = new QueryWrapper<>(); - wrapper1.eq("id", getGrade.getParentId()); - Architecture getProfessional = architectureMapper.selectOne(wrapper1); - cla.setClassName(getProfessional.getOrganizationName() + "/" + getGrade.getOrganizationName() + "/" + cla.getClassName()); - } - } - return R.ok().put("data", classList); - } - - - /** - * 产品维度下读取考核/练习成绩列表 - * - * @param req - * @param request - * @return - */ - @PostMapping("/productReadScore") - @ApiOperation(value = "产品维度下:读取考核/练习成绩(依据permissions参数区分)", response = AchievementResp.class) - public R productReadScore(@RequestBody PerformanceUnderProductReq req, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - req.setSchoolId(schoolId); - return experimentalReportService.productReadScore(req); - - } - - - @PostMapping("/productReadGradeDetails") - @ApiOperation(value = "产品维度下:读取考核/练习成绩详情(依据permissions参数区分)", response = PracticeScoreDetailsUnderProductResp.class) - public R productReadGradeDetails(@RequestBody PerformanceUnderProductReq req, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - req.setSchoolId(schoolId); - return experimentalReportService.productReadGradeDetails(req); - - } - - - @ApiOperation(value = "产品维度下:批量导出产品下的练习成绩") - @PostMapping(value = "/exportProductPracticeResults", produces = "application/json;multipart/form-data;charset=utf-8") - public void exportProductPracticeResults( - @RequestBody List list, - HttpServletResponse response) throws Exception { - /*for (PracticeProjectsUnderTheProductResp resp : list) { - resp.setTotalNumberOfPractices(resp.getTotalNumberOfPractices() + "/" + resp.getTotalNumberOfExercises()); - }*/ - experimentalReportService.exportProductPracticeResults(list, response); - } - - @ApiOperation(value = "产品维度下:批量导出产品下的考核成绩") - @PostMapping(value = "/exportProductAssessResults", produces = "application/json;multipart/form-data;charset=utf-8") - public void exportProductAssessResults( - @RequestBody List list, - HttpServletResponse response) throws Exception { - /*for (AssessProjectsUnderTheProductResp resp : list) { - resp.setTotalNumberOfParticipants(resp.getTotalNumberOfParticipants() + "/" + resp.getTotalAssessment()); - }*/ - experimentalReportService.exportProductAssessResults(list, response); - } - - - @ApiOperation(value = "产品维度下:批量导出学生练习成绩详情") - @PostMapping(value = "/exportDetailsOfStudentPracticeScores", produces = "application/json;multipart/form-data;charset=utf-8") - public void exportDetailsOfStudentPracticeScores( - @RequestBody PerformanceUnderProductReq req, - HttpServletResponse response, HttpServletRequest request) throws Exception { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - req.setSchoolId(schoolId); - experimentalReportService.exportDetailsOfStudentPracticeScores(req, response, request); - } - - @ApiOperation(value = "产品维度下:批量导出学生考核成绩详情") - @PostMapping(value = "/exportDetailsOfStudentAssessmentResults", produces = "application/json;multipart/form-data;charset=utf-8") - public void exportDetailsOfStudentAssessmentResults( - @RequestBody PerformanceUnderProductReq req, - HttpServletResponse response, HttpServletRequest request) throws Exception { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - req.setSchoolId(schoolId); - experimentalReportService.exportDetailsOfStudentAssessmentResults(req, response, request); - } - - - @PostMapping("/dataBinding") - @ApiOperation(value = "实验报告旧数据绑定绑定产品", response = ProductClassInformationVO.class) - public R dataBinding(HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - //获取本校全部班级列表 - List list = experimentalReportService.experimentalReportDataProcessing(); - - for (ExperimentalReportDataBindingResp resp: list) { - Assessment assessment = new Assessment(); - assessment.setId(resp.getId()); - assessment.setMallId(resp.getMallId()); - assessmentService.updateById(assessment); - } - return R.ok(); - } -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/ApplicantController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/ApplicantController.java deleted file mode 100644 index 1c220da..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/ApplicantController.java +++ /dev/null @@ -1,160 +0,0 @@ -package com.huoran.occupationlab.controller; - -import com.huoran.api.UserClient; -import com.huoran.common.constant.EnableStatus; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.occupationlab.entity.Applicant; -import com.huoran.occupationlab.entity.Contest; -import com.huoran.common.entity.School; -import com.huoran.occupationlab.entity.req.PageRegistrationStaffReq; -import com.huoran.occupationlab.entity.vo.ApplicantVO; -import com.huoran.occupationlab.service.ApplicantService; -import com.huoran.occupationlab.service.ContestRangeService; -import com.huoran.occupationlab.service.ContestService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.Date; -import java.util.List; - -/** - * 赛事报名人员 前端控制器 - * - * @author chen - * @since 2020-10-15 - */ -@Api(description = "竞赛报名人员管理", tags = "竞赛报名人员管理") -@RestController -@RequestMapping("/occupationlab/enterprise/match/applicant") -public class ApplicantController { - - @Autowired - private ApplicantService applicantService; - @Autowired - private UserClient userClient; - - @Autowired - private ContestService contestService; - - @Autowired - private ContestRangeService contestRangeService; - - @ApiOperation(value = "是否禁用报名人员") - @PutMapping("/disableApplicant/{applicantId}/{isDisable}") - public R disableApplicant(@ApiParam(name = "applicantId", value = "ID", required = true) @PathVariable String applicantId, - - @ApiParam(name = "isDisable", value = "是否禁用", required = true) @PathVariable String isDisable) { - if (EnableStatus.ENABLE.equals(isDisable) || EnableStatus.NOT_ACTIVATED.equals(isDisable)) { - Applicant applicant = new Applicant(); - applicant.setId(applicantId); - applicant.setIsDisable(Integer.parseInt(isDisable)); - boolean update = applicantService.updateById(applicant); - return update ? R.ok() : R.error(); - } else { - return R.error("启用状态错误"); - } - } - - @ApiOperation(value = "添加报名人员") - @PostMapping("/addApplicant") - public R addApplicant(@ApiParam(name = "applicant", value = "报名人员对象", required = true) @RequestBody Applicant applicant, HttpServletRequest request) { - - String accountId = TokenUtils.getIdByJwtToken(request); - applicant.setAccountId(accountId); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - String contestId = applicant.getContestId(); - boolean isSignUp = applicantService.selectOne(accountId, contestId); - //添加前判断是否已报名 - if (!isSignUp) { - applicant.setGmtCreate(new Date()); - applicant.setGmtModified(new Date()); - Contest contest = contestService.getById(applicant.getContestId()); - //大赛范围(0:本校内 1:全平台 2:指定区域、院校) - if (contest.getCompetitionScope() == 2) { - //拿到当前用户所在学校省市信息 - School school = applicantService.getSchool(schoolId); - - boolean check = contestRangeService.checkWhetherToParticipate(school, contestId); - if (check) { - return R.error("你所在院校不符合参赛要求,无法报名!"); - } - } - - boolean save = applicantService.save(applicant); - return save ? R.ok() : R.error(); - } else { - return R.error("你已经报过名啦!"); - } - } - - - @ApiOperation(value = "报名人员分页条件查询", response = ApplicantVO.class) - @PostMapping("/queryApplicantByCondition") - public R conditionPageList(@RequestBody PageRegistrationStaffReq req, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - R applicantPageConditionQuery = applicantService.applicantPageConditionQuery(req); - return applicantPageConditionQuery; - } - - - @ApiOperation(value = "批量禁用人员参赛") - @PutMapping("/disableContests") - public R disableContests(@ApiParam(name = "ids", value = "多个id", required = true) @RequestParam("ids") List ids) { - if (ids != null && ids.size() != 0) { - boolean delete = applicantService.disableContests(ids); - return delete ? R.ok() : R.error(); - } else { - return R.error(); - } - } - - @ApiOperation(value = "导出全部数据", response = ApplicantVO.class) - @GetMapping("/excelExport") - public void excelExport(@RequestParam("contestId") @ApiParam(name = "contestId", value = "赛事ID", required = true) String contestId, HttpServletResponse response) { - try { - - PageRegistrationStaffReq req = new PageRegistrationStaffReq(); - req.setContestId(contestId); - req.setPageNum(1); - req.setPageSize(1000); - applicantService.export(response, req); - } catch (IOException e) { - e.printStackTrace(); - } - } - - - @ApiOperation(value = "批量导出数据") - @PostMapping(value = "/exportDataInBatches", produces = "application/json;multipart/form-data;charset=utf-8") - public void exportSubscribedRecords(@RequestBody List listOfExportSub, HttpServletResponse response, HttpServletRequest request) throws Exception { - applicantService.exportDataInBatches(listOfExportSub, response); - } - - /*@ApiOperation(value = "批量导出数据", response = ApplicantVO.class) - @GetMapping("/batchExport") - public void batchExport(@ApiParam(name = "ids", value = "多个id", required = true) @RequestParam("ids") List ids, HttpServletResponse response) { - try { - applicantService.batchExport(response, ids); - } catch (IOException e) { - e.printStackTrace(); - } - }*/ - - - @ApiOperation(value = "取消报名") - @PostMapping(value = "/cancelRegistration") - public R cancelRegistration(@RequestParam("contestId") @ApiParam(name = "contestId", value = "赛事ID", required = true) String contestId, HttpServletRequest request) throws Exception { - String accountId = TokenUtils.getIdByJwtToken(request); - return applicantService.cancelRegistration(contestId, Integer.valueOf(accountId)); - } - -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/ArticleController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/ArticleController.java deleted file mode 100644 index f1a0828..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/ArticleController.java +++ /dev/null @@ -1,188 +0,0 @@ -package com.huoran.occupationlab.controller; - -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.huoran.api.UserClient; -import com.huoran.common.constant.EnableStatus; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.occupationlab.entity.Article; -import com.huoran.occupationlab.entity.Column; -import com.huoran.occupationlab.entity.vo.ArticleSort; -import com.huoran.occupationlab.service.ArticleService; -import com.huoran.occupationlab.service.ColumnService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.Date; -import java.util.List; - -/** - * 资讯文章 - * - * @author chen - * @since 2020-10-15 - */ -@Api(tags = "文章管理") -@RestController -@RequestMapping("/occupationlab/information/article") -public class ArticleController { - - @Autowired - private ArticleService articleService; - @Autowired - private UserClient userClient; - @Autowired - private ColumnService columnService; - - @ApiOperation(value = "栏目文章排序") - @PostMapping("/articleSort") - public R articleSort( - @ApiParam(name = "articleSort", value = "排序对象", required = true) - @RequestBody ArticleSort articleSort) { - boolean update = articleService.sort(articleSort); - return update ? R.ok() : R.error(); - } - - @ApiOperation(value = "是否启用文章") - @PutMapping("/enableArticle/{articleId}/{isEnable}") - public R enableArticle( - @ApiParam(name = "articleId", value = "文章ID", required = true) - @PathVariable Integer articleId, - @ApiParam(name = "isEnable", value = "isEnable", required = true) - @PathVariable String isEnable) { - if (EnableStatus.ENABLE.equals(isEnable) || EnableStatus.NOT_ACTIVATED.equals(isEnable)) { - Article article = new Article(); - article.setId(articleId); - article.setStatus(Integer.parseInt(isEnable)); - boolean update = articleService.updateById(article); - return update ? R.ok() : R.error(); - } else { - return R.error("启用状态错误"); - } - } - - @ApiOperation(value = "文章列表分页条件查询") - @GetMapping("/queryArticleByCondition/{current}/{pageSize}") - public R queryArticlePageList( - @ApiParam(name = "current", value = "当前页码", required = true) - @PathVariable int current, - @ApiParam(name = "pageSize", value = "每页记录数", required = true) - @PathVariable int pageSize, - @ApiParam(name = "columnId", value = "栏目Id", required = true) - @RequestParam(value = "columnId") String columnId, - @ApiParam(name = "port", value = "用户端0", required = false) - @RequestParam(value = "port", required = false) String port, - @RequestParam(value = "school",required = false) - @ApiParam(value = "学校id",required = false) String school, - HttpServletRequest request) { - - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - if (StringUtils.isNotEmpty(school)){ - schoolId = 0; - } - Page
page = new Page<>(current, pageSize); - //条件查询 - articleService.articlePageQuery(page, columnId, port, schoolId); - //总数 - long total = page.getTotal(); - //每页文章 - List
articleList = page.getRecords(); - return R.ok().put("total", total).put("articleList", articleList); - } - - @ApiOperation(value = "添加文章") - @PostMapping("/addArticle") - public R addArticle( - @ApiParam(name = "article", value = "文章对象", required = true) - @RequestBody Article article, HttpServletRequest request) { - //判重 - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - article.setSchoolId(schoolId); - boolean isRepeat = articleService.repeat(article); - if (isRepeat) { - return R.error("文章已存在"); - } - boolean save = articleService.save(article); - return save ? R.ok() : R.error(); - } - - @ApiOperation(value = "修改文章") - @PutMapping("/editArticle") - public R editArticle( - @ApiParam(name = "article", value = "文章对象", required = true) - @RequestBody Article article) { - boolean isRepeat = articleService.repeat(article); - if (isRepeat) { - return R.error("文章已存在"); - } - boolean update = articleService.updateById(article); - return update ? R.ok() : R.error(); - } - - @ApiOperation(value = "根据id查询文章") - @GetMapping("/getArticle") - public R getArticle( - @ApiParam(name = "articleId", value = "文章ID", required = true) - @RequestParam String articleId) { - Article article = articleService.getArticle(articleId); - return R.ok().put("article", article); - } - - @ApiOperation(value = "根据id删除文章") - @DeleteMapping("/deleteArticle/{articleId}") - public R deleteArticle( - @ApiParam(name = "articleId", value = "文章ID", required = true) - @PathVariable String articleId) { - boolean remove = articleService.removeById(articleId); - return remove ? R.ok() : R.error(); - } - - @ApiOperation(value = "批量删除文章") - @DeleteMapping("/deleteArticles") - public R deleteArticles( - @ApiParam(name = "articleIds", value = "多个文章id", required = true) - @RequestParam("articleIds") List articleIds) { - if (articleIds != null && articleIds.size() != 0) { - boolean delete = articleService.removeByIds(articleIds); - return delete ? R.ok() : R.error(); - } else { - return R.error(); - } - } - - @ApiOperation(value = "添加资讯内置数据(远程调用)") - @PostMapping("/addArticleData") - public boolean addArticleData(@RequestParam("accountId") @ApiParam(value = "账号id") Integer accountId, - @RequestParam("schoolId") @ApiParam(value = "学校id") Integer schoolId) { - //添加栏目 - Column column = new Column(); - column.setLevel(1); - column.setName("校园资讯"); - column.setParentId(0); - column.setSchoolId(schoolId); - column.setPlatformId(1); - column.setSort(1); - boolean saveColumn = columnService.saveColumn(column); - - Article article = new Article(); - article.setSchoolId(schoolId); - article.setColumnId(column.getId()); - article.setAuthor("超管"); - article.setContent("内置数据"); - article.setSort(1); - article.setDate(new Date()); - article.setCoverUrl("https://huoran.oss-cn-shenzhen.aliyuncs.com/20211104/jpg/1456157181287620608.jpg"); - article.setTitle("样例,可自行删除......"); - boolean save = articleService.save(article); - return save && saveColumn; - } - -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/AssessmentController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/AssessmentController.java deleted file mode 100644 index e001452..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/AssessmentController.java +++ /dev/null @@ -1,269 +0,0 @@ -package com.huoran.occupationlab.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.api.NakadaiClient; -import com.huoran.api.UserClient; -import com.huoran.common.aop.annotation.LogAnnotation; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.occupationlab.entity.Assessment; -import com.huoran.occupationlab.entity.req.AssessmentReq; -import com.huoran.occupationlab.entity.req.PageAssessmentReq; -import com.huoran.occupationlab.entity.req.PageStuAssessmentReq; -import com.huoran.occupationlab.entity.resp.StuAssessmentListResp; -import com.huoran.occupationlab.entity.vo.AssessmentVO; -import com.huoran.occupationlab.service.*; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; -import java.text.ParseException; -import java.util.List; - -/** - * 考核管理 - * - * @author lr - * @since 2021-08-18 - */ -@RestController -@RequestMapping("/occupationlab/assessment") -@Api(value = "职站:考核管理", tags = "职站:考核管理") -public class AssessmentController { - @Autowired - public AssessmentService assessmentService; - @Autowired - public AssessmentExamService examService; - - @Autowired - public ExperimentalReportService reportService; - @Autowired - public PythonSystemService pythonSystemService; - - @Autowired - public ClassService classService; - - @Autowired - private UserClient userClient; - - @Autowired - private NakadaiClient nakadaiClient; - - /** - * @描述: 创建考核 - * @入参: - * @出参: - * @作者: Rong - * @日期: 2021-08-18 - **/ - @PostMapping("/saveAssessment") - @ApiOperation(value = "创建考核") - @LogAnnotation(title = "职站:考核管理", action = "创建考核") - public R saveAssessment(@RequestBody @Valid AssessmentReq req, HttpServletRequest request) throws ParseException { - String accountId = TokenUtils.getIdByJwtToken(request); - req.setAccountId(Integer.valueOf(accountId)); - req.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - return assessmentService.saveAssessment(req); - } - - /** - * 教师端——考核管理列表 - * 测评设置默认关闭,关闭时,前台学生端点击课程时,没有测评按钮 - * 启动了就不能修改和删除但是结束后可以删除,但不可修改 - * 每个老师只能看到自己创建的考核,管理员可以看到所有老师创建的考核并且进行所有的操作。 - * - * @param req - * @return - */ - @PostMapping("/pageByCondition") - @ApiOperation(value = "教师端——考核管理列表", response = Assessment.class) - public R pageByCondition(@RequestBody PageAssessmentReq req, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - req.setAccountId(Integer.valueOf(accountId)); - req.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - List pageByCondition = assessmentService.pageByCondition(req); - - return R.ok().put("list", pageByCondition).put("total", assessmentService.pageByConditionNum(req)); - } - - /** - * 删除 - */ - @ApiOperation(value = "单个、批量删除") - @PostMapping("/deleteAssessment") - public R deleteAssessment(@RequestBody List ids) { - return assessmentService.deleteAssessment(ids); - } - - /** - * 编辑考核 - * - * @param ass - * @return - */ - @ApiOperation(value = "编辑考核") - @PostMapping("/modifyAssessment") - @LogAnnotation(title = "职站:考核管理", action = "编辑考核") - public R modifyAssessment(@RequestBody @Valid Assessment ass, HttpServletRequest request) throws ParseException { - String accountId = TokenUtils.getIdByJwtToken(request); - ass.setAccountId(Integer.valueOf(accountId)); - if (assessmentService.checkReapt(ass) == false) { - return R.error("该考核名称已存在重复的!"); - } - return assessmentService.modifyAssessment(ass); - } - - /** - * @Description : 启用考核 - * @Param id - * @Param request - * @Author Rong---2021/11/15 - */ - @ApiOperation(value = "启用考核") - @PostMapping("/enableAssessment") - @LogAnnotation(title = "职站:考核管理", action = "启用考核") - public R enableAssessment(@RequestParam("id") @ApiParam(value = "考核id") Integer id, HttpServletRequest request) throws ParseException { - String accountId = TokenUtils.getIdByJwtToken(request); - return assessmentService.enableAssessment(id); - } - - /** - * 根据考核Id查询考核详情 - * - * @param id - * @return - */ - @ApiOperation(value = "根据考核Id查询考核详情", response = Assessment.class) - @GetMapping("/getDetailById") - public R getDetailById(@RequestParam("id") @ApiParam(value = "考核id") Integer id) { - return assessmentService.getDetailById(id); - } - - /** - * 收卷 - * - * @param id - * @return - */ - @PostMapping("/collectPaper") - @ApiOperation(value = "收卷(结束考试)") - @LogAnnotation(title = "职站:考核管理", action = "收卷(结束考试)") - public R collectPaper(@RequestParam("id") @ApiParam(value = "考核id") Integer id) { - return assessmentService.collectPaper(id); - } - - /** - * 根据学生账号id查询被发布的课程名称 - *2023.07.10更改为获取绑定的产品 - * @param request - * @return - */ - @ApiOperation(value = "学生端——课程名称", response = AssessmentVO.class) - @GetMapping("/getPythonSysByStuAccountId") - public R getPythonSysByStuAccountId(HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - List assessment = pythonSystemService.getCourseTitle(Integer.valueOf(accountId), userClient.getSchoolIdByAccountId(accountId)); - return R.ok(assessment); - } - - /** - * 学生考核列表 - * 展示老师发布班级的考核 以及无指定范围班级的考核 - * - * @param req - * @return - */ - @ApiOperation(value = "学生端——学生考核列表", response = StuAssessmentListResp.class) - @PostMapping("/pageStuAssessment") - public R pageStuAssessment(@RequestBody PageStuAssessmentReq req, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - req.setAccountId(Integer.valueOf(accountId)); - req.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - List assessment = assessmentService.pageStuAssessment(req); - for (StuAssessmentListResp resp : assessment) { - - //返回返回当前学生的实验报告id - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("account_id", Integer.valueOf(accountId)); - queryWrapper.eq("assessment_id", resp.getAssessmentId()); - queryWrapper.eq("class_id", resp.getClassId()); - com.huoran.common.entity.ExperimentalReport report = reportService.getOne(queryWrapper); - - if (report != null) { - resp.setReportId(report.getReportId()); - } - } - return R.ok().put("list", assessment).put("total", assessmentService.pageStuAssessmentNum(req)); - } - - /** - * 学生端进入考试 - * 进入考试情况分为3种: - * 1.指定班级或学生才能进入 - * 2.没有邀请码的可直接进入 - * 3.需要邀请码的才能进入 - * - * @param assessmentId - * @param classId - * @param request - * @return - */ - @ApiOperation(value = "学生端——进入考试(进入考核)", response = StuAssessmentListResp.class) - @PostMapping("/enterExam") - public R enterExam(@RequestParam("assessmentId") @ApiParam(value = "考核id(必填)", required = true) Integer assessmentId, - @RequestParam("classId") @ApiParam(value = "班级id(必填)", required = true) Integer classId, - @RequestParam(value = "invitationCode", required = false) @ApiParam(value = "邀请码(非必填)", required = false) Integer invitationCode, - HttpServletRequest request) { - return assessmentService.enterExam(assessmentId, classId, invitationCode, request); - } - - @ApiOperation(value = "提交考试(远程调用)", response = StuAssessmentListResp.class) - @PostMapping("/submitExam") - @LogAnnotation(title = "职站:考核管理", action = "学生提交考试(远程调用)") - public boolean submitExam(@RequestParam("assessmentId") @ApiParam(value = "考核id(必填)") Integer assessmentId, - @RequestParam("classId") @ApiParam(value = "班级id(必填)") Integer classId, - @RequestParam("accountId") @ApiParam(value = "账号id(必填)") Integer accountId, - @RequestParam("score") @ApiParam(value = "分数(必填)") Integer score - - ) { - return assessmentService.submitExam(assessmentId, classId, accountId, score); - } - - @ApiOperation(value = "根据考核id获取考核创建人Id") - @GetMapping("/getTeacherIdByAssessmentId") - public Integer getTeacherIdByAssessmentId(@RequestParam("assessmentId") @ApiParam(value = "考核id(必填)") Integer assessmentId) { - Assessment assessment = this.assessmentService.getById(assessmentId); - return assessment.getAccountId(); - } - - //启动考核任务处理器 -// @XxlJob("assessmentJobStart") -// public void assessmentJobStart() { -// // 获取任务参数 -// String assessmentId = XxlJobHelper.getJobParam(); -// //启动考核 -// Assessment assessment = new Assessment(); -// assessment.setStatus(1); -// assessment.setId(Integer.valueOf(assessmentId)); -// assessmentService.updateById(assessment); -// } - - //停止考核任务处理器 -// @XxlJob("assessmentJobStop") -// public void assessmentJobStop() { -// // 获取任务参数 -// String assessmentId = XxlJobHelper.getJobParam(); -// //停止考核 -// Assessment assessment = new Assessment(); -// assessment.setStatus(2); -// assessment.setId(Integer.valueOf(assessmentId)); -// assessmentService.updateById(assessment); -// //通知收卷 -// nakadaiClient.refreshPageNotification("系统通知","all","3-"+assessmentId); -// } -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/CityController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/CityController.java deleted file mode 100644 index 183d3ff..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/CityController.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.huoran.occupationlab.controller; - - -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.City; -import com.huoran.occupationlab.service.CityService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import java.util.List; - -/** - *

- * 城市 前端控制器 - *

- * - * @author Ning - * @since 2020-10-27 - */ -@RestController -@RequestMapping("/occupationlab/enterprise/city") -@Api(description = "城市", tags = "城市") -public class CityController { - @Autowired - private CityService cityService; - - /** - * 查询员工专业架构 - */ - @ApiOperation(value = "查询城市") - @GetMapping("/queryCity") - public R queryCity( - @ApiParam(name = "provinceId", value = "省份id", required = true) - @RequestParam Integer provinceId) { - if (provinceId == null) { - return R.error("省份id为空,查询失败!"); - } else { - List list = cityService.queryCity(provinceId); - return R.ok().put("list", list); - } - } -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/ClassController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/ClassController.java deleted file mode 100644 index d403f88..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/ClassController.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.huoran.occupationlab.controller; - - -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.Class; -import com.huoran.occupationlab.service.ClassService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -/** - *

- * 班级表 前端控制器 - *

- * - * @author lr - * @since 2021-08-18 - */ -@RestController -@RequestMapping("/occupationlab/class") -@Api(value = "职站:学生组织架构相关", tags = "职站:学生班级相关") -public class ClassController { - @Autowired - public ClassService classService; - - @ApiOperation(value = "查询班级详情") - @GetMapping("/queryClassDetails") - public boolean queryClassDetails(@RequestParam("id") @ApiParam(value = "班级id") Integer id) { - Class details = classService.getById(id); - if (details == null) { - return false; - } - return true; - } -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/ClientManagementController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/ClientManagementController.java deleted file mode 100644 index 3fdda15..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/ClientManagementController.java +++ /dev/null @@ -1,165 +0,0 @@ -package com.huoran.occupationlab.controller; - - -import com.google.common.collect.Maps; -import com.huoran.common.entity.NewClientManagement; -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.ClientManagement; -import com.huoran.occupationlab.service.ClientManagementService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.HashMap; -import java.util.List; - -/** - *

- * 企业端客户管理 前端控制器 - *

- * - * @author Ning - * @since 2020-10-27 - */ -@RestController -@RequestMapping("/occupationlab/enterprise/client") -@Api(description = "客户管理", tags = "客户管理") -public class ClientManagementController { - - @Autowired - private ClientManagementService service; - - /** - * 添加客户信息 - */ - @ApiOperation(value = "添加客户信息") - @PostMapping("/addClient") - public R addClient(@ApiParam(name = "clientManagement", value = "客户管理实体", required = true) - @RequestBody ClientManagement clientManagement) { - if (clientManagement == null) { - return R.error("数据有误,新增客户失败!"); - } else { - boolean ret = service.addClient(clientManagement); - return ret ? R.ok() : R.error(); - } - } - - /** - * 查询客户列表 - */ - @ApiOperation(value = "查询客户列表") - @GetMapping("/list/{current}/{pageSize}") - public R list( - @ApiParam(name = "current", value = "当前页码", required = true) - @PathVariable int current, - @ApiParam(name = "pageSize", value = "每页记录数", required = true) - @PathVariable int pageSize, - @ApiParam(name = "searchContent", value = "搜索内容", required = false) - @RequestParam(value = "searchContent", required = false) String searchContent, - @ApiParam(name = "provinceId", value = "省份id", required = false) - @RequestParam(value = "provinceId", required = false) Integer provinceId, - @ApiParam(name = "cityId", value = "城市id", required = false) - @RequestParam(value = "cityId", required = false) Integer cityId) { - HashMap map = Maps.newHashMap(); - map.put("current", (current - 1) * pageSize); - map.put("pageSize", pageSize); - if (provinceId != null) { - map.put("provinceId", provinceId); - } - if (cityId != null) { - map.put("cityId", cityId); - } - if (searchContent != null) { - map.put("searchContent", searchContent); - } - List list = service.queryList(map); - int total = service.queryListCount(map); - return R.ok().put("list", list).put("total", total); - } - - /** - * 删除员工年级 - */ - @ApiOperation(value = "批量删除客户") - @PostMapping("/deleteClient") - public R deleteClient(@ApiParam(name = "clientIds", value = "多个客户id", required = true) - @RequestParam List clientIds) { - if (clientIds.isEmpty()) { - return R.error("客户id为空,删除失败!"); - } else { - boolean ret = service.deleteClient(clientIds); - return ret ? R.ok() : R.error(); - } - } - - /** - * 更新员工年级 - */ - @ApiOperation(value = "更新客户") - @PostMapping("/updateClient") - public R updateClient(@ApiParam(name = "NewClientManagement", value = "客户实体", required = true) - @RequestBody ClientManagement clientManagement) { - if (clientManagement == null) { - return R.error("客户实体为空,修改失败!"); - } else { - boolean ret = service.updateClient(clientManagement); - return ret ? R.ok() : R.error(); - } - } - - /** - * 根据id查询客户详情 - */ - @ApiOperation(value = "根据id查询客户详情") - @GetMapping("/getClient/{clientId}") - public R getClient( - @ApiParam(name = "clientId", value = "客户id", required = true) - @PathVariable int clientId) { - ClientManagement client = service.getById(clientId); - return R.ok().put("client", client); - } - - /** - * 查询客户名称 - */ - @ApiOperation(value = "查询客户名称") - @GetMapping("/getClientName") - public R getClientName( - @ApiParam(name = "clientName", value = "客户名称", required = true) - @RequestParam String clientName) { - List client = service.getClientName(clientName); - return R.ok().put("client", client); - } - - /** - * 查询客户名称 - */ - @ApiOperation(value = "查询客户名称大小") - @GetMapping("/queryClientNameSize") - public R queryClientNameSize( - @ApiParam(name = "clientName", value = "客户名称", required = true) - @RequestParam String clientName) { - int client = service.queryClientNameSize(clientName); - return R.ok().put("client", client); - } - - - /** - * 根据客户名称查询一个客户返回客户id - */ - @ApiOperation(value = "根据客户名称查询一个客户返回客户id") - @GetMapping("/queryOneClient") - public NewClientManagement queryOneClient( - @ApiParam(name = "clientName", value = "客户名称", required = true) - @RequestParam String clientName) { - NewClientManagement client = service.queryOneClient(clientName); - if (client != null) { - return client; - } else { - return client; - } - } -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/ClockScheduledController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/ClockScheduledController.java deleted file mode 100644 index 63a3081..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/ClockScheduledController.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.huoran.occupationlab.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.occupationlab.entity.Assessment; -import com.huoran.occupationlab.service.AssessmentService; -import com.huoran.occupationlab.service.StudentService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; -import org.springframework.web.bind.annotation.RestController; - -import java.util.List; - -/** - * @ProjectName: gzedu - * @Package: com.huoran.user.controller - * @ClassName: test - * @Description: java类作用描述 - * @Author: Maureen.Rong - * @CreateDate: 2020/12/7 11:35 - * @UpdateDate: 2020/12/7 11:35 - * @Version: 1.0 - */ -@Component -@RestController -public class ClockScheduledController { - - @Autowired - public StudentService studentService; - - @Autowired - public AssessmentService service; - - //考核自启动 - @Scheduled(fixedRate = 1000) - public void timer2() { - /*//查询考核类型为定时发布且考核状态为待开始状态以及开始时间为当前时间时候 则启动考核 - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("type", 2);//发布类型(1、手动发布 2、定时发布) - queryWrapper.eq("is_del", 0); - queryWrapper.eq("status", 0);//状态(0、待开始 1、进行中 2、已结束) - queryWrapper.last(" AND start_time = now() "); - List list = service.list(queryWrapper); - if (list.size() > 0) { - for (Assessment experimentalTeaching : list) { - //启动考核 - Assessment update = new Assessment(); - update.setStatus(1); - update.setId(experimentalTeaching.getId()); - service.updateById(update); - } - } - - //当结束时间为当前时间 且发布类型为定时发布的以及考核状态为进行中的 则停止考核 - QueryWrapper queryWrapper1 = new QueryWrapper<>(); - //queryWrapper1.eq("type", 2); - queryWrapper1.eq("is_del", 0); - queryWrapper1.eq("status", 1); - queryWrapper1.last(" AND stop_time = now() "); - List list1 = service.list(queryWrapper1); - if (list1.size() > 0) { - for (Assessment experimentalTeaching : list1) { - //停止考核 - Assessment update = new Assessment(); - update.setStatus(2); - update.setId(experimentalTeaching.getId()); - service.updateById(update); - } - }*/ - - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/ColumnController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/ColumnController.java deleted file mode 100644 index 6b7f255..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/ColumnController.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.huoran.occupationlab.controller; - -import com.huoran.api.UserClient; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.occupationlab.entity.Column; -import com.huoran.occupationlab.entity.vo.ColumnSort; -import com.huoran.occupationlab.service.ColumnService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -/** - * 资讯栏目 - * - * @author chen - * @since 2020-10-15 - */ -@Api(tags = "资讯栏目管理") -@RestController -@RequestMapping("/occupationlab/information/column") -public class ColumnController { - - @Autowired - private ColumnService columnService; - @Autowired - private UserClient userClient; - - @ApiOperation(value = "栏目树") - @GetMapping("/queryAllColumns") - public R queryAllColumns( - @RequestParam(value = "platformId",required = false) @ApiParam(value = "平台id") String platformId, - @RequestParam(value = "school",required = false) - @ApiParam(value = "学校id",required = false) String school, - HttpServletRequest request) { - - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - if (StringUtils.isNotEmpty(school)){ - schoolId = 0; - } - List columnTree = columnService.columnTree(schoolId,platformId); - return R.ok().put("columnTree", columnTree); - } - - @ApiOperation(value = "编辑排序") - @PostMapping("/reorder") - public R columnReorder( - @ApiParam(name = "columnSort", value = "栏目重排序对象", required = true) - @RequestBody ColumnSort columnSort) { - boolean update = columnService.updateSort(columnSort); - return update ? R.ok() : R.error(); - } - - @ApiOperation(value = "添加栏目") - @PostMapping("/addColumn") - public R addColumn( - @ApiParam(name = "column", value = "栏目对象", required = true) - @RequestBody Column column, HttpServletRequest request) { - - //限制层级4级 - if (column.getLevel() > 3) { - return R.error("暂不支持" + column.getLevel() + "层级"); - } - String accountId = TokenUtils.getIdByJwtToken(request); - column.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - - if (column.getParentId()==null){ - column.setParentId(0); - } - //判重 - boolean isRepeat = columnService.repeat(column); - if (isRepeat) { - return R.error("栏目已存在"); - } - boolean save = columnService.saveColumn(column); - return save ? R.ok() : R.error(); - } - - @ApiOperation(value = "修改栏目") - @PutMapping("/editColumn") - public R editColumn( - @ApiParam(name = "column", value = "栏目对象", required = true) - @RequestBody Column column) { - //判重 - boolean isRepeat = columnService.repeat(column); - if (isRepeat) { - return R.error("栏目已存在"); - } - - boolean update = columnService.updateById(column); - return update ? R.ok() : R.error(); - } - - @ApiOperation(value = "删除栏目") - @DeleteMapping("/deleteColumn/{columnId}") - public R deleteColumn( - @ApiParam(name = "columnId", value = "栏目ID", required = true) - @PathVariable Integer columnId) { - boolean remove = columnService.removeColumn(columnId); - return remove ? R.ok() : R.error(); - } - - @ApiOperation(value = "一级栏目") - @GetMapping("/firstLevelColumn") - public R firstLevelColumn(HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - List list = columnService.firstLevelColumn(schoolId); - return R.ok().put("data", list); - } - - @ApiOperation(value = "根据一级栏目获取二级栏目") - @GetMapping("/secondaryColumnsByFirst") - public R secondaryColumnsByFirst(@RequestParam("parentId") @ApiParam(value = "一级分类id") String parentId, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - List list = columnService.secondaryColumnsByFirst(parentId, schoolId); - return R.ok().put("data", list); - } -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/ContestAnnexController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/ContestAnnexController.java deleted file mode 100644 index 305039e..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/ContestAnnexController.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.huoran.occupationlab.controller; - - -import com.huoran.occupationlab.entity.ContestAnnex; -import com.huoran.occupationlab.entity.ContestAnnouncementAnnex; -import com.huoran.occupationlab.service.ContestAnnexService; -import io.swagger.annotations.*; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; -import com.huoran.common.response.R; - -@RestController -@RequestMapping("/occupationlab/contest/annex") -@Api(value = "API - 中台:ContestAnnexController", tags = "中台:赛事附件") -public class ContestAnnexController { - - @Autowired - private ContestAnnexService contestAnnexService; - - @PostMapping("/update") - @ApiOperation(value = "编辑赛事附件",response = ContestAnnex.class) - public R update(@RequestBody ContestAnnex contestAnnex) { - boolean update = contestAnnexService.updateById(contestAnnex); - return update ? R.ok() : R.error(); - } - - - @PostMapping("/save") - @ApiOperation(value = "新增赛事附件",response = ContestAnnex.class) - public R save(@RequestBody ContestAnnex contestAnnex) { - boolean save = contestAnnexService.save(contestAnnex); - return save ? R.ok() : R.error(); - } - - @PostMapping("/delete") - @ApiOperation(value = "删除赛事附件",response = ContestAnnex.class) - public R delete(@RequestParam("id") @ApiParam(name = "id", value = "附件id", required = true) Integer id) { - boolean del = contestAnnexService.removeById(id); - return del ? R.ok() : R.error(); - } -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/ContestAnnouncementAnnexController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/ContestAnnouncementAnnexController.java deleted file mode 100644 index 93ec457..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/ContestAnnouncementAnnexController.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.huoran.occupationlab.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.common.constant.DelConstant; -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.ContestAnnouncementAnnex; -import com.huoran.occupationlab.service.ContestAnnouncementAnnexService; -import io.swagger.annotations.*; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import org.springframework.beans.factory.annotation.Autowired; -import org.apache.commons.lang.StringUtils; -import org.springframework.web.bind.annotation.*; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; - -import java.util.List; - - -/** - * @描述:大赛公告附件存储控制类 - * @作者: Rong - * @日期: 2022-06-17 - */ -@RestController -@RequestMapping("/occupationlab/contestAnnouncementAnnex") -@Api(value = "API - 中台:ContestAnnouncementAnnexController", tags = "中台:大赛公告附件存储") -public class ContestAnnouncementAnnexController { - - @Autowired - public ContestAnnouncementAnnexService service; - - @PostMapping("/viewAttachments") - @ApiOperation(value = "查看公告下的附件",response = ContestAnnouncementAnnex.class) - public R findById(@RequestParam("announcementId") @ApiParam(value = "announcementId") Integer announcementId) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("announcement_id",announcementId); - queryWrapper.eq("is_del", DelConstant.NOT_DEL); - List annexList = service.list(queryWrapper); - return R.ok().put("list",annexList); - } - - @PostMapping("/save") - @ApiOperation(value = "新增",response = ContestAnnouncementAnnex.class) - public R save(@RequestBody ContestAnnouncementAnnex contestAnnouncementAnnex) { - boolean save = service.save(contestAnnouncementAnnex); - return save ? R.ok() : R.error(); - } - - - @PostMapping("/update") - @ApiOperation(value = "修改",response = ContestAnnouncementAnnex.class) - public R update(@RequestBody ContestAnnouncementAnnex contestAnnouncementAnnex) { - boolean update = service.updateById(contestAnnouncementAnnex); - return update ? R.ok() : R.error(); - } - - - @PostMapping("/delete") - @ApiOperation(value = "根据主键删除",response = ContestAnnouncementAnnex.class) - public R delete(@RequestParam("id") @ApiParam(value = "id")Integer id) { - boolean delete = service.removeById(id); - return delete ? R.ok() : R.error(); - } -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/ContestAnnouncementController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/ContestAnnouncementController.java deleted file mode 100644 index cd334f1..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/ContestAnnouncementController.java +++ /dev/null @@ -1,111 +0,0 @@ -package com.huoran.occupationlab.controller; - - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.common.constant.DelConstant; -import com.huoran.common.constant.EnableStatus; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.occupationlab.entity.Applicant; -import com.huoran.occupationlab.entity.ContestAnnex; -import com.huoran.occupationlab.entity.ContestAnnouncement; -import com.huoran.occupationlab.entity.ContestAnnouncementAnnex; -import com.huoran.occupationlab.service.ContestAnnouncementAnnexService; -import com.huoran.occupationlab.service.ContestAnnouncementService; -import io.swagger.annotations.*; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -/** - * @描述:赛事公告控制类 - * @作者: Rong - * @日期: 2022-06-17 - */ -@RestController -@RequestMapping("/occupationlab/contest/announcement") -@Api(value = "API - 中台:ContestAnnouncementController", tags = "中台:赛事公告") -public class ContestAnnouncementController { - - - @Autowired - public ContestAnnouncementService service;//公告 - - @Autowired - public ContestAnnouncementAnnexService annexService;//大赛公告附件 - - - @PostMapping("/queryAnnouncementDetails") - @ApiOperation(value = "查询公告详情",response = ContestAnnouncement.class) - public R findById(@RequestParam("id") @ApiParam(value = "公告主键") Integer id) { - ContestAnnouncement contestAnnouncement = service.getById(id); - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("announcement_id",id); - queryWrapper.eq("is_del", DelConstant.NOT_DEL); - List annexList = annexService.list(queryWrapper); - if (annexList.size()>0){ - contestAnnouncement.setAnnouncementAnnexList(annexList); - } - return R.ok().put("data", contestAnnouncement); - } - - - @PostMapping("/addAnnouncement") - @ApiOperation(value = "新增公告",response = ContestAnnouncement.class) - public R save(@RequestBody ContestAnnouncement contestAnnouncement, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - contestAnnouncement.setAccountId(Integer.valueOf(accountId)); - boolean save = service.save(contestAnnouncement); - if (contestAnnouncement.getAnnouncementAnnexList().size() > 0) { - contestAnnouncement.getAnnouncementAnnexList().forEach(contestAnnex -> { - contestAnnex.setAnnouncementId(contestAnnouncement.getId()+""); - boolean saveContestAnnex = annexService.save(contestAnnex);//保存比赛附件 - }); - } - return save ? R.ok() : R.error(); - } - - - @PostMapping("/amendmentAnnouncement") - @ApiOperation(value = "修改公告",response = ContestAnnouncement.class) - public R update(@RequestBody ContestAnnouncement contestAnnouncement) { - boolean update = service.updateById(contestAnnouncement); - return update ? R.ok() : R.error(); - } - - - @ApiOperation(value = "是否禁用公告") - @PutMapping("/disableAnnouncement") - public R disableAnnouncement(@ApiParam(name = "id", value = "公告主键", required = true) @RequestParam Integer id, - @ApiParam(name = "isDisable", value = "是否开启(0开启 1未开启 默认0)", required = true)@RequestParam Integer isDisable) { - if (isDisable==1 || isDisable==0) { - ContestAnnouncement contestAnnouncement = new ContestAnnouncement(); - contestAnnouncement.setId(id); - contestAnnouncement.setIsOpen(isDisable); - boolean update = service.updateById(contestAnnouncement); - return update ? R.ok() : R.error(); - } else { - return R.error("启用状态错误"); - } - } - - @PostMapping("/deleteAnnouncement") - @ApiOperation(value = "删除公告",response = ContestAnnouncement.class) - public R delete(@RequestParam("id") @ApiParam(value = "公告主键") Integer id) { - boolean del = service.removeById(id); - return del ? R.ok() : R.error(); - } - - - @PostMapping("/queryAnnouncementByContestId") - @ApiOperation(value = "根据赛事id查询公告列表(分页)",response = ContestAnnouncement.class) - public R queryAnnouncementByContestId(@RequestParam("contestId") @ApiParam(value = "赛事id") String contestId, - @ApiParam(value = "当前页数", required = true) @RequestParam("pageNum") Integer pageNum, - @ApiParam(value = "当前页需要显示的数量", required = true) @RequestParam("pageSize") Integer pageSize) { - return service.queryAnnouncementByContestId(contestId, pageNum, pageSize); - } -} - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/ContestController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/ContestController.java deleted file mode 100644 index cc815e7..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/ContestController.java +++ /dev/null @@ -1,300 +0,0 @@ -package com.huoran.occupationlab.controller; - -import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; -import com.huoran.api.UserClient; -import com.huoran.common.constant.DelConstant; -import com.huoran.common.response.R; -import com.huoran.common.utils.DateUtils; -import com.huoran.common.utils.TokenUtils; -import com.huoran.occupationlab.entity.Contest; -import com.huoran.occupationlab.entity.ContestAnnex; -import com.huoran.occupationlab.entity.ContestRange; -import com.huoran.occupationlab.entity.req.AfterLoginPageContestListReq; -import com.huoran.occupationlab.entity.req.DisableEnableContestReq; -import com.huoran.occupationlab.entity.req.PageContestListReq; -import com.huoran.occupationlab.entity.vo.ContestVO; -import com.huoran.occupationlab.service.ContestAnnexService; -import com.huoran.occupationlab.service.ContestRangeService; -import com.huoran.occupationlab.service.ContestService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.Date; -import java.util.List; - -/** - * 竞赛管理 前端控制器 - * - * @author chen - * @since 2020-10-15 - */ -@Api(description = "赛事管理", tags = "赛事管理") -@RestController -@RequestMapping("/occupationlab/enterprise/match/contest") -public class ContestController { - @Autowired - private UserClient userClient; - @Autowired - private ContestService contestService; - - @Autowired - private ContestRangeService contestRangeService; - - @Autowired - private ContestAnnexService contestAnnexService; - - @ApiOperation(value = "创建竞赛") - @PostMapping("/addContest") - public R addContest(@ApiParam(name = "contest", value = "赛事对象", required = true) @RequestBody Contest contest, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - contest.setSchoolId(schoolId); - contest.setFounderId(accountId); -// String getSchoolName = contestService.getSchoolNameById(schoolId); -// contest.setFounderName(getSchoolName); - - - //平台来源(0:中台,1:职站) - if (contest.getPlatformSource() == 0) { - contest.setFounderName("平台创建"); - } - - //判重: - // 2022-06.16 当前判重逻辑——>比赛范围为非本校内的比赛,名字要全平台判重。本校内的竞赛名字,只需要本校内判重 - boolean isRepeat = contestService.repeat(contest); - if (isRepeat) { - return R.error("赛事已存在"); - } - boolean save = contestService.save(contest); - - if (contest.getContestAnnexList().size() > 0) { - contest.getContestAnnexList().forEach(contestAnnex -> { - contestAnnex.setContestId(contest.getId()); - boolean saveContestAnnex = contestAnnexService.save(contestAnnex);//保存比赛附件 - }); - - } - if (contest.getContestRangeList().size() > 0) { - contest.getContestRangeList().forEach(contestRange -> { - String getContestId = contest.getId(); - contestRange.setContestId(getContestId); - boolean saveContestRange = contestRangeService.save(contestRange);//保存比赛范围 - }); - } - - - return save ? R.ok() : R.error(); - } - - - @ApiOperation(value = "修改赛事") - @PostMapping("/editContest") - public R editContest(@ApiParam(name = "contest", value = "赛事对象", required = true) @RequestBody Contest contest) { - boolean update = contestService.updateById(contest); - - - if (contest.getCompetitionScope() == 2) { - if (contest.getContestRangeList().size() > 0) { - - //1.首先删除原有的大赛范围选择 - UpdateWrapper annexUpdateWrapper = new UpdateWrapper<>(); - annexUpdateWrapper.set("is_del", DelConstant.IS_DEL); - annexUpdateWrapper.eq("contest_id", contest.getId()); - boolean delContestAnnex = contestRangeService.update(new ContestRange(), annexUpdateWrapper); - - //2.重新保存比赛范围 - contest.getContestRangeList().forEach(contestRange -> { - contestRange.setContestId(contest.getId()); - boolean saveContestRange = contestRangeService.save(contestRange);//保存比赛范围 - }); - } - } - return update ? R.ok() : R.error(); - } - - - - @ApiOperation(value = "根据id删除赛事") - @PostMapping("/deleteContest") - public R deleteContest(@ApiParam(name = "contestId", value = "赛事ID", required = true) @RequestParam String contestId) { - boolean remove = contestService.removeContest(contestId); - return remove ? R.ok() : R.error(); - } - - - @ApiOperation(value = "批量删除赛事") - @PostMapping("/batchDeleteContest") - public R deleteContest(@ApiParam(name = "contestIds", value = "赛事ID", required = true) @RequestParam List contestIds) { - contestIds.forEach(contestId->{ - contestService.removeContest(contestId); - }); - return R.ok(); - } - - @ApiOperation(value = "根据id查询赛事", response = ContestRange.class) - @PostMapping("/getContest") - public R getContest(@ApiParam(name = "contestId", value = "赛事ID", required = true) @RequestParam("contestId") String contestId) { - Contest contest = contestService.getById(contestId); - List contestAnnexList = contestAnnexService.getContestAnnexByContestId(contestId); - List contestRangeList = contestRangeService.getContestRangeByContestId(contestId); - if (contestRangeList.size() > 0) { - contest.setContestRangeList(contestRangeList); - } - if (contestAnnexList.size() > 0) { - contest.setContestAnnexList(contestAnnexList); - } - - if (contest.getCompetitionScope() == 1) { - contest.setRange("全平台"); - } else if (contest.getCompetitionScope() == 2) { - contest.setRange("指定范围"); - //依据赛事id查询指定范围的省、市、学校 - contest.setContestRangeRespList(contestRangeService.getRangeByContestId(contest.getId())); - } - - return R.ok().put("contest", contest); - } - - - @ApiOperation(value = "赛事禁启用", response = ContestRange.class) - @PostMapping("/disabledEvents") - public R disabledEvents(@RequestBody DisableEnableContestReq req) { - - Contest getDetail = contestService.getById(req.getContestId()); - Contest contest = new Contest(); - contest.setId(req.getContestId()); - //禁用平台来源(0中台,1职站) - switch (req.getType()) { - case 0: - contest.setZtOpen(req.getIsOpen()); - break; - case 1: - //原型需求: - // 客户创建的大赛,禁用时职站首页以及学生登录后的大赛模块看不到对应的比赛,创建的老师在大赛管理还是可以看到该大赛,可以编辑,但是无法启用。 - // 即中台禁用的大赛,即使是该院校老师创建的,老师端也不能自己启用,需要中台启用。 - //1.判断当前院校禁启用状态为要启用时候再判断当前赛事中台禁启用的状态 - if (req.getIsOpen() == 0) { - if (getDetail.getZtOpen() == 1) { - return R.error("当前赛事已被平台禁用,请联系平台管理员!"); - } - } - contest.setIsOpen(req.getIsOpen()); - break; - - } - boolean ret = contestService.updateById(contest); - return ret ? R.ok() : R.error(); - } - - - @ApiOperation(value = "赛事样例数据") - @PostMapping("/eventSampleData") - public boolean eventSampleData(@RequestParam("accountId") @ApiParam(value = "账号id") Integer accountId, @RequestParam("schoolId") @ApiParam(value = "学校id") Integer schoolId) { - Contest contest = new Contest(); - contest.setFounderId(accountId.toString()); - contest.setName("样例赛事"); - contest.setCoverUrl("https://huoran.oss-cn-shenzhen.aliyuncs.com/20220509/png/1523606505516457984.png"); - contest.setCarouselUrl("https://huoran.oss-cn-shenzhen.aliyuncs.com/20220310/png/1501818796133343232.png"); - contest.setSponsor("主办方"); - contest.setUndertaker("承办方"); - contest.setDescription("样例赛事,仅供参考!"); - contest.setPublishStatus(1); - contest.setPlayStartTime(DateUtils.getDateByDay(15)); - contest.setPlayEndTime(DateUtils.getDateByDay(18)); - contest.setSignUpStartTime(new Date()); - contest.setSignUpEndTime(DateUtils.getDateByDay(10)); - contest.setSchoolId(schoolId); - contest.setPlatformSource(1);//平台来源(0:中台,1:职站) - contest.setCompetitionScope(0);//大赛范围(0:本校内 1:全平台 2:指定区域、院校) - return contestService.save(contest); - } - - - @ApiOperation(value = "职站——赛事列表(教师端赛事管理)") - @PostMapping("/contestPageConditionQueryByOccupationlab") - public R contestPageConditionQueryByOccupationlab(@RequestBody PageContestListReq pageContestListReq, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - pageContestListReq.setSchoolId(schoolId); - if (!accountId.equals("")) { - pageContestListReq.setAccountId(Integer.valueOf(accountId)); - } - return contestService.contestPageConditionQueryByOccupationlab(pageContestListReq); - - } - - @ApiOperation(value = "中台——赛事列表分页条件查询(赛事广场)") - @PostMapping("/contestPageConditionQueryByNakadai") - public R contestPageConditionQueryByNakadai(@RequestBody PageContestListReq pageContestListReq, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - return contestService.contestPageConditionQueryByNakadai(pageContestListReq); - } - - /* - - @ApiOperation(value = "职站(学生端)——已报名赛事列表", response = ContestVO.class) - @PostMapping("/listOfRegisteredEvents") - public R listOfRegisteredEvents(@RequestBody PageContestListReq pageContestListReq, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - if (!accountId.equals("")) { - pageContestListReq.setAccountId(Integer.valueOf(accountId)); - } - return contestService.listOfRegisteredEvents(pageContestListReq); - } - - @ApiOperation(value = "职站——(学生端登录后线上赛事-本校赛事)") - @PostMapping("/onlineCompetitionByStudent") - public R onlineCompetitionByStudent(@RequestBody PageContestListReq pageContestListReq, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - pageContestListReq.setSchoolId(schoolId); - if (!accountId.equals("")) { - pageContestListReq.setAccountId(Integer.valueOf(accountId)); - } - return contestService.onlineCompetitionByStudent(pageContestListReq); - - }*/ - - @ApiOperation(value = "查询赛事状态(返回为false时表示当前赛事在教师端已禁用)") - @PostMapping("/checkTheStatusOfTheCompetition") - public boolean checkTheStatusOfTheCompetition(@ApiParam(name = "contestId", value = "赛事ID", required = true) @RequestParam String contestId) { - Contest contest = contestService.getById(contestId); - //是否开启(0开启 1未开启 默认0) - if (contest.getIsOpen()==1){ - return false; - } - return true; - } - - @ApiOperation(value = "职站(学生端)——登录前竞赛", response = ContestVO.class) - @PostMapping("/notLoggedInBeforeStudentEvents") - public R notLoggedInBeforeStudentEvents(@RequestBody PageContestListReq pageContestListReq, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - if (!accountId.equals("")) { - pageContestListReq.setSchoolId(schoolId); - pageContestListReq.setAccountId(Integer.valueOf(accountId)); - } - return contestService.notLoggedInBeforeStudentEvents(pageContestListReq); - - } - - @ApiOperation(value = "职站(学生端)——登录后竞赛", response = ContestVO.class) - @PostMapping("/contestAfterLogin") - public R contestAfterLogin(@RequestBody AfterLoginPageContestListReq pageContestListReq, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - if (!accountId.equals("")) { - pageContestListReq.setSchoolId(schoolId); - pageContestListReq.setAccountId(Integer.valueOf(accountId)); - } - return contestService.contestAfterLogin(pageContestListReq); - - } - -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/ContestProgressController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/ContestProgressController.java deleted file mode 100644 index 5a4ca37..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/ContestProgressController.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.huoran.occupationlab.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.ContestProgress; -import com.huoran.occupationlab.service.ContestProgressService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.Date; -import java.util.List; - -/** - * 竞赛进展 前端控制器 - * - * @author chen - * @since 2020-10-15 - */ -@Api(description = "企业端竞赛进展管理", tags = "企业端竞赛进展管理") -@RestController -@RequestMapping("/occupationlab/enterprise/match/contest-progress") -public class ContestProgressController { - - @Autowired - private ContestProgressService contestProgressService; - - @ApiOperation(value = "添加竞赛进展") - @PostMapping("/addContestProgress") - public R addContestProgress( - @ApiParam(name = "contestProgress", value = "竞赛进展对象", required = true) - @RequestBody ContestProgress contestProgress) { - //判重 - contestProgress.setGmtCreate(new Date()); - contestProgress.setGmtModified(new Date()); - boolean isRepeat = contestProgressService.repeat(contestProgress); - if (isRepeat) { - return R.error("竞赛进展已存在"); - } - boolean save = contestProgressService.save(contestProgress); - return save ? R.ok() : R.error(); - } - - @ApiOperation(value = "根据赛事id查询竞赛进展") - @GetMapping("/getContestProgress") - public R getContestProgress(@RequestParam("contestId") @ApiParam(value = "contestId")String contestId) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("contest_id", contestId); - List contestProgressList = contestProgressService.list(wrapper); - return R.ok().put("contestProgressList", contestProgressList); - } - - @ApiOperation(value = "根据id删除竞赛进展") - @DeleteMapping("/deleteContestProgress/{contestProgressId}") - public R deleteContestProgress( - @ApiParam(name = "contestProgressId", value = "竞赛进展ID", required = true) - @PathVariable String contestProgressId) { - boolean remove = contestProgressService.removeById(contestProgressId); - return remove ? R.ok() : R.error(); - } - - @ApiOperation(value = "修改竞赛进展") - @PutMapping("/editContestProgress") - public R editContestProgress( - @ApiParam(name = "ContestProgress", value = "赛事进展对象", required = true) - @RequestBody ContestProgress contestProgress) { - boolean update = contestProgressService.updateById(contestProgress); - return update ? R.ok() : R.error(); - } - -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/CourseChapterController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/CourseChapterController.java deleted file mode 100644 index c683204..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/CourseChapterController.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.huoran.occupationlab.controller; - -import cn.hutool.core.util.ObjectUtil; -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.CourseChapter; -import com.huoran.occupationlab.entity.vo.ChapterVO; -import com.huoran.occupationlab.entity.vo.SortVO; -import com.huoran.occupationlab.service.CourseChapterService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.apache.commons.lang.ObjectUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.Date; -import java.util.List; - -/** - * 课程章节 前端控制器 - * - * @author chen - * @since 2020-09-30 - */ -@Api(description = "课程章节管理", tags = "课程章节管理") -@RestController -@RequestMapping("/occupationlab/management/edu/courseChapter") -public class CourseChapterController { - - @Autowired - private CourseChapterService courseChapterService; - - @ApiOperation(value = "根据课程id查询章节小节,树状结构") - @GetMapping("/queryChaptersAndSubsections/{courseId}") - public R queryChaptersAndSubsections( - @ApiParam(name = "courseId", value = "课程ID", required = true) - @PathVariable String courseId) { - List chapterList = courseChapterService.getChapterTree(courseId); - return R.ok().put("chapterList", chapterList); - } - - @ApiOperation(value = "编辑排序") - @PostMapping("/reorder") - public R chapterReorder( - @ApiParam(name = "sortVO", value = "章节小节重排序对象", required = true) - @RequestBody SortVO sortVO) { - boolean update = courseChapterService.updateSort(sortVO); - return update ? R.ok() : R.error(); - - } - - @ApiOperation(value = "添加章节") - @PostMapping("/addChapter") - public R addChapter( - @ApiParam(name = "courseChapter", value = "章节对象", required = true) - @RequestBody CourseChapter courseChapter) { - //判重 - boolean isRepeat = courseChapterService.repeat(courseChapter); - if (isRepeat) { - return R.error("章节已存在"); - } - courseChapter.setGmtModified(new Date()); - courseChapter.setGmtCreate(new Date()); - boolean save = courseChapterService.saveChapter(courseChapter); - return save ? R.ok() : R.error(); - } - - @ApiOperation(value = "修改章节") - @PutMapping("/editChapter") - public R editChapter( - @ApiParam(name = "courseChapter", value = "章节对象", required = true) - @RequestBody CourseChapter courseChapter) { - boolean update = courseChapterService.updateById(courseChapter); - return update ? R.ok() : R.error(); - } - - @ApiOperation(value = "根据id删除章节") - @DeleteMapping("/deleteChapter/{chapterId}") - public R deleteChapter( - @ApiParam(name = "chapterId", value = "章节ID", required = true) - @PathVariable String chapterId) { - boolean remove = courseChapterService.removeChapter(chapterId); - return remove ? R.ok() : R.error(); - } - -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/CourseClassificationController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/CourseClassificationController.java deleted file mode 100644 index 6dffacd..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/CourseClassificationController.java +++ /dev/null @@ -1,129 +0,0 @@ -package com.huoran.occupationlab.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.api.UserClient; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.occupationlab.entity.EduCourseClassification; -import com.huoran.occupationlab.entity.SchoolClassification; -import com.huoran.occupationlab.service.CourseClassificationService; -import com.huoran.occupationlab.service.SchoolClassificationService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.Date; -import java.util.List; - -/** - * 课程类别 前端控制器 - * - * @author chen - * @since 2020-09-30 - */ -@Api(tags = {"管理端——课程分类管理"}) -@RestController -@RequestMapping("/occupationlab/management/edu/courseClassification") -public class CourseClassificationController { - - @Autowired - private CourseClassificationService courseClassificationService; - @Autowired - private SchoolClassificationService schoolClassificationService; - @Autowired - private UserClient userClient; - - @ApiOperation(value = "查询学校端分类") - @GetMapping("/queryGlClassification") - public R queryGlClassification(HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - List classificationList = courseClassificationService.queryGlClassification(String.valueOf(schoolId)); - return R.ok().put("classificationList", classificationList); - } - - @ApiOperation(value = "添加分类") - @PostMapping("/addClassification/{name}") - public R addClassification( - @ApiParam(name = "name", value = "类别名称", required = true) - @PathVariable String name, - @ApiParam(name = "distinguish", value = "企业添加分类为1", required = false) - @RequestParam String distinguish, HttpServletRequest request) { - EduCourseClassification classification = new EduCourseClassification(); - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - //如果为1,添加企业端分类 - if ("1".equals(distinguish)) { - classification.setDistinguish(1); - } - classification.setName(name); - classification.setGmtCreate(new Date()); - classification.setGmtModified(new Date()); - - //新增前判重 - EduCourseClassification classification1 = new EduCourseClassification(); - classification1.setSchoolId(schoolId); - classification1.setName(name); - List list = courseClassificationService.checkReapt(classification1); - if (list.size() > 0) { - return R.error(name + "已存在!"); - } - - boolean save = courseClassificationService.save(classification); - String classificationId = classification.getId(); - //学校id不为空,学校端添加分类对应学校关系 - if (schoolId != null) { - SchoolClassification schoolClassification = new SchoolClassification(); - schoolClassification.setClassificationId(classificationId); - schoolClassification.setSchoolId(schoolId + ""); - schoolClassificationService.save(schoolClassification); - } - return save ? R.ok() : R.error(); - } - - @ApiOperation(value = "修改分类") - @PutMapping("/editClassification") - public R editClassification( - @ApiParam(name = "classification", value = "分类对象", required = true) - @RequestBody EduCourseClassification classification, HttpServletRequest request) { - //新增前判重 - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - classification.setSchoolId(schoolId); - List list = courseClassificationService.checkReapt(classification); - if (list.size() > 0) { - return R.error(classification.getName() + "已存在!"); - } - - boolean update = courseClassificationService.updateById(classification); - return update ? R.ok() : R.error(); - } - - @ApiOperation(value = "根据id删除分类") - @DeleteMapping("/deleteClassification/{classificationId}") - public R deleteClassification( - @ApiParam(name = "classificationId", value = "分类ID", required = true) - @PathVariable String classificationId, HttpServletRequest request) { - //删除课程分类,学校id不为空,删除管理端分类id,学校id为空,其他学校全部删除该分类 - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - if (schoolId != null) { - courseClassificationService.removeById(classificationId); - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("classification_id", classificationId).eq("school_id", schoolId); - boolean remove = schoolClassificationService.remove(wrapper); - return remove ? R.ok() : R.error(); - } else { - courseClassificationService.removeById(classificationId); - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("classification_id", classificationId); - boolean remove = schoolClassificationService.remove(wrapper); - return remove ? R.ok() : R.error(); - } - } - -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/CourseController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/CourseController.java deleted file mode 100644 index bbcb624..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/CourseController.java +++ /dev/null @@ -1,280 +0,0 @@ -package com.huoran.occupationlab.controller; - -import com.google.common.collect.Maps; -import com.huoran.api.UserClient; -import com.huoran.common.constant.EnableStatus; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.occupationlab.entity.EduCourse; -import com.huoran.occupationlab.entity.EduCourseClassification; -import com.huoran.occupationlab.entity.SchoolClassification; -import com.huoran.occupationlab.entity.SchoolCourse; -import com.huoran.occupationlab.entity.vo.CourseVO; -import com.huoran.occupationlab.service.CourseClassificationService; -import com.huoran.occupationlab.service.CourseService; -import com.huoran.occupationlab.service.SchoolClassificationService; -import com.huoran.occupationlab.service.SchoolCourseService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.Date; -import java.util.HashMap; -import java.util.List; - -/** - * 课程基本信息 前端控制器 - * - * @author chen - * @since 2020-09-30 - */ -@Api(tags = {"管理端——课程管理"}) -@RestController -@RequestMapping("/occupationlab/management/edu/course") -public class CourseController { - - @Autowired - private CourseService courseService; - - @Autowired - private SchoolCourseService schoolCourseService; - - @Autowired - private UserClient userClient; - @Autowired - private CourseClassificationService courseClassificationService; - - @Autowired - private SchoolClassificationService schoolClassificationService; - - /** - * @Description: 是否启用企业端课程 - * @auther: Rong - * @date: 2021/9/10 16:57 - */ - @ApiOperation(value = "是否启用企业端课程") - @PutMapping("/enableQyCourse") - public R enableQyCourse( - @ApiParam(name = "courseId", value = "课程ID", required = true) - @RequestParam String courseId, - @ApiParam(name = "isEnable", value = "isEnable", required = true) - @RequestParam String isEnable, HttpServletRequest request) { - if (EnableStatus.ENABLE.equals(isEnable) || EnableStatus.NOT_ACTIVATED.equals(isEnable)) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - EduCourse course = new EduCourse(); - course.setSchoolId(String.valueOf(schoolId)); - course.setFounderId(accountId); - course.setId(courseId); - course.setIsEnable(Integer.parseInt(isEnable)); - boolean update = courseService.updateById(course); - return update ? R.ok() : R.error(); - } else { - return R.error("启用状态错误"); - } - } - - /** - * @Description: 课程列表分页条件查询 - * @auther: Rong - * @date: 2021/9/10 16:57 - */ - @ApiOperation(value = "课程列表分页条件查询") - @GetMapping("/queryCourseByCondition/{current}/{pageSize}") - public R conditionPageList( - @ApiParam(name = "current", value = "当前页码", required = true) - @PathVariable int current, - @ApiParam(name = "pageSize", value = "每页记录数", required = true) - @PathVariable int pageSize, - @ApiParam(name = "name", value = "课程名称或创建人,模糊查询", required = false) - @RequestParam(value = "name", required = false) String name, - @ApiParam(name = "classificationId", value = "课程分类ID", required = false) - @RequestParam(value = "classificationId", required = false) String classificationId, - @ApiParam(name = "port", value = "用户端0", required = false) - @RequestParam(value = "port", required = false) String port, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - - HashMap map = Maps.newHashMap(); - map.put("current", (current - 1) * pageSize); - map.put("pageSize", pageSize); - map.put("classificationId", classificationId); - map.put("schoolId", schoolId); - map.put("name", name); - map.put("port", port); - //每页记录数 - List courseList = courseService.coursePageConditionQuery(map); - //总数 - int total = courseService.coursePageConditionCount(map); - return R.ok().put("total", total).put("courseList", courseList); - } - - /** - * @Description: 添加课程 - * @auther: Rong - * @date: 2021/9/10 16:57 - */ - @ApiOperation(value = "添加课程") - @PostMapping("/addCourse") - public R addCourse( - @ApiParam(name = "course", value = "课程对象", required = true) - @RequestBody EduCourse course, - @ApiParam(name = "mark", value = "企业添加课程为1", required = false) - @RequestParam(required = false) String mark, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId1 = userClient.getSchoolIdByAccountId(accountId); - course.setFounderId(accountId); - course.setSchoolId(schoolId1 + ""); - //判重 - boolean isRepeat = courseService.repeat(course); - if (isRepeat) { - return R.error("课程已存在"); - } - //如果为1,添加企业端课程 - if ("1".equals(mark)) { - course.setDistinguish(1); - } - course.setGmtCreate(new Date()); - course.setGmtModified(new Date()); - boolean save = courseService.save(course); - //默认添加第一章 - courseService.addChapter(course); - String courseId = course.getId(); - String schoolId = course.getSchoolId(); - //学校id不为空,学校端添加课程对应学校关系 - if (schoolId != null) { - SchoolCourse schoolCourse = new SchoolCourse(); - schoolCourse.setCourseId(courseId); - schoolCourse.setSchoolId(schoolId); - schoolCourse.setGmtModified(new Date()); - schoolCourse.setGmtCreate(new Date()); - schoolCourseService.save(schoolCourse); - } - return save ? R.ok().put("courseId", courseId) : R.error(); - } - - /** - * @Description: 修改课程 - * @auther: Rong - * @date: 2021/9/10 16:57 - */ - @ApiOperation(value = "修改课程") - @PutMapping("/editCourse") - public R editCourse( - @ApiParam(name = "course", value = "课程对象", required = true) - @RequestBody EduCourse course, HttpServletRequest request) { - - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - course.setFounderId(accountId); - course.setSchoolId(schoolId + ""); - boolean update = courseService.updateById(course); - return update ? R.ok() : R.error(); - } - - /** - * @Description: 根据id查询课程 - * @auther: Rong - * @date: 2021/9/10 16:57 - */ - @ApiOperation(value = "根据id查询课程") - @GetMapping("/getCourse/{courseId}") - public R getCourse( - @ApiParam(name = "courseId", value = "课程ID", required = true) - @PathVariable String courseId) { - EduCourse course = courseService.getById(courseId); - return R.ok().put("course", course); - } - - /** - * @Description: 根据id删除课程 - * @auther: Rong - * @date: 2021/9/10 16:57 - */ - @ApiOperation(value = "根据id删除课程") - @DeleteMapping("/deleteCourse/{courseId}") - public R deleteCourse( - @ApiParam(name = "courseId", value = "课程ID", required = true) - @PathVariable String courseId) { - boolean remove = courseService.removeCourse(courseId); - return remove ? R.ok() : R.error(); - } - - /** - * @Description: 批量删除课程 - * @auther: Rong - * @date: 2021/9/10 16:57 - */ - @ApiOperation(value = "批量删除课程") - @DeleteMapping("/deleteCourses") - public R deleteCourses( - @ApiParam(name = "courseIds", value = "多个课程id", required = true) - @RequestParam("courseIds") List courseIds) { - if (courseIds != null && courseIds.size() != 0) { - boolean delete = courseService.deleteCourses(courseIds); - return delete ? R.ok() : R.error(); - } else { - return R.error(); - } - } - - /** - * @Description: 添加课程 - * @auther: Rong - * @date: 2021/9/10 16:57 - */ - @ApiOperation(value = "添加课程初始数据") - @PostMapping("/addCourseData") - public boolean addCourseData(Integer schoolId, Integer accountId) { - - //添加分类数据 - EduCourseClassification classification = new EduCourseClassification(); - //如果为1,添加企业端分类 - classification.setDistinguish(1); - classification.setName("案例分类"); - classification.setGmtCreate(new Date()); - classification.setGmtModified(new Date()); - boolean save1 = courseClassificationService.save(classification); - String classificationId = classification.getId(); - //学校id不为空,学校端添加分类对应学校关系 - if (schoolId != null) { - SchoolClassification schoolClassification = new SchoolClassification(); - schoolClassification.setClassificationId(classificationId); - schoolClassification.setSchoolId(schoolId + ""); - schoolClassificationService.save(schoolClassification); - } - - //添加课程数据 - EduCourse course = new EduCourse(); - course.setFounderId(accountId + ""); - course.setSchoolId(schoolId + ""); - course.setDistinguish(1); - course.setGmtCreate(new Date()); - course.setGmtModified(new Date()); - course.setName("样例课程"); - course.setCoverUrl("https://huoran.oss-cn-shenzhen.aliyuncs.com/20220224/png/1496736142388125696.png"); - course.setClassificationId(classificationId); - course.setFounderName("超管"); - course.setDescription("课程案例,仅供参考,可自行删除"); - - boolean save = courseService.save(course); - //默认添加第一章 - courseService.addChapter(course); - String courseId = course.getId(); - //学校id不为空,学校端添加课程对应学校关系 - if (schoolId != null) { - SchoolCourse schoolCourse = new SchoolCourse(); - schoolCourse.setCourseId(courseId); - schoolCourse.setSchoolId(schoolId + ""); - schoolCourse.setGmtModified(new Date()); - schoolCourse.setGmtCreate(new Date()); - schoolCourseService.save(schoolCourse); - } - return save; - } - -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/CourseSubsectionController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/CourseSubsectionController.java deleted file mode 100644 index 5164a81..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/CourseSubsectionController.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.huoran.occupationlab.controller; - -import com.aliyuncs.exceptions.ClientException; -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.CourseSubsection; -import com.huoran.occupationlab.service.CourseSubsectionService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.Date; - -/** - * 课程小节 前端控制器 - * - * @author chen - * @since 2020-09-30 - */ -@Api(description = "课程小节管理", tags = "课程小节管理") -@RestController -@RequestMapping("/occupationlab/management/edu/courseSubsection") -public class CourseSubsectionController { - - @Autowired - private CourseSubsectionService courseSubsectionService; - - @ApiOperation(value = "添加小节") - @PostMapping("/addSubsection") - public R addSubsection( - @ApiParam(name = "courseSubsection", value = "小节对象", required = true) - @RequestBody CourseSubsection courseSubsection) { - //防止主键重复 - courseSubsection.setId(null); - //判重 - boolean isRepeat = courseSubsectionService.repeat(courseSubsection); - if (isRepeat) { - return R.error("小节已存在"); - } - courseSubsection.setGmtCreate(new Date()); - courseSubsection.setGmtModified(new Date()); - boolean save = courseSubsectionService.saveSubsection(courseSubsection); - return save ? R.ok() : R.error(); - } - - @ApiOperation(value = "修改小节") - @PutMapping("/editSubsection") - public R editSubsection( - @ApiParam(name = "courseSubsection", value = "小节对象", required = true) - @RequestBody CourseSubsection courseSubsection) { - boolean update = courseSubsectionService.updateById(courseSubsection); - return update ? R.ok() : R.error(); - } - - @ApiOperation(value = "根据id删除小节") - @DeleteMapping("/deleteSubsection/{subsectionId}") - public R deleteSubsection( - @ApiParam(name = "subsectionId", value = "小节ID", required = true) - @PathVariable String subsectionId) throws ClientException { - boolean remove = courseSubsectionService.removeSubsection(subsectionId); - return remove ? R.ok() : R.error(); - } - - @ApiOperation(value = "根据小节id获取预览文件地址") - @GetMapping("/getSubsection/{subsectionId}") - public R getSubsection( - @ApiParam(name = "subsectionId", value = "小节ID", required = true) - @PathVariable String subsectionId) { - String officeUrl = "https://view.officeapps.live.com/op/view.aspx?src="; - // String xDocUrl = "http://view.xdocin.com/xdoc?_xdoc="; - CourseSubsection courseSubsection = courseSubsectionService.getById(subsectionId); - if (courseSubsection != null) { - String fileUrl = courseSubsection.getFileUrl(); - String previewUrl = officeUrl + fileUrl; - return R.ok().put("previewUrl", previewUrl); - } else { - return R.error(); - } - } -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/DataKanbanController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/DataKanbanController.java deleted file mode 100644 index df335b8..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/DataKanbanController.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.huoran.occupationlab.controller; - - -import com.huoran.api.UserClient; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.occupationlab.entity.req.PageReq; -import com.huoran.occupationlab.entity.req.StudentPerformanceAnalysisReq; -import com.huoran.occupationlab.entity.resp.*; -import com.huoran.occupationlab.service.ExperimentalReportService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@RestController -@RequestMapping("/occupationlab/data/kanban") -@Api(value = "API - 职站:DataKanbanController", tags = "职站:数据看板") -public class DataKanbanController { - @Autowired - private UserClient userClient; - @Autowired - private ExperimentalReportService reportService; - - @PostMapping("/getTheMostUsedCoursesInOurSchool") - @ApiOperation(value = "获取本月当前学校排名前三课程/本月综合学习积极性最高的实验课程", response = MostLabCoursestResp.class) - public R findById(HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - return reportService.getTheMostUsedCoursesInOurSchool(schoolId); - } - - - @PostMapping("/academicLeadersRanking") - @ApiOperation(value = "学霸排行榜", response = AcademicLeadersRankingResp.class) - public R academicLeadersRanking(PageReq req,HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - return reportService.academicLeadersRanking(schoolId,req); - } - - - @PostMapping("/examStatistics") - @ApiOperation(value = "平台考试数据考试统计", response = ExamStatisticsResp.class) - public R examStatistics(HttpServletRequest request, @RequestParam(value = "choose", required = true) @ApiParam(value = "周=0 、日 =1 ", required = true) Integer choose) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - return reportService.examStatistics(schoolId, choose); - } - - - @PostMapping("/studentGradeDistribution") - @ApiOperation(value = "学生成绩分布分析", response = StudentPerformanceAnalysisResp.class) - public R studentGradeDistribution(HttpServletRequest request, @RequestBody List req) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - return reportService.studentGradeDistribution(schoolId, req); - } - - @PostMapping("/studentAssessSchievement") - @ApiOperation(value = "学生实验考核成绩趋势图", response = StudentAssesScoreResp.class) - public R studentAssessSchievement(HttpServletRequest request, @RequestBody List req) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - return reportService.studentAssessSchievement(schoolId, req); - } - - - @PostMapping("/overviewOfOurSchoolData") - @ApiOperation(value = "本院数据概览", response = OverviewOfStudentExperimentDataResp.class) - public R overviewOfOurSchoolData(HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - return reportService.overviewOfOurSchoolData(schoolId); - } - - - @PostMapping("/monthlyAverageOnlineTime") - @ApiOperation(value = "月人均在线时长情况") - public R monthlyAverageOnlineTime(HttpServletRequest request, @RequestBody List req) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - return reportService.monthlyAverageOnlineTime(schoolId, req); - } - - @PostMapping("/courseRankings") - @ApiOperation(value = "课程排行榜") - public R courseRankings(HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - return reportService.courseRankings(schoolId); - } - - - @PostMapping("/activityRanking") - @ApiOperation(value = "活跃度排行榜",response = ReturnActiveRankingResp.class) - public R activityRanking(HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - return reportService.activityRanking(schoolId); - } -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/EntrepreneurialActivityAnnouncementAnnexController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/EntrepreneurialActivityAnnouncementAnnexController.java deleted file mode 100644 index 5726e2b..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/EntrepreneurialActivityAnnouncementAnnexController.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.huoran.occupationlab.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.api.UserClient; -import com.huoran.common.constant.DelConstant; -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.EntrepreneurialActivityAnnouncementAnnex; -import com.huoran.occupationlab.service.EntrepreneurialActivityAnnouncementAnnexService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -/** - * @描述:活动公告附件表控制类 - * @作者: Rong - * @日期: 2023-05-12 - */ -@RestController -@RequestMapping("/occupationlab/activity/announcement/annex") -@Api(value = "活动公告附件表:EntrepreneurialActivityAnnouncementAnnexController", tags = "R-活动公告附件表") -public class EntrepreneurialActivityAnnouncementAnnexController { - - @Autowired - public EntrepreneurialActivityAnnouncementAnnexService service; - - @Autowired - private UserClient userClient; - - - - - @PostMapping("/viewAttachments") - @ApiOperation(value = "查看公告下的附件",response = EntrepreneurialActivityAnnouncementAnnex.class) - public R findById(@RequestParam("announcementId") @ApiParam(name = "活动公告主键", value = "传入json格式", required = true) Integer announcementId) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("announcement_id",announcementId); - queryWrapper.eq("is_del", DelConstant.NOT_DEL); - List annexList = service.list(queryWrapper); - return R.ok().put("list",annexList); - } - - @PostMapping("/save") - @ApiOperation(value = "新增", response = EntrepreneurialActivityAnnouncementAnnex.class) - public R save(@RequestBody @ApiParam(name = "活动公告附件表对象", value = "传入json格式", required = true) EntrepreneurialActivityAnnouncementAnnex entrepreneurialActivityAnnouncementAnnex, HttpServletRequest request) { - boolean addState = service.save(entrepreneurialActivityAnnouncementAnnex); - return addState ? R.ok() : R.error("新增失败"); - } - - - @PostMapping("/update") - @ApiOperation(value = "修改", response = EntrepreneurialActivityAnnouncementAnnex.class) - public R update(@RequestBody @ApiParam(name = "活动公告附件表对象", value = "传入json格式", required = true) EntrepreneurialActivityAnnouncementAnnex entrepreneurialActivityAnnouncementAnnex, HttpServletRequest request) { - boolean updateState = service.updateById(entrepreneurialActivityAnnouncementAnnex); - return updateState ? R.ok() : R.error("编辑失败"); - } - - - @PostMapping("/delete") - @ApiOperation(value = "删除", response = EntrepreneurialActivityAnnouncementAnnex.class) - public R delete(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { - boolean delState = service.removeById(id); - return delState ? R.ok() : R.error("删除失败"); - } - - @PostMapping("/batchDeletion") - @ApiOperation(value = "批量删除", response = EntrepreneurialActivityAnnouncementAnnex.class) - public R batchDeletion(@ApiParam(name = "id", value = "主键", required = true) @RequestParam List ids) { - boolean delState = service.removeByIds(ids); - return delState ? R.ok() : R.error("删除失败"); - } -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/EntrepreneurialActivityAnnouncementController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/EntrepreneurialActivityAnnouncementController.java deleted file mode 100644 index 50225d0..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/EntrepreneurialActivityAnnouncementController.java +++ /dev/null @@ -1,112 +0,0 @@ -package com.huoran.occupationlab.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.api.UserClient; -import com.huoran.common.aop.annotation.NoRepeatSubmit; -import com.huoran.common.constant.DelConstant; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.occupationlab.entity.EntrepreneurialActivityAnnouncement; -import com.huoran.occupationlab.entity.EntrepreneurialActivityAnnouncementAnnex; -import com.huoran.occupationlab.service.EntrepreneurialActivityAnnouncementAnnexService; -import com.huoran.occupationlab.service.EntrepreneurialActivityAnnouncementService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -/** - * @描述:活动公告表控制类 - * @作者: Rong - * @日期: 2023-05-12 - */ -@RestController -@RequestMapping("/occupationlab/activity/announcement") -@Api(value = "活动公告表:EntrepreneurialActivityAnnouncementController", tags = "R-活动公告") -public class EntrepreneurialActivityAnnouncementController { - - @Autowired - public EntrepreneurialActivityAnnouncementService service; - - @Autowired - private UserClient userClient; - @Autowired - public EntrepreneurialActivityAnnouncementAnnexService annexService;//大赛公告附件 - - @PostMapping("/queryAnnouncementDetails") - @ApiOperation(value = "查询公告详情", response = EntrepreneurialActivityAnnouncement.class) - public R findById(@RequestParam("id") @ApiParam(value = "公告主键") Integer id) { - EntrepreneurialActivityAnnouncement competitionAnnouncement = service.getById(id); - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("announcement_id", id); - queryWrapper.eq("is_del", DelConstant.NOT_DEL); - List annexList = annexService.list(queryWrapper); - if (annexList.size() > 0) { - competitionAnnouncement.setAnnouncementAnnexList(annexList); - } - return R.ok().put("data", competitionAnnouncement); - } - - @NoRepeatSubmit - @PostMapping("/addAnnouncement") - @ApiOperation(value = "新增公告", response = EntrepreneurialActivityAnnouncement.class) - public R save(@RequestBody EntrepreneurialActivityAnnouncement competitionAnnouncement, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - competitionAnnouncement.setAccountId(Integer.valueOf(accountId)); - boolean save = service.save(competitionAnnouncement); - if (competitionAnnouncement.getAnnouncementAnnexList().size() > 0) { - competitionAnnouncement.getAnnouncementAnnexList().forEach(competitionAnnex -> { - competitionAnnex.setAnnouncementId(competitionAnnouncement.getId()); - boolean saveCompetitionAnnex = annexService.save(competitionAnnex);//保存比赛附件 - }); - } - return save ? R.ok() : R.error(); - } - - @NoRepeatSubmit - @PostMapping("/amendmentAnnouncement") - @ApiOperation(value = "修改公告", response = EntrepreneurialActivityAnnouncement.class) - public R update(@RequestBody EntrepreneurialActivityAnnouncement competitionAnnouncement) { - boolean update = service.updateById(competitionAnnouncement); - return update ? R.ok() : R.error(); - } - - @NoRepeatSubmit - @ApiOperation(value = "是否禁用公告") - @PutMapping("/disableAnnouncement") - public R disableAnnouncement(@ApiParam(name = "id", value = "公告主键", required = true) @RequestParam Integer id, - @ApiParam(name = "isDisable", value = "是否开启(0开启 1未开启 默认0)", required = true) @RequestParam Integer isDisable) { - if (isDisable == 1 || isDisable == 0) { - EntrepreneurialActivityAnnouncement EntrepreneurialActivityAnnouncement = new EntrepreneurialActivityAnnouncement(); - EntrepreneurialActivityAnnouncement.setId(id); - EntrepreneurialActivityAnnouncement.setIsOpen(isDisable); - boolean update = service.updateById(EntrepreneurialActivityAnnouncement); - return update ? R.ok() : R.error(); - } else { - return R.error("启用状态错误"); - } - } - - @NoRepeatSubmit - @PostMapping("/deleteAnnouncement") - @ApiOperation(value = "删除公告", response = EntrepreneurialActivityAnnouncement.class) - public R delete(@RequestParam("id") @ApiParam(value = "公告主键") Integer id) { - boolean del = service.removeById(id); - return del ? R.ok() : R.error(); - } - - - @PostMapping("/queryAnnouncementByCompetitionId") - @ApiOperation(value = "根据赛事id查询公告列表(分页)", response = EntrepreneurialActivityAnnouncement.class) - public R queryAnnouncementByCompetitionId( - @RequestParam("competitionId") @ApiParam(value = "赛事id") String competitionId, - @ApiParam(value = "当前页数", required = true) @RequestParam("pageNum") Integer pageNum, - @ApiParam(value = "当前页需要显示的数量", required = true) @RequestParam("pageSize") Integer pageSize) { - return service.queryAnnouncementByActivityId(competitionId, pageNum, pageSize); - } -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/EntrepreneurialActivityApplicantController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/EntrepreneurialActivityApplicantController.java deleted file mode 100644 index f8db6db..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/EntrepreneurialActivityApplicantController.java +++ /dev/null @@ -1,166 +0,0 @@ -package com.huoran.occupationlab.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.api.UserClient; -import com.huoran.common.aop.annotation.NoRepeatSubmit; -import com.huoran.common.exception.CustomException; -import com.huoran.common.exception.ExceptionEnum; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.occupationlab.entity.EntrepreneurialActivity; -import com.huoran.occupationlab.entity.EntrepreneurialActivityApplicant; -import com.huoran.occupationlab.entity.req.ActivityApplicantReq; -import com.huoran.occupationlab.entity.vo.RegistrationVO; -import com.huoran.occupationlab.service.EntrepreneurialActivityApplicantService; -import com.huoran.occupationlab.service.EntrepreneurialActivityService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; - -/** - * @描述:创业活动报名人员表控制类 - * @作者: Rong - * @日期: 2023-04-27 - */ -@RestController -@RequestMapping("/occupationlab/activity/applicant") -@Api(value = "创业活动报名人员表:EntrepreneurialActivityApplicantController", tags = "R-创业活动报名人员") -public class EntrepreneurialActivityApplicantController { - - @Autowired - public EntrepreneurialActivityApplicantService service; - - - @Autowired - public EntrepreneurialActivityService activityService; - @Autowired - private UserClient userClient; - - - @PostMapping("/ApplicantsList") - @ApiOperation(value = "报名人员列表", response = RegistrationVO.class) - public R applicantsList(@RequestBody ActivityApplicantReq request) { - return R.ok().put("data", service.ApplicantsList(request)); - } - - - @PostMapping("/findById") - @ApiOperation(value = "查询详情", response = EntrepreneurialActivityApplicant.class) - public R findById(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { - EntrepreneurialActivityApplicant entrepreneurialActivityApplicant = service.getById(id); - return R.ok().put("data", entrepreneurialActivityApplicant); - } - - - @PostMapping("/save") - @ApiOperation(value = "报名", response = EntrepreneurialActivityApplicant.class) - public R save(@RequestBody @ApiParam(name = "创业活动报名人员表对象", value = "传入json格式", required = true) EntrepreneurialActivityApplicant entrepreneurialActivityApplicant, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - entrepreneurialActivityApplicant.setAccountId(Integer.valueOf(accountId)); - entrepreneurialActivityApplicant.setSchoolId(schoolId); - - EntrepreneurialActivity activity = null; - if (entrepreneurialActivityApplicant.getActivityId() != null) { - activity = activityService.getById(entrepreneurialActivityApplicant.getActivityId()); - } - - if (activity == null) { - throw new CustomException(ExceptionEnum.DELETE_REFRESH_LIST); - } - - QueryWrapper queryWrap = new QueryWrapper<>(); - queryWrap.eq("activity_id", entrepreneurialActivityApplicant.getActivityId()); - List activityList = service.list(queryWrap); - - //报名人数限制(0表示不限制)默认为0 - if (activity.getMaximumNumber() != 0) { - //判断有人数限制的情况下不给报名 - if (activity.getMaximumNumber() <= activityList.size()) { - throw new CustomException(ExceptionEnum.ACTIVITY_REGISTRATION_FAILURE); - } - } - - //是否需要报名邀请码 - Integer code = activity.getIsNeedCode(); - if (code == 1) { - //验证报名邀请码 - if (!activity.getInvitationCode().equals(entrepreneurialActivityApplicant.getRegistrationInvitationCode())) { - throw new CustomException(ExceptionEnum.CODE); - } - } - - - boolean addState = service.save(entrepreneurialActivityApplicant); - return addState ? R.ok() : R.error("新增失败"); - } - - - @PostMapping("/update") - @ApiOperation(value = "修改", response = EntrepreneurialActivityApplicant.class) - public R update(@RequestBody @ApiParam(name = "创业活动报名人员表对象", value = "传入json格式", required = true) EntrepreneurialActivityApplicant entrepreneurialActivityApplicant, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - entrepreneurialActivityApplicant.setAccountId(Integer.valueOf(accountId)); - entrepreneurialActivityApplicant.setSchoolId(schoolId); - boolean updateState = service.updateById(entrepreneurialActivityApplicant); - return updateState ? R.ok() : R.error("编辑失败"); - } - - - @PostMapping("/delete") - @ApiOperation(value = "删除", response = EntrepreneurialActivityApplicant.class) - public R delete(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { - boolean delState = service.removeById(id); - return delState ? R.ok() : R.error("删除失败"); - } - - @PostMapping("/batchDeletion") - @ApiOperation(value = "批量删除", response = EntrepreneurialActivityApplicant.class) - public R batchDeletion(@ApiParam(name = "id", value = "主键", required = true) @RequestParam List ids) { - boolean delState = service.removeByIds(ids); - return delState ? R.ok() : R.error("删除失败"); - - } - - - @ApiOperation(value = "导出全部数据", response = RegistrationVO.class) - @GetMapping("/excelExport") - public void excelExport(@ApiParam(name = "activityId", value = "活动id", required = true) @RequestParam("activityId") Integer activityId, HttpServletResponse response) { - try { - ActivityApplicantReq req = new ActivityApplicantReq(); - req.setActivityId(activityId); - req.setPageNum(1); - req.setPageSize(1000); - service.export(response, req); - } catch (IOException e) { - e.printStackTrace(); - } - } - - @ApiOperation(value = "批量导出数据") - @PostMapping(value = "/exportDataInBatches", produces = "application/json;multipart/form-data;charset=utf-8") - public void exportSubscribedRecords(@RequestBody List listOfExportSub, HttpServletResponse response, HttpServletRequest request) throws Exception { - service.exportDataInBatches(listOfExportSub, response); - } - - - @NoRepeatSubmit - @ApiOperation(value = "是否禁用报名人员") - @PutMapping("/disableRegistration") - public R disableRegistration(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer competitionRegistrationId, @ApiParam(name = "isDisable", value = "是否禁用", required = true) @RequestParam Integer isDisable) { - EntrepreneurialActivityApplicant competitionRegistration = new EntrepreneurialActivityApplicant(); - competitionRegistration.setId(competitionRegistrationId); - competitionRegistration.setIsDisable(isDisable); - boolean update = service.updateById(competitionRegistration); - return update ? R.ok() : R.error(); - } -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/EntrepreneurialActivityController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/EntrepreneurialActivityController.java deleted file mode 100644 index 8b4894e..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/EntrepreneurialActivityController.java +++ /dev/null @@ -1,398 +0,0 @@ -package com.huoran.occupationlab.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; -import com.huoran.api.UserClient; -import com.huoran.common.aop.annotation.NoRepeatSubmit; -import com.huoran.common.constant.DelConstant; -import com.huoran.common.constant.PlatformConstant; -import com.huoran.common.exception.CustomException; -import com.huoran.common.exception.ExceptionEnum; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.occupationlab.entity.EntrepreneurialActivity; -import com.huoran.occupationlab.entity.EntrepreneurialActivityApplicant; -import com.huoran.occupationlab.entity.EntrepreneurialActivityCollect; -import com.huoran.occupationlab.entity.EntrepreneurialActivityFile; -import com.huoran.occupationlab.entity.req.DisableEnableActivityReq; -import com.huoran.occupationlab.entity.req.EntrepreneurshipActivityListrReq; -import com.huoran.occupationlab.entity.vo.EntrepreneurialActivityVO; -import com.huoran.occupationlab.service.EntrepreneurialActivityApplicantService; -import com.huoran.occupationlab.service.EntrepreneurialActivityCollectService; -import com.huoran.occupationlab.service.EntrepreneurialActivityFileService; -import com.huoran.occupationlab.service.EntrepreneurialActivityService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.Date; -import java.util.List; -import java.util.concurrent.TimeUnit; - - -/** - * @描述:创业活动管理表控制类 - * @作者: Rong - * @日期: 2023-04-26 - */ -@RestController -@RequestMapping("/occupationlab/activity") -@Api(value = "创业活动管理表:EntrepreneurialActivityController", tags = "R-创业活动管理") -public class EntrepreneurialActivityController { - @Autowired - private StringRedisTemplate redisTemplate; - @Autowired - public EntrepreneurialActivityService service; - @Autowired - public EntrepreneurialActivityApplicantService applicantService; - - @Autowired - public EntrepreneurialActivityFileService activityFileService; - - @Autowired - public EntrepreneurialActivityCollectService collectService; - - @Autowired - private UserClient userClient; - - @PostMapping("/activityList") - @ApiOperation(value = "创业活动列表(用于教师端)", response = EntrepreneurialActivityVO.class) - public R activityList(@RequestBody EntrepreneurshipActivityListrReq req, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - req.setAccountId(Integer.parseInt(accountId)); - req.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - - //当前所属平台(0:中台,1:职站教师 2职站学生) - if (req.getPlatformSource() == PlatformConstant.POST_STATION) { - String roleName = userClient.getUserAllRole(accountId, PlatformConstant.POST_STATION);//获取当前用户的角色 - req.setIsAdmin(0); - //需求: 学校超管能看到教师以及学生发布的,教师能看到老师自己的和学生的(学生的:已发布的且未被学生禁用的(教师禁用学生的要展示) - if (roleName.contains("超级管理员") || roleName.contains("管理员")) { - req.setIsAdmin(1); - } - } - - return service.activityList(req); - - } - - - @PostMapping("/schoolActivities") - @ApiOperation(value = "本校创业活动(用于学生端)", response = EntrepreneurialActivityVO.class) - public R schoolActivities(@RequestBody EntrepreneurshipActivityListrReq req, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - req.setAccountId(Integer.parseInt(accountId)); - req.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - return service.schoolActivities(req); - } - - - @PostMapping("/concernedActivity") - @ApiOperation(value = "已关注的活动(用于学生端)", response = EntrepreneurialActivityVO.class) - public R concernedActivity(@RequestBody EntrepreneurshipActivityListrReq req, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - req.setAccountId(Integer.parseInt(accountId)); - req.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - return service.concernedActivity(req); - } - - - - @PostMapping("/myActivities") - @ApiOperation(value = "我的活动(用于学生端)", response = EntrepreneurialActivityVO.class) - public R myActivities(@RequestBody EntrepreneurshipActivityListrReq req, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - req.setAccountId(Integer.parseInt(accountId)); - req.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - return service.myActivities(req); - } - - @PostMapping("/findById") - @ApiOperation(value = "查询详情", response = EntrepreneurialActivity.class) - public R findById(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id, HttpServletRequest request) { - EntrepreneurialActivity entrepreneurialActivity = service.getById(id); - String accountId = TokenUtils.getIdByJwtToken(request); - - - QueryWrapper queryWrap = new QueryWrapper<>(); - queryWrap.eq("activity_id", id); - queryWrap.eq("account_id", accountId); - EntrepreneurialActivityApplicant applicant = applicantService.getOne(queryWrap); - if (applicant != null) { - entrepreneurialActivity.setCancelId(applicant.getId()); - //是否报名(0为已报名 1为未报名) - entrepreneurialActivity.setWhetherToSignUp(0); - } - - - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("is_del", DelConstant.NOT_DEL); - queryWrapper.eq("activity_id", entrepreneurialActivity.getId()); - List activityFileList = activityFileService.list(queryWrapper); - if (activityFileList.size() > 0) { - entrepreneurialActivity.setActivityFileList(activityFileList); - } - - - QueryWrapper queryWrapper1 = new QueryWrapper<>(); - queryWrapper1.eq("account_id", accountId); - queryWrapper1.eq("activity_id", id); - EntrepreneurialActivityCollect activityCollect = collectService.getOne(queryWrapper1); - entrepreneurialActivity.setCollectorsNum(collectService.countTheNumberOfCollectors(id)); - //是否收藏:(state = 1收藏,0取消收藏) - if (activityCollect != null) { - //收藏过 - entrepreneurialActivity.setCollectionStatus(1); - } else { - entrepreneurialActivity.setCollectionStatus(0); - } - - - return R.ok().put("data", entrepreneurialActivity); - } - - - @PostMapping("/save") - @ApiOperation(value = "新增", response = EntrepreneurialActivity.class) - public R save(@RequestBody @ApiParam(name = "创业活动管理表对象", value = "传入json格式", required = true) EntrepreneurialActivity entrepreneurialActivity, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - entrepreneurialActivity.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - entrepreneurialActivity.setAccountId(Integer.valueOf(accountId)); - boolean addState = service.save(entrepreneurialActivity); - if (entrepreneurialActivity.getActivityFileList().size() > 0) { - entrepreneurialActivity.getActivityFileList().forEach(CompetitionAnnex -> { - CompetitionAnnex.setActivityId(entrepreneurialActivity.getId()); - activityFileService.save(CompetitionAnnex);//保存活动附件 - }); - - } - - return addState ? R.ok() : R.error("新增失败"); - } - - - @PostMapping("/update") - @ApiOperation(value = "编辑创业活动(不更改附件时候不传附件的集合)", response = EntrepreneurialActivity.class) - public R update(@RequestBody @ApiParam(name = "创业活动管理表对象", value = "传入json格式", required = true) EntrepreneurialActivity entrepreneurialActivity, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - entrepreneurialActivity.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - entrepreneurialActivity.setAccountId(Integer.valueOf(accountId)); - - //编辑 - if (entrepreneurialActivity.getActivityFileList().size() > 0) { - entrepreneurialActivity.getActivityFileList().forEach(CompetitionAnnex -> { - //删除原有附件 - UpdateWrapper queryWrapper = new UpdateWrapper<>(); - queryWrapper.set("is_del", DelConstant.IS_DEL); - queryWrapper.eq("activity_id", entrepreneurialActivity.getId()); - activityFileService.update(new EntrepreneurialActivityFile(), queryWrapper); - CompetitionAnnex.setActivityId(entrepreneurialActivity.getId()); - activityFileService.save(CompetitionAnnex);//保存新的活动附件 - - }); - - } - boolean updateState = service.updateById(entrepreneurialActivity); - return updateState ? R.ok() : R.error("编辑失败"); - } - - - /*@PostMapping("/delete") - @ApiOperation(value = "删除", response = EntrepreneurialActivity.class) - public R delete(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id, HttpServletRequest request) { - boolean delState = service.removeById(id); - return delState ? R.ok() : R.error("删除失败"); - }*/ - - @PostMapping("/batchDeletion") - @ApiOperation(value = "批量删除", response = EntrepreneurialActivity.class) - public R batchDeletion(@ApiParam(name = "id", value = "主键", required = true) @RequestBody List ids, HttpServletRequest request) { - //删除活动下的附件 - for (Integer id : ids) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("is_del", DelConstant.NOT_DEL); - queryWrapper.eq("activity_id", id); - List delList = activityFileService.list(queryWrapper); - if (delList.size() > 0) { - for (EntrepreneurialActivityFile file : delList) { - activityFileService.removeById(file.getId()); - } - - } - } - boolean delState = service.removeByIds(ids); - return delState ? R.ok() : R.error("删除失败"); - } - - - /*@NoRepeatSubmit - @ApiOperation(value = "赛事禁启用", response = EntrepreneurialActivity.class) - @PostMapping("/disabledEvents") - public R disabledEvents(@RequestBody DisableEnableActivityReq req, HttpServletRequest request) { - - String accountId = TokenUtils.getIdByJwtToken(request); - - EntrepreneurialActivity getDetail = service.getById(req.getActivityId()); - EntrepreneurialActivity competition = new EntrepreneurialActivity(); - competition.setId(req.getActivityId()); - - - //禁用平台来源(0中台,1职站教师端 2.职站学生端) - switch (req.getType()) { - case 1: - String roleName = userClient.getUserAllRole(accountId, PlatformConstant.POST_STATION);//获取当前用户的角色 - req.setIsAdmin(0); - //需求: 学校超管能看到教师以及学生发布的,教师能看到老师自己的和学生的(学生的:已发布的且未被学生禁用的(教师禁用学生的要展示) - if (roleName.contains("超级管理员") || roleName.contains("管理员")||roleName.contains("教师")) { - req.setIsAdmin(1); - } - - if (req.getIsAdmin() == 1) { - competition.setSchoolOpen(req.getIsOpen()); - } else { - //判断如果教师端禁用学生端的,也是禁用字段SchoolOpen - if (req.getIsOpen() == 0) { - if (getDetail.getSchoolOpen() == 1) { - return R.error("当前项目已被学校禁用,请联系学校管理员!"); - } - } - if (getDetail.getFounder() == 2) { - competition.setSchoolOpen(req.getIsOpen()); - } else { - competition.setIsOpen(req.getIsOpen()); - } - } - - break; - case 2: - - - if (req.getIsOpen() == 0) { - if (getDetail.getSchoolOpen() == 1) { - return R.error("当前项目已被学校禁用,请联系学校管理员!"); - } - } - *//* if (getDetail.getFounder() == 2) { - competition.setSchoolOpen(req.getIsOpen()); - } else {*//* - competition.setIsOpen(req.getIsOpen()); -// } - - break; - } - boolean ret = service.updateById(competition); - //保存的key名 - String key = "activityDisabled"; - //保存到缓存中 - redisTemplate.opsForValue().set(key, "true"); - return ret ? R.ok() : R.error(); - }*/ - - - @NoRepeatSubmit - @ApiOperation(value = "创业活动禁启用", response = EntrepreneurialActivity.class) - @PostMapping("/disabledEvents") - public R disabledEvents(@RequestBody DisableEnableActivityReq req, HttpServletRequest request) { - - String accountId = TokenUtils.getIdByJwtToken(request); - - EntrepreneurialActivity getDetail = service.getById(req.getActivityId()); - EntrepreneurialActivity competition = new EntrepreneurialActivity(); - competition.setId(req.getActivityId()); - //禁用平台来源(0中台,1职站教师端 2.职站学生端) - switch (req.getType()) { - case 1: - if (req.getIsOpen() == 0) { - if (getDetail.getIsOpen() == 1) { - throw new CustomException(ExceptionEnum.REFRESH_THE_LIST); - } - } - competition.setSchoolOpen(req.getIsOpen()); - break; - case 2: - //原型需求: - // 客户创建的大赛,禁用时职站首页以及学生登录后的大赛模块看不到对应的比赛,创建的老师在大赛管理还是可以看到该大赛,可以编辑,但是无法启用。 - // 即中台禁用的大赛,即使是该院校老师创建的,老师端也不能自己启用,需要中台启用。 - //1.判断当前院校禁启用状态为要启用时候再判断当前赛事中台禁启用的状态 - if (req.getIsOpen() == 0) { - if (getDetail.getSchoolOpen() == 1) { - return R.error("当前项目已被学校禁用,请联系学校管理员!"); - } - } - competition.setIsOpen(req.getIsOpen()); - break; - - } - boolean ret = service.updateById(competition); - //保存的key名 - String key = "activityDisabled"; - //以时间戳方式保存到缓存中 - redisTemplate.opsForValue().set(key, System.currentTimeMillis() + ""); - return ret ? R.ok() : R.error(); - } - - - /** - * 禁用/启用的时候,把时间戳写入那个key,前端第一次调用的时候,把时间戳写入本地缓存 - * 然后前端通过定时器获取这个redis缓存的接口 - * 只要获取到的值跟本地缓存的不一致就刷新列表 - * - * @return - */ - @PostMapping("/getRedisCache") - @ApiOperation(value = "获取Redis缓存(返回的时间戳只要获取到的值跟本地缓存的不一致就刷新列表)") - public R getRedisCache() { - //保存的key名 - String key = "activityDisabled"; - //查看缓存是否有数据 - String returnValue = redisTemplate.opsForValue().get(key); - - //使用缓存返回数据 - if (returnValue != null) { - //设置过期时间 - /*redisTemplate.expire(key, 5000, TimeUnit.MILLISECONDS);*/ - return R.ok().put("data", returnValue); - } - - - return R.ok(); - } - - - @PostMapping("/collectionActivity") - @ApiOperation(value = "收藏活动", response = EntrepreneurialActivityCollect.class) - public R collectCourse(@ApiParam(name = "activityId", value = "活动id", required = true) @RequestParam Integer activityId, - @ApiParam(name = "state", value = "操作状态(state = 1收藏,0取消收藏)", required = true) @RequestParam Integer state - , HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - QueryWrapper queryWrapper = new QueryWrapper(); - queryWrapper.eq("activity_id", activityId); - queryWrapper.eq("account_id", accountId); - EntrepreneurialActivityCollect detail = collectService.getOne(queryWrapper); - switch (state) { - case 0://取消收藏 - if (detail != null) { - collectService.removeById(detail.getId()); - } - break; - - case 1://收藏 - if (detail != null) { - return R.ok("已经收藏过了!"); - } - EntrepreneurialActivityCollect courseCollect = new EntrepreneurialActivityCollect(); - courseCollect.setActivityId(activityId); - courseCollect.setCollectionTime(new Date()); - courseCollect.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - courseCollect.setAccountId(Integer.valueOf(accountId)); - collectService.save(courseCollect); - break; - } - return R.ok(); - } -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/EntrepreneurialActivityFileController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/EntrepreneurialActivityFileController.java deleted file mode 100644 index 7185c0f..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/EntrepreneurialActivityFileController.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.huoran.occupationlab.controller; - -import com.huoran.api.UserClient; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.occupationlab.entity.EntrepreneurialActivityFile; -import com.huoran.occupationlab.service.EntrepreneurialActivityFileService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; - - -/** - * @描述:创业活动附件存储控制类 - * @作者: Rong - * @日期: 2023-04-26 - */ -@RestController -@RequestMapping("/occupationlab/activity/file") -@Api(value = "创业活动附件存储:EntrepreneurialActivityFileController", tags = "R-创业活动附件存储") -public class EntrepreneurialActivityFileController { - - @Autowired - public EntrepreneurialActivityFileService service; - - @Autowired - private UserClient userClient; - @PostMapping("/listByEntity") - @ApiOperation(value = "分页查询", response = EntrepreneurialActivityFile.class) - public R listByEntity(@RequestBody EntrepreneurialActivityFile entrepreneurialActivityFile) { - - return null; - } - - - @PostMapping("/findById") - @ApiOperation(value = "查询详情", response = EntrepreneurialActivityFile.class) - public R findById(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { - EntrepreneurialActivityFile entrepreneurialActivityFile = service.getById(id); - return R.ok().put("data", entrepreneurialActivityFile); - } - - - @PostMapping("/save") - @ApiOperation(value = "新增", response = EntrepreneurialActivityFile.class) - public R save(@RequestBody @ApiParam(name = "创业活动附件存储对象", value = "传入json格式", required = true) EntrepreneurialActivityFile entrepreneurialActivityFile, HttpServletRequest request) { - boolean addState = service.save(entrepreneurialActivityFile); - return addState ? R.ok() : R.error("新增失败"); - } - - - @PostMapping("/update") - @ApiOperation(value = "修改", response = EntrepreneurialActivityFile.class) - public R update(@RequestBody @ApiParam(name = "创业活动附件存储对象", value = "传入json格式", required = true) EntrepreneurialActivityFile entrepreneurialActivityFile, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - boolean updateState = service.updateById(entrepreneurialActivityFile); - return updateState ? R.ok() : R.error("编辑失败"); - } - - - @PostMapping("/delete") - @ApiOperation(value = "删除", response = EntrepreneurialActivityFile.class) - public R delete(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { - boolean delState = service.removeById(id); - return delState ? R.ok() : R.error("删除失败"); - } - - @PostMapping("/batchDeletion") - @ApiOperation(value = "批量删除", response = EntrepreneurialActivityFile.class) - public R batchDeletion(@ApiParam(name = "id", value = "主键", required = true) @RequestParam List ids) { - boolean delState = service.removeByIds(ids); - return delState ? R.ok() : R.error("删除失败"); - } -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/EntrepreneurialActivityProgressController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/EntrepreneurialActivityProgressController.java deleted file mode 100644 index 278720d..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/EntrepreneurialActivityProgressController.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.huoran.occupationlab.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.api.UserClient; -import com.huoran.common.aop.annotation.NoRepeatSubmit; -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.EntrepreneurialActivityProgress; -import com.huoran.occupationlab.service.EntrepreneurialActivityProgressService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -/** - * @描述:活动进展表控制类 - * @作者: Rong - * @日期: 2023-05-12 - */ -@RestController -@RequestMapping("/occupationlab/activity/progress") -@Api(value = "活动进展表:EntrepreneurialActivityProgressController", tags = "R-活动进展") -public class EntrepreneurialActivityProgressController { - - @Autowired - public EntrepreneurialActivityProgressService service; - - @Autowired - private UserClient userClient; - - @ApiOperation(value = "根据赛事id查询竞赛进展") - @GetMapping("/getCompetitionProgress") - public R getCompetitionProgress( - @ApiParam(name = "activityId", value = "活动id") - @RequestParam("activityId") String activityId) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("activity_id", activityId); - List activityProgressList = service.list(wrapper); - return R.ok().put("activityProgressList", activityProgressList); - } - - - @PostMapping("/findById") - @ApiOperation(value = "查询详情", response = EntrepreneurialActivityProgress.class) - public R findById(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { - EntrepreneurialActivityProgress entrepreneurialActivityProgress = service.getById(id); - return R.ok().put("data", entrepreneurialActivityProgress); - } - - - /* @PostMapping("/save") - @ApiOperation(value = "新增", response = EntrepreneurialActivityProgress.class) - public R save(@RequestBody @ApiParam(name = "活动进展表对象", value = "传入json格式", required = true) EntrepreneurialActivityProgress entrepreneurialActivityProgress, HttpServletRequest request) { - boolean addState = service.save(entrepreneurialActivityProgress); - return addState ? R.ok() : R.error("新增失败"); - } - -*/ - - @NoRepeatSubmit - @ApiOperation(value = "添加竞赛进展") - @PostMapping("/addCompetitionProgress") - public R addCompetitionProgress(@ApiParam(name = "competitionProgress", value = "竞赛进展对象", required = true) - @RequestBody EntrepreneurialActivityProgress competitionProgress) { - //判重 - boolean isRepeat = service.repeat(competitionProgress); - if (isRepeat) { - return R.error("竞赛进展已存在"); - } - boolean save = service.save(competitionProgress); - return save ? R.ok() : R.error(); - } - - @PostMapping("/update") - @ApiOperation(value = "修改", response = EntrepreneurialActivityProgress.class) - public R update(@RequestBody @ApiParam(name = "活动进展表对象", value = "传入json格式", required = true) EntrepreneurialActivityProgress entrepreneurialActivityProgress, HttpServletRequest request) { - boolean updateState = service.updateById(entrepreneurialActivityProgress); - return updateState ? R.ok() : R.error("编辑失败"); - } - - - @PostMapping("/delete") - @ApiOperation(value = "删除", response = EntrepreneurialActivityProgress.class) - public R delete(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { - boolean delState = service.removeById(id); - return delState ? R.ok() : R.error("删除失败"); - } - - @PostMapping("/batchDeletion") - @ApiOperation(value = "批量删除", response = EntrepreneurialActivityProgress.class) - public R batchDeletion(@ApiParam(name = "id", value = "主键", required = true) @RequestBody List ids) { - boolean delState = service.removeByIds(ids); - return delState ? R.ok() : R.error("删除失败"); - } -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/EvaluationRecordController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/EvaluationRecordController.java deleted file mode 100644 index e509163..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/EvaluationRecordController.java +++ /dev/null @@ -1,172 +0,0 @@ -package com.huoran.occupationlab.controller; - - -import com.huoran.api.UserClient; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.occupationlab.entity.EvaluationFraction; -import com.huoran.occupationlab.entity.vo.EvaluationRecordDetailVO; -import com.huoran.occupationlab.entity.vo.EvaluationRecordSubmitVO; -import com.huoran.occupationlab.entity.vo.TMSEvaluationRecordVO; -import com.huoran.occupationlab.service.EvaluationFractionService; -import com.huoran.occupationlab.service.EvaluationRecordService; -import com.huoran.occupationlab.service.QuestionsService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.concurrent.ExecutionException; - -/** - *

- * 记录用户测评信息 前端控制器 - *

- * - * @author lr - * @since 2021-09-26 - */ -@RequestMapping("/occupationlab/evaluationrecord") -@RestController -@Api(value = "职站:用户测评信息记录与操作", tags = "职站:提供用户测评信息增删改查等相关方法") -public class EvaluationRecordController { - - @Autowired - private EvaluationRecordService evaluationRecordService; - @Autowired - private QuestionsService questionsService; - @Autowired - private EvaluationFractionService fractionService; - @Autowired - private UserClient userClient; - - /* - 测评管理大致需求: - 1.用户一进去没做过的情况下,直接依据测评规则设置的题目数量直接默认生成,比如设置10题,则用户端直接随机生成10道题目且数据库同步生成10条数据. - 点击下一题时做编辑操作更改答案为用户选择的答案,点击下一题时候更改测评信息的字段更新当前做到第几题。 - - 2.如若在教师端对题目进行禁启用处理,在学生端如若已生成题目需将本次题目做完才会刷新(不能影响学生,以防学生正在测评中题目直接刷新没有),教师端更改测评规则同理, - 也是学生做完本次已经生成的题目后才会依据规则刷新设置后的题目。 - */ - - - @GetMapping("/remaining") - @ApiOperation(value = "获取测评剩余时间", notes = "获取测评剩余时间") - public R getEvaluationRemainingTime(HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - String remainingTime = questionsService.getEvaluationRemainingTime(Integer.valueOf(accountId), schoolId); - return R.ok().put("data", remainingTime); - } - - @GetMapping("/start") - @ApiOperation(value = "开始测评", notes = "开始测评") - public R startEvaluation(HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - TMSEvaluationRecordVO evaluationRecordVO = evaluationRecordService.startEvaluation(Integer.valueOf(accountId), schoolId); - return R.ok().put("data", evaluationRecordVO); - } - - @PostMapping("/previous") - @ApiOperation(value = "上一题", notes = "上一题") - public R previousQuestion(@RequestBody TMSEvaluationRecordVO evaluationRecordVO) throws ExecutionException, InterruptedException { - Integer evaluationRecordId = evaluationRecordVO.getId(); - String userAnswer = evaluationRecordVO.getUserAnswer(); - Integer currentQuestionSortNo = evaluationRecordVO.getCurrentQuestionSortNo(); - TMSEvaluationRecordVO recordVO = evaluationRecordService.convertQuestion(evaluationRecordId, currentQuestionSortNo, userAnswer, currentQuestionSortNo - 1); - return R.ok().put("data", recordVO); - } - - @PostMapping("/next") - @ApiOperation(value = "下一题", notes = "下一题") - public R nextQuestion(@RequestBody TMSEvaluationRecordVO evaluationRecordVO) throws ExecutionException, InterruptedException { - Integer evaluationRecordId = evaluationRecordVO.getId(); - String userAnswer = evaluationRecordVO.getUserAnswer(); - Integer currentQuestionSortNo = evaluationRecordVO.getCurrentQuestionSortNo(); - TMSEvaluationRecordVO recordVO = evaluationRecordService.convertQuestion(evaluationRecordId, currentQuestionSortNo, userAnswer, currentQuestionSortNo + 1); - return R.ok().put("data", recordVO); - } - - @GetMapping("/not_made") - @ApiOperation(value = "提交之前查询是否还有未做完的试题", notes = "提交之前查询是否还有未做完的试题") - public R selectNotMade(@RequestParam("evaluationRecordId") Integer evaluationRecordId) { - String result = evaluationRecordService.selectNotMade(evaluationRecordId); - return R.ok().put("data", result); - } - - @ApiOperation(value = "提交测评", notes = "提交测评") - @PostMapping("/submit") - public R submitEvaluation(@RequestBody TMSEvaluationRecordVO evaluationRecordVO, HttpServletRequest request) throws ExecutionException, InterruptedException { - Integer evaluationRecordId = evaluationRecordVO.getId(); - String userAnswer = evaluationRecordVO.getUserAnswer(); - Integer currentQuestionSortNo = evaluationRecordVO.getCurrentQuestionSortNo(); - String accountId = TokenUtils.getIdByJwtToken(request); - evaluationRecordVO.setAccountId(Integer.valueOf(accountId)); - - Integer types = evaluationRecordVO.getTypes(); - EvaluationRecordSubmitVO recordSubmitVO = evaluationRecordService.submitEvaluation(evaluationRecordId, currentQuestionSortNo, userAnswer, Integer.valueOf(accountId)); - Integer totalScore = recordSubmitVO.getTotalScore(); - EvaluationFraction fractionEntity = new EvaluationFraction(); - EvaluationFraction fraction = fractionEntity.setAccountId(Integer.valueOf(accountId)).setFraction(totalScore).setTypes(types); - fractionService.insertRecord(fraction); - - return R.ok().put("data", recordSubmitVO); - } - - @ApiOperation(value = "成绩详情", notes = "成绩详情") - @GetMapping("/detail") - public R evaluationScoreDetail(Integer evaluationRecordId) throws ExecutionException, InterruptedException { - EvaluationRecordDetailVO detailVO = evaluationRecordService.evaluationDetail(evaluationRecordId); - return R.ok().put("data", detailVO); - } - - - @ApiOperation(value = "查询是否能够开启实验", notes = "查询是否能够开启实验") - @GetMapping("/can_experiment") - public R isOpenExperiment(HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - boolean openExperiment = evaluationRecordService.isOpenExperiment(Integer.valueOf(accountId)); - return R.ok().put("data", openExperiment); - } - - - @ApiOperation(value = "查询是否能开启虚拟仿真实验", notes = "查询是否能开启虚拟仿真实验") - @GetMapping("/openExercise") - public R isOpenExercise(HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer type = 2; - Integer id = fractionService.queryScore(Integer.valueOf(accountId), type); - if (id > 0) { - Integer score = fractionService.queryExerciseRecord(Integer.valueOf(accountId)); - if (score >= 80) { - return R.ok("true"); - } else { - return R.error(200, "false"); - } - } else { - return R.error(200, "false"); - } - - } - - @ApiOperation(value = "查询是否能开启教学实验", notes = "查询是否能开启教学实验") - @GetMapping("/openTeaching") - public R isOpenTeaching(HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer type = 3; - Integer id = fractionService.queryScore(Integer.valueOf(accountId), type); - if (id > 0) { - Integer score = fractionService.queryTeachingRecord(Integer.valueOf(accountId)); - if (score >= 80) { - return R.ok("true"); - } else { - return R.error("false"); - } - } else { - return R.error("false"); - } - } -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/ExperimentalReportController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/ExperimentalReportController.java deleted file mode 100644 index 85d861f..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/ExperimentalReportController.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.huoran.occupationlab.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; -import com.huoran.common.constant.DelConstant; -import com.huoran.common.entity.ExperimentalReport; -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.req.EditExperimentalDataReq; -import com.huoran.occupationlab.service.ExperimentalReportService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - *

- * 存储各子系统的实验报告 前端控制器 - *

- * - * @author Mr.JK - * @since 2021-09-13 - */ -@RestController -@RequestMapping("/occupationlab/experimentalReport") -@Api(tags = "实验报告") -public class ExperimentalReportController { - - @Autowired - private ExperimentalReportService experimentalReportService; - - @PostMapping("/addExperimentalReport") - @ApiOperation("添加实验报告 -远程feign") - public Integer addExperimentalReport(@RequestBody ExperimentalReport experimentalReport) { - - QueryWrapper experimentalQueryWrapper = new QueryWrapper(); - experimentalQueryWrapper.eq("school_id",experimentalReport.getSchoolId()); - experimentalQueryWrapper.eq("project_id",experimentalReport.getProjectId()); - experimentalQueryWrapper.eq("curriculum_id",experimentalReport.getCurriculumId()); - experimentalQueryWrapper.eq("mall_id",experimentalReport.getMallId()); - experimentalQueryWrapper.eq("assessment_id",experimentalReport.getAssessmentId()); - experimentalQueryWrapper.eq("account_id",experimentalReport.getAccountId()); - ExperimentalReport one = experimentalReportService.getOne(experimentalQueryWrapper); - //考核id不为空,有考核数据,不保存实验报告返回0 - if (experimentalReport.getAssessmentId()!=null && one!=null){ - return 0; - } - if (experimentalReportService.save(experimentalReport)) { - return experimentalReport.getReportId(); - } - return null; - } - - /** - * @Description : 用于提交实验报告后将实验数据填入数据字段 - * @Param req - * @Author Rong---2022/5/20 - */ - @PostMapping("/editExperimentalData") - @ApiOperation("编辑实验数据") - public R editExperimentalData(@RequestBody EditExperimentalDataReq req) { - UpdateWrapper updateWrapper = new UpdateWrapper<>(); - updateWrapper.set("data", req.getData()); - updateWrapper.eq("is_del", DelConstant.NOT_DEL); - updateWrapper.eq("report_id", req.getReportId()); - boolean ret = experimentalReportService.update(new ExperimentalReport(), updateWrapper); - return ret ? R.ok() : R.error(); - } - -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/OSSFileController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/OSSFileController.java deleted file mode 100644 index d7bb0c8..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/OSSFileController.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.huoran.occupationlab.controller; - -import com.huoran.common.entity.FilesResult; -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.PythonTableData; -import com.huoran.occupationlab.service.OSSFileService; -import com.huoran.occupationlab.service.PythonTableDataService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; -import javax.validation.Valid; -import java.io.IOException; -import java.util.Date; -import java.util.List; - -/** - * @Author chen - * @DATE 2020/10/1 21:59 - * @Version 1.0 - */ -@Api(description = "阿里云文件/视频管理") -@RestController -@RequestMapping("/oss/manage") -public class OSSFileController { - - @Autowired - private OSSFileService ossFileService; - - @Autowired - public PythonTableDataService pythonTableDataService; - - - @ApiOperation(value = "文件上传(本接口只限python导入Excel至oss用(指定文件上传))") - @PostMapping("/fileupload") - public R fileupload(@ApiParam(name = "file", value = "文件", required = true) @RequestParam("file") MultipartFile file, - @ApiParam(name = "tableName", value = "表名", required = true) @RequestParam("tableName") String tableName) { - if (file == null) return R.error("请选择文件"); - - try { - //获取上传路径 - FilesResult filesResult = ossFileService.upload(file,tableName); - if (filesResult != null) { - PythonTableData pythonTableData = new PythonTableData(); - pythonTableData.setOssFileName(filesResult.getOssFileName()); - pythonTableData.setFileName(filesResult.getOriginalFileName()); - pythonTableData.setFileFormat(filesResult.getFileType()); - pythonTableData.setFileSize(filesResult.getFileSize()); - pythonTableData.setFilePath(filesResult.getFileUrl()); - pythonTableData.setCreateTime(new Date()); - pythonTableData.setTableName(tableName); - pythonTableDataService.save(pythonTableData); - - } - return R.ok().put("filesResult", filesResult); - } catch (IOException e) { - e.printStackTrace(); - return R.error(); - } - } - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/OnlineContestController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/OnlineContestController.java deleted file mode 100644 index 57282a3..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/OnlineContestController.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.huoran.occupationlab.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.huoran.api.UserClient; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.occupationlab.entity.Applicant; -import com.huoran.occupationlab.entity.Contest; -import com.huoran.occupationlab.service.ApplicantService; -import com.huoran.occupationlab.service.ContestService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -/** - * @Author chen - * @DATE 2020/10/20 15:55 - * @Version 1.0 - */ -@Api(description = "用户端线上赛事管理", tags = "用户端线上赛事管理") -@RestController -@RequestMapping("/occupationlab/enterprise/match/onlineContest") -public class OnlineContestController { - - @Autowired - private ContestService contestService; - - @Autowired - private ApplicantService applicantService; - - @Autowired - private UserClient userClient; - - @ApiOperation(value = "线上赛事列表分页条件查询") - @GetMapping("/onlineContestQuery/{current}/{pageSize}") - public R onlineContestQuery( - @ApiParam(name = "current", value = "当前页码", required = true) - @PathVariable int current, - @ApiParam(name = "pageSize", value = "每页记录数", required = true) - @PathVariable int pageSize, - @ApiParam(name = "name", value = "竞赛名称,模糊查询", required = false) - @RequestParam(value = "name", required = false) String name, - @ApiParam(name = "way", value = "最近更新排序方式0", required = false) - @RequestParam(value = "way", required = false) String way, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - Page page = new Page<>(current, pageSize); - //分页查询 - contestService.pageQuery(page, name, way, schoolId); - //查询用户报名赛事 - List contestIds = applicantService.queryContestId(accountId); - //每页记录数 - List contestList = page.getRecords(); - //总数 - long total = page.getTotal(); - return R.ok().put("contestList", contestList).put("contestIds", contestIds).put("total", total); - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/PermissionController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/PermissionController.java deleted file mode 100644 index b0ada7b..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/PermissionController.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.huoran.occupationlab.controller; - - -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.AclPermission; -import com.huoran.occupationlab.entity.vo.PermissionVO; -import com.huoran.occupationlab.service.PermissionService; -import com.huoran.occupationlab.service.RolePermissionService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -/** - * 权限 菜单管理 - */ -@Api(tags = "权限菜单管理") -@RestController -@RequestMapping("/occupationlab/management/permission") -public class PermissionController { - - @Autowired - private PermissionService permissionService; - - @Autowired - private RolePermissionService rolePermissionService; - - @ApiOperation(value = "获取企业端权限菜单") - @GetMapping("/queryPermissionMenu") - public R queryPermissionMenu() { - List list = permissionService.queryAllMenu(); - return R.ok().put("children", list); - } - - @ApiOperation(value = "获取管理端权限菜单") - @GetMapping("/queryManagementPermissionMenu") - public R queryEnterprisePermissionMenu() { - List list = permissionService.queryManagementAllMenu(); - return R.ok().put("children", list); - } - - // @ApiOperation(value = "递归删除菜单") - // @DeleteMapping("/remove/{id}") - // public R remove(@PathVariable String id) { - // permissionService.removeChildById(id); - // return R.ok(); - // } - - @ApiOperation(value = "给角色分配权限") - @PostMapping("/doAssign") - public R doAssign(@RequestBody PermissionVO permissionVO) { - String roleId = permissionVO.getRoleId(); - Integer isPort = permissionVO.getIsPort(); - if (roleId != null) { - //给角色分配权限之前,删除所有角色权限 - rolePermissionService.removeMenu(roleId, isPort); - //分配权限 - permissionService.saveRolePermissionRelationShip(permissionVO); - return R.ok(); - } else { - return R.error(); - } - } - - @ApiOperation(value = "根据角色获取菜单") - @GetMapping("/toAssign/{roleId}") - public R toAssign(@PathVariable String roleId) { - List rolePermissions = permissionService.selectRoleMenu(roleId); - return R.ok().put("rolePermissions", rolePermissions); - } - - @ApiOperation(value = "新增菜单") - @PostMapping("/save") - public R save(@RequestBody AclPermission permission) { - permissionService.save(permission); - return R.ok(); - } - - // @ApiOperation(value = "修改菜单") - // @PutMapping("/update") - // public R updateById(@RequestBody Permission permission) { - // permissionService.updateById(permission); - // return R.ok(); - // } - -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/PlayRecordController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/PlayRecordController.java deleted file mode 100644 index 10bf580..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/PlayRecordController.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.huoran.occupationlab.controller; - -import com.huoran.api.UserClient; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.occupationlab.entity.PlayRecord; -import com.huoran.occupationlab.service.PlayRecordService; -import io.swagger.annotations.*; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import org.springframework.beans.factory.annotation.Autowired; -import org.apache.commons.lang.StringUtils; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import org.springframework.web.bind.annotation.RequestParam; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; - -import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; - -/** - *

- * 资源播放记录表 前端控制器 - *

- * - * @author lr - * @since 2022-09-09 - */ -@RestController -@RequestMapping("/occupationlab/playRecord") -@Api(value = "资源播放记录表:PlayRecordController", tags = "R-资源播放记录") -public class PlayRecordController { - - @Autowired - public PlayRecordService service; - @Autowired - private UserClient userClient; - - - @PostMapping("/findById") - @ApiOperation(value = "查询详情", response = PlayRecord.class) - public R findById(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { - PlayRecord playRecord = service.getById(id); - return R.ok().put("data", playRecord); - } - - - @PostMapping("/save") - @ApiOperation(value = "新增", response = PlayRecord.class) - public R save(@RequestBody @Valid @ApiParam(name = "资源播放记录表对象", value = "传入json格式", required = true) PlayRecord playRecord, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - playRecord.setAccountId(Integer.valueOf(accountId)); - playRecord.setSchoolId(schoolId); - - boolean addState = service.save(playRecord); - return addState ? R.ok() : R.error("新增失败"); - } - - - @PostMapping("/update") - @ApiOperation(value = "修改", response = PlayRecord.class) - public R update(@RequestBody @ApiParam(name = "资源播放记录表对象", value = "传入json格式", required = true) PlayRecord playRecord, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - playRecord.setAccountId(Integer.valueOf(accountId)); - playRecord.setSchoolId(schoolId); - boolean updateState = service.updateById(playRecord); - return updateState ? R.ok() : R.error("编辑失败"); - } - - - @PostMapping("/delete") - @ApiOperation(value = "删除", response = PlayRecord.class) - public R delete(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { - boolean delState = service.removeById(id); - return delState ? R.ok() : R.error("删除失败"); - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/ProjectJudgmentController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/ProjectJudgmentController.java deleted file mode 100644 index f4f7a04..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/ProjectJudgmentController.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.huoran.occupationlab.controller; - - -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.ProjectJudgment; -import com.huoran.occupationlab.service.ProjectJudgmentService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiModelProperty; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; -import java.util.List; - -/** - *

- * 项目管理判分点绑定表 前端控制器 - *

- * - * @author Mr.JK - * @since 2021-08-26 - */ -@Api(tags = "项目管理:项目管理判分点绑定") -@RestController -@RequestMapping("/occupationlab/projectJudgment") -public class ProjectJudgmentController { - - @Autowired - private ProjectJudgmentService projectJudgmentService; - - @ApiOperation(value = "添加项目管理、判分点中间表") - @PostMapping("/addProjectJudgment") - public R addProjectJudgment(@RequestBody @Valid List projectJudgments){ - return R.toR(projectJudgmentService.saveBatch(projectJudgments)); - } - - @ApiOperation(value = "批量更新") - @PostMapping("/updateProjectJudgment") - public R updateProjectJudgment(@RequestParam Integer projectId,@RequestBody @Valid List projectJudgments){ - return R.toR(projectJudgmentService.updateProjectJudgment(projectId,projectJudgments)); - } - - @ApiOperation(value = "批量删除") - @PostMapping("deleteProjectJudgment") - public R deleteProjectJudgment(@RequestParam List projectJudgmentIds){ - return R.toR(projectJudgmentService.removeByIds(projectJudgmentIds)); - } - - @ApiOperation(value = "获取判分点分数信息 远程feign") - @GetMapping("getJudgmentScore") - public Integer getJudgmentScore(@RequestParam Integer projectId,@RequestParam Integer JudgmentId){ - return projectJudgmentService.getJudgmentScore(projectId,JudgmentId); - } - -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/ProjectManageController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/ProjectManageController.java deleted file mode 100644 index 452be2b..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/ProjectManageController.java +++ /dev/null @@ -1,267 +0,0 @@ -package com.huoran.occupationlab.controller; - -import com.huoran.api.UserClient; -import com.huoran.common.constant.PlatformConstant; -import com.huoran.common.entity.ProjectManage; -import com.huoran.common.entity.to.JudgmentPointDataTo; -import com.huoran.common.entity.to.ProjectDataTo; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.occupationlab.entity.req.PageAssessmentForProjectReq; -import com.huoran.occupationlab.entity.req.ProjectManageReq; -import com.huoran.occupationlab.entity.resp.StuAssessmentListResp; -import com.huoran.occupationlab.entity.vo.ProjectVo; -import com.huoran.occupationlab.service.ProjectManageService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.util.ObjectUtils; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; -import java.util.List; - -/** - *

- * 项目管理表 前端控制器 - * 职站与中台接口 - *

- * - * @author Mr.JK - * @since 2021-08-26 - */ -@Api(tags = "项目管理:项目管理") -@RestController -@RequestMapping("/occupationlab/projectManage") -public class ProjectManageController { - - @Autowired - private ProjectManageService projectManageService; - - @Autowired - private UserClient userClient; - - @ApiOperation("项目管理——列表(分页、筛选)") - @PostMapping("/queryProjectManage") - public R queryProjectManageByNakadai(@RequestBody ProjectManageReq projectManageReq, @RequestHeader String token) { - //token查询学校id - Integer schoolId = userClient.getSchoolIdByAccountId(TokenUtils.getIdByJwtToken(token)); - if (schoolId == -1) { - return R.error("学校查询失败"); - } - - String accountId = TokenUtils.getIdByJwtToken(token); - projectManageReq.setSchoolId(schoolId); - projectManageReq.setAccountId(Integer.valueOf(accountId)); - - if (projectManageReq.getPlatformId() == PlatformConstant.POST_STATION) { - String roleName = userClient.getUserAllRole(accountId, PlatformConstant.POST_STATION);//获取当前用户的角色 - //需求:需要依据角色查询本校内的项目(超管管理员角色能看到本校内发布的全部项目、其它角色只能看到自己发布的以及超管管理员发布的项目) - if (roleName.contains("超级管理员") || roleName.contains("管理员")) { - projectManageReq.setIsAdmin(1); - } - return projectManageService.queryProjectManageByOccupationlab(projectManageReq); - } - return projectManageService.queryProjectManageByNakadai(projectManageReq); - - } - - /** - * @Description :2021/11/26修改 由原来新增项目不区分创建人角色修改为根据账号id区分创建人角色(目前中台管理员只有一人以账号id区分) - * @Param projectVo - * @Param token - * @Param request - */ - @ApiOperation("新增项目管理") - @PostMapping("/addProjectManage") - public R addProjectManage(@RequestBody ProjectVo projectVo, - @RequestHeader String token, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - //token查询学校id - Integer schoolId = userClient.getSchoolIdByAccountId(TokenUtils.getIdByJwtToken(token)); - if (schoolId == -1) { - return R.error("学校查询失败"); - } - projectVo.getProjectManage().setSchoolId(schoolId); - projectVo.getProjectManage().setAccountId(Integer.valueOf(accountId)); - - if (ObjectUtils.isEmpty(projectVo.getProjectJudgmentList())) { - return R.error("判分点为空!"); - } - - return projectManageService.addProjectManage(projectVo); - } - - @ApiOperation("修改项目管理") - @PostMapping("/updateProjectManage") - public R updateProjectManage(@RequestBody @Valid ProjectVo projectVo) { - if (ObjectUtils.isEmpty(projectVo.getProjectJudgmentList())) { - return R.error("判分点为空!"); - } - return projectManageService.updateProjectManage(projectVo); - } - - @ApiOperation("批量删除项目管理") - @PostMapping("/deleteProjectManage") - public R deleteProjectManage(@RequestParam List projectIds, @RequestParam Integer platformId) { - return projectManageService.deleteProjectManage(projectIds, platformId); - } - - @ApiOperation("根据项目id查询详情") - @GetMapping("/getProjectDetail") - public R getProjectDetail(@RequestParam Integer projectId, - @RequestParam(value = "stuAssessent", required = false) - @ApiParam(value = "学生考核进入考核调用时给后端的标识,用于给后端区分禁用启用根据禁用启用展示(默认给1)", required = false) - Integer stuAssessent, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - //token查询学校id - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - return projectManageService.getProjectDetail(projectId, stuAssessent, schoolId); - } - - @ApiOperation("根据项目id查询判分点") - @PostMapping("/getProjectPoints") - public JudgmentPointDataTo getProjectPoints(@RequestBody ProjectDataTo projectDataTo) { - return projectManageService.getProjectPoints(projectDataTo); - } - - @ApiOperation(value = "更新开启状态") - @GetMapping("/updateIsOpen") - public R updateIsOpen(@RequestParam Integer projectId, @RequestParam Integer isOpen, - @RequestParam Integer platformId, @RequestHeader String token) { - String accountId = TokenUtils.getIdByJwtToken(token); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - projectManageService.updateIsOpen(projectId, isOpen, platformId, schoolId); - return R.ok(); - } - - @ApiOperation(value = "新增/编辑项目管理名称判重", notes = "字段无开启校验") - @PostMapping("/queryNameIsExist") - public R queryNameIsExist(@RequestBody ProjectManage projectManage, @RequestHeader String token) { - String accountId = TokenUtils.getIdByJwtToken(token); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - projectManage.setFounder(0); - if (schoolId != null) { - projectManage.setSchoolId(schoolId); - projectManage.setFounder(1); - } - Integer ret = projectManageService.queryNameIsExist(projectManage); - if (ret == 1) { - return R.ok(); - } else { - return R.error("项目名称重复!"); - } - } - - @ApiOperation(value = "平均分分配值") - @GetMapping("/avgValues") - public R avgValues(@RequestParam Integer number) { - return projectManageService.avgValues(number); - } - - @ApiOperation(value = "根据系统id获取项目(获取课程下与该学校下的所有项目)") - @GetMapping("/getProjectBySystemId") - public R getProjectBySystemId( - @RequestParam String systemId, - @RequestHeader String token, - @ApiParam(value = "项目权限(0、练习 1、考核 2、竞赛)", name = "permissions") - @RequestParam Integer permissions, - @RequestParam Integer cId, @RequestParam Integer mallId) { - String accountId = TokenUtils.getIdByJwtToken(token); - return projectManageService.getProjectBySystemId(systemId, accountId, permissions, cId, mallId); - } - - - - - @ApiOperation(value = "根据系统id获取项目(获取课程下与该学校下的所有项目) 仅供远程调用", response = StuAssessmentListResp.class) - @PostMapping("/getProjectBySystemIdRemoteCall") - public List getProjectBySystemIdRemoteCall( - @RequestParam("systemId") @ApiParam(value = "系统id(可多个逗号拼接)") String systemId, - @RequestParam("permissions") @ApiParam(value = "项目权限(0、练习 1、考核 2、竞赛)") Integer permissions, - @RequestParam("courseId") @ApiParam(value = "课程id") Integer courseId, - @RequestParam("accountId") @ApiParam(value = "账号id(必填)") Integer accountId, - @RequestParam("mallId") @ApiParam(value = "商品id(必填)") Integer mallId) { - return projectManageService.getProjectBySystemIdRemoteCall(systemId, accountId + "", permissions, courseId, mallId); - } - - @ApiOperation("复制项目管理") - @PostMapping("/copyProjectManage") - public R copyProjectManage(@RequestBody ProjectVo projectVo, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - projectVo.getProjectManage().setAccountId(Integer.valueOf(accountId)); - projectVo.getProjectManage().setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - return projectManageService.copyProjectManage(projectVo); - } - - @ApiOperation(value = "根据系统id、项目权限获取系统内置项目") - @GetMapping("/getInternalProjectBySystemId") - public List getInternalProjectBySystemId(@RequestParam List systemId, - @RequestParam @ApiParam(value = "项目权限(0、练习 1、考核 2、竞赛)", name = "permissions") Integer permissions) { - return projectManageService.getInternalProjectBySystemId(systemId, permissions); - } - - @ApiOperation("获取学校下拥有的系统") - @GetMapping("/getSystemIdBySchool") - public R getSystemIdBySchool(@RequestHeader String token) { - String accountId = TokenUtils.getIdByJwtToken(token); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - if (schoolId == -1) { - return R.error("查询学校失败!"); - } - return projectManageService.getSystemIdBySchool(schoolId); - } - - @ApiOperation(value = "根据课程id获取考核项目列表(分页、筛选)", response = ProjectManage.class) - @PostMapping("/getSchoolProjectByAssessent") - public R getSchoolProjectByAssessent(@RequestBody PageAssessmentForProjectReq projectManageReq, @RequestHeader String token) { - //token查询学校id - Integer schoolId = userClient.getSchoolIdByAccountId(TokenUtils.getIdByJwtToken(token)); - if (schoolId == -1) { - return R.error("学校查询失败"); - } - String accountId = TokenUtils.getIdByJwtToken(token); - projectManageReq.setSchoolId(schoolId); - projectManageReq.setAccountId(Integer.valueOf(accountId)); - - return projectManageService.getSchoolProjectByAssessent(projectManageReq); - - } - - - @ApiOperation(value = "赛事根据课程id获取考核项目列表(分页、筛选)", response = ProjectManage.class) - @PostMapping("/getProjectAssessmentByCompetition") - public R getProjectAssessmentByCompetition(@RequestBody PageAssessmentForProjectReq projectManageReq, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - //token查询学校id - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - if (schoolId > 0) { - projectManageReq.setSchoolId(schoolId); - } - return projectManageService.getProjectAssessmentByCompetition(projectManageReq); - } - - @ApiOperation("保存项目草稿") - @PostMapping("/saveProjectDraft") - public R saveProjectDraft(@RequestBody ProjectVo projectVo, - @RequestHeader String token, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - //token查询学校id - Integer schoolId = userClient.getSchoolIdByAccountId(TokenUtils.getIdByJwtToken(token)); - if (schoolId == -1) { - return R.error("学校查询失败"); - } - projectVo.getProjectManage().setSchoolId(schoolId); - projectVo.getProjectManage().setAccountId(Integer.valueOf(accountId)); - return projectManageService.addProjectManage(projectVo); - } - - @ApiOperation("修改项目草稿") - @PostMapping("/editProjectDraft") - public R editProjectDraft(@RequestBody @Valid ProjectVo projectVo) { - return projectManageService.updateProjectManage(projectVo); - } -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/ProvinceController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/ProvinceController.java deleted file mode 100644 index af41b92..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/ProvinceController.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.huoran.occupationlab.controller; - - -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.Province; -import com.huoran.occupationlab.service.ProvinceService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import java.util.List; - -/** - *

- * 省份表 前端控制器 - *

- * - * @author Ning - * @since 2020-10-27 - */ -@RestController -@RequestMapping("/occupationlab/enterprise/province") -@Api(description = "省份", tags = "省份") -public class ProvinceController { - - @Autowired - private ProvinceService provinceService; - - /** - * 查询省份 - */ - @ApiOperation(value = "查询省份") - @GetMapping("/queryProvince") - public R queryProvince() { - List list = provinceService.queryProvince(); - return R.ok().put("list", list); - } -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/PythonFileDataController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/PythonFileDataController.java deleted file mode 100644 index e0daade..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/PythonFileDataController.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.huoran.occupationlab.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.api.NakadaiClient; -import com.huoran.api.UserClient; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.occupationlab.entity.PythonFileData; -import com.huoran.occupationlab.service.PythonFileDataService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.ArrayList; -import java.util.List; - -/** - *

- * 前端控制器 - *

- * - * @author lr - * @since 2022-04-06 - */ -@RestController -@RequestMapping("/occupationlab/python/file/data") -@Api(value = "职站-python:我的数据", tags = "职站-python:我的数据") -public class PythonFileDataController { - - @Autowired - public PythonFileDataService service; - @Autowired - private UserClient userClient; - @Autowired - private NakadaiClient nakadaiClient; - - /** - * @Description : 导入数据 - * @Param fileData - * @Param request - * @Author Rong---2022/4/6 - */ - @PostMapping("/importData") - @ApiOperation(value = "新增数据") - public R importData(@RequestBody PythonFileData fileData, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - fileData.setAccountId(Integer.valueOf(accountId)); - fileData.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - //统计总共上传的文件大小 - Double fileSize = service.statistics(Integer.valueOf(accountId), userClient.getSchoolIdByAccountId(accountId)); - - if (fileSize > 10 || (10 - fileSize) < Double.valueOf(fileData.getFileSize()) / (1024 * 1024)) { - return R.error("当前储存空间已满,请删除不需要的文件后再上传!"); - } - - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("file_name", fileData.getFileName()); - queryWrapper.eq("account_id", accountId); - queryWrapper.eq("school_id", userClient.getSchoolIdByAccountId(accountId)); - PythonFileData pythonFileData = service.getOne(queryWrapper); - if (pythonFileData != null) { - return R.error("您已导入过相同的文件!"); - } - - boolean result = service.save(fileData); - return result ? R.ok() : R.error(); - } - - /** - * @Description : 我的数据 - * @Param req - * @Param request - * @Author Rong---2022/4/6 - */ - @PostMapping("/myData") - @ApiOperation(value = " 我的数据", response = PythonFileData.class) - public R myData(@RequestParam(value = "fileName", required = false) @ApiParam(value = "文件名称", required = false) String fileName, - @ApiParam(value = "当前页数", required = true) @RequestParam("pageNum") Integer pageNum, - @ApiParam(value = "当前页需要显示的数量", required = true) @RequestParam("pageSize") Integer pageSize, - HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - PythonFileData fileData = new PythonFileData(); - fileData.setAccountId(Integer.valueOf(accountId)); - fileData.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - fileData.setFileName(fileName); - fileData.setPageNum(pageNum); - fileData.setPageSize(pageSize); - return service.myData(fileData); - } - - @PostMapping("/lookOver") - @ApiOperation(value = "查看") - public R lookOver(@RequestParam("id") @ApiParam(value = "id") Integer id) { - PythonFileData pythonFileData = service.getById(id); - return R.ok().put("data", pythonFileData); - } - - @ApiOperation("批量删除") - @PostMapping("/batchDeletion") - public R deleteProjectManage(@RequestParam List ids, HttpServletRequest request) { - List ossFileNames = new ArrayList<>(); - for (Integer id : ids) { - PythonFileData pythonFileData = service.getById(id); - ossFileNames.add(pythonFileData.getOssFileName()); - - } - nakadaiClient.fileDeletion(ossFileNames, request);//删除阿里云文件 - return service.removeByIds(ids) ? R.ok() : R.error(); - } - - /*@PostMapping("/lookExcel") - @ApiOperation(value = "查看Excel") - public R lookExcel(@RequestParam("excelUrl") @ApiParam(value = "Excel地址") String excelUrl) { - return R.ok().put("data", EXCELUtil.readFile(excelUrl)); - }*/ - -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/PythonTableDataController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/PythonTableDataController.java deleted file mode 100644 index ae5a047..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/PythonTableDataController.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.huoran.occupationlab.controller; - - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.common.constant.DelConstant; -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.ContestAnnouncement; -import com.huoran.occupationlab.entity.ContestAnnouncementAnnex; -import com.huoran.occupationlab.entity.PythonTableData; -import com.huoran.occupationlab.service.PythonTableDataService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; -import java.util.List; - -/** - *

- * 储存全部python表数据表导出Excel路径 前端控制器 - *

- * - * @author lr - * @since 2022-08-12 - */ -@RestController -@RequestMapping("/python/table/data") -@Api(value = "储存全部python表数据表导出Excel路径:PythonTableDataController", tags = "R-储存全部python表数据表导出Excel路径") -public class PythonTableDataController { - @Autowired - public PythonTableDataService service; - - - @PostMapping("/save") - @ApiOperation(value = "新增", response = PythonTableData.class) - public R save(@RequestBody @Valid PythonTableData pythonTableData) { - boolean addState = service.save(pythonTableData); - return addState ? R.ok() : R.error(); - } - - - @PostMapping("/lookupTableFile") - @ApiOperation(value = "查询某表的Excel文件是否存在", response = PythonTableData.class) - public R lookupTableFile(@RequestParam("tableName") @ApiParam(value = "表名") String tableName) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("table_name", tableName); - PythonTableData pythonTableData = service.getOne(queryWrapper); - return R.ok().put("data", pythonTableData); - } -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/QuestionsController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/QuestionsController.java deleted file mode 100644 index bcbca16..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/QuestionsController.java +++ /dev/null @@ -1,206 +0,0 @@ -package com.huoran.occupationlab.controller; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.huoran.api.UserClient; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.occupationlab.entity.EvaluationRules; -import com.huoran.occupationlab.entity.Questions; -import com.huoran.occupationlab.entity.req.QuestionsAddReq; -import com.huoran.occupationlab.entity.req.QuestionsQueryReq; -import com.huoran.occupationlab.entity.req.QuestionsUpdateReq; -import com.huoran.occupationlab.entity.vo.EvaluationRulesVO; -import com.huoran.occupationlab.entity.vo.QuestionsDetailVO; -import com.huoran.occupationlab.service.EvaluationRulesService; -import com.huoran.occupationlab.service.QuestionsService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - *

- * 测评管理-题库记录表 前端控制器 - *

- * - * @author lr - * @since 2021-08-12 - */ -@RestController -@RequestMapping("/occupationlab/questions") -@Api(value = "职站:测评管理", tags = "职站:测评管理") -public class QuestionsController { - @Autowired - public QuestionsService service; - @Autowired - public EvaluationRulesService evaluationRulesService; - @Autowired - private UserClient userClient; - - /** - * 题库列表查询 - * - * @param queryReq - * @return - */ - @PostMapping("/list") - @ApiOperation(value = "题库列表查询") - public R list(@RequestBody QuestionsQueryReq queryReq, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - queryReq.setAccountId(Integer.valueOf(accountId)); - queryReq.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - IPage getQuestionsList = service.getQuestionsList(queryReq); - return R.ok().put("page", getQuestionsList); - } - - /** - * 新增题目 - * - * @param questions - * @return - */ - @PostMapping("/save") - @ApiOperation(value = "新增题目") - public R save(@RequestBody QuestionsAddReq questions, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - questions.setAccountId(Integer.valueOf(accountId)); - questions.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - boolean save = service.saveQuestion(questions); - return save ? R.ok() : R.error(); - } - - /** - * @描述: 根据试题id修改试题信息 - * @入参: - * @出参: - * @作者: Rong - * @日期: 2021-08-12 - **/ - @PostMapping("/update") - @ApiOperation(value = "根据试题id修改试题信息") - public R update(@RequestBody QuestionsUpdateReq questions) { - boolean update = service.updateQuestionById(questions); - return update ? R.ok() : R.error(); - } - - /** - * @描述: 根据主键删除 - * @入参: id - * @出参: - * @作者: Rong - * @日期: 2021-08-12 - **/ - @PostMapping("/delete") - @ApiOperation(value = "根据主键删除") - public R delete(@ApiParam(name = "ids", value = "多个id", required = true) @RequestParam("ids") List ids) { - boolean delete = service.deleteByIds(ids); - return delete ? R.ok() : R.error(); - } - - /** - * 是否禁用试题 - */ - @PostMapping("/isDisable") - @ApiOperation(value = "是否禁用试题") - public R isDisable(@RequestParam(name = "id", required = true) Integer id, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - R result = service.isDisable(id, schoolId); - return result; - } - - /** - * 查看当前题库信息 - */ - @ApiOperation(value = "查看当前题库信息") - @GetMapping("/detail") - public R info(@RequestParam(name = "id", required = true) Integer id) { - QuestionsDetailVO questions = service.getQuestionDetailById(id); - return R.ok().put("questions", questions); - } - - @PostMapping("/importQuestion") - @ApiOperation("批量导入题库") - public R importQuestion(@RequestParam(name = "file") MultipartFile file, HttpServletRequest request) throws IOException { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - Map map = service.upload(file, schoolId, Integer.valueOf(accountId)); - return R.ok().put("data", map); - } - - /** - * 批量导入题库失败数据导出 - * - * @param response - * @param exportCode - * @throws Exception - */ - @ApiOperation(value = "批量导入题库失败数据导出") - @GetMapping("/exportFailure") - public void exportFailureRecord(HttpServletResponse response, @ApiParam(name = "exportCode", value = "importQuestion接口返回的exportCode", required = true) @RequestParam String exportCode) throws Exception { - service.exportFailureRecord(response, exportCode); - } - - /** - * 测评规则信息的展示 - */ - @ApiOperation(value = "测评规则信息的展示", notes = "测评规则信息的展示", response = EvaluationRulesVO.class) - @GetMapping("/info") - public R info(HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - EvaluationRulesVO evaluationRulesVO = evaluationRulesService.getEvaluationRules(schoolId); - return R.ok().put("data", evaluationRulesVO); - } - - /** - * 修改 - */ - @ApiOperation(value = "修改测评规则信息", notes = "修改测评规则信息") - @PostMapping("/updateEvaluationRules") - public R updateEvaluationRules(@RequestBody EvaluationRules evaluationRules, HttpServletRequest request) { - - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - evaluationRules.setSchoolId(schoolId); - boolean b = evaluationRulesService.updateEvaluationRulesById(evaluationRules); - - return b ? R.ok() : R.error(); - } - - /** - * @Description : 下单复制题库 - * @Param schoolId - * @Author Rong---2021/10/28 - */ - @ApiOperation(value = "下单复制题库(远程调用)", notes = "下单复制题库") - @PostMapping("/copyQuestion") - public boolean copyQuestion(@RequestParam(name = "schoolId", required = true) Integer schoolId, - @RequestParam(name = "accountId", required = true) Integer accountId) { - boolean ret = service.copyQuestion(schoolId, accountId); - return ret; - } - - /** - * @Description : 创建客户后内置测评数据 - * @Param schoolId - * @Author Rong---2021/10/28 - */ - @ApiOperation(value = "创建客户后内置测评数据(远程调用)", notes = "创建客户后内置测评数据") - @PostMapping("/copyEvaluationRules") - public boolean copyEvaluationRules(@RequestParam(name = "schoolId", required = true) Integer schoolId) { - boolean ret = evaluationRulesService.copyEvaluationRules(schoolId); - return ret; - } -} - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/RabbitController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/RabbitController.java deleted file mode 100644 index 18226ff..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/RabbitController.java +++ /dev/null @@ -1,41 +0,0 @@ -/* -package com.huoran.occupationlab.controller; - -import com.huoran.common.constant.RabbitmqConstant; -import com.huoran.common.response.R; -import com.huoran.occupationlab.service.RabbitService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.amqp.rabbit.core.RabbitTemplate; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -@Api(tags = "消息管理") -@RestController -@RequestMapping("/occupationlab/rabbitmq") -public class RabbitController { - - @Autowired - RabbitTemplate rabbitTemplate; - - @Autowired - RabbitService rabbitService; - - @ApiOperation(value = "消息发送") - @GetMapping("/messageSend") - public R messageSend(@RequestParam String message) { - rabbitTemplate.convertAndSend(RabbitmqConstant.COURSE_EXCHANGE, RabbitmqConstant.COURSE_ROUTING_KEY, message); - return R.ok("消息发送成功"); - } - - @ApiOperation(value = "消息返回") - @GetMapping("/receiveMessage") - public R receiveMessage() { - return rabbitService.receiveMessage(); - } - -} -*/ diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/RoleController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/RoleController.java deleted file mode 100644 index 7b97533..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/RoleController.java +++ /dev/null @@ -1,106 +0,0 @@ -package com.huoran.occupationlab.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.AclRole; -import com.huoran.occupationlab.service.RoleService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -/** - * 角色管理 - */ -@Api(tags = "角色管理") -@RestController -@RequestMapping("/occupationlab/management/role") -public class RoleController { - - @Autowired - private RoleService roleService; - - @ApiOperation(value = "角色分页列表查询") - @GetMapping("/list/{page}/{limit}") - public R index( - @ApiParam(name = "page", value = "当前页码", required = true) - @PathVariable Long page, - @ApiParam(name = "limit", value = "每页记录数", required = true) - @PathVariable Long limit, - @ApiParam(name = "clientId", value = "绑定客户id", required = true) - @RequestParam(required = true) Integer clientId, - @ApiParam(name = "name", value = "角色名称", required = false) - @RequestParam(required = false) String name) { - Page pageParam = new Page<>(page, limit); - QueryWrapper wrapper = new QueryWrapper<>(); - if (name != null) { - wrapper.like("role_name", name); - } - wrapper.eq("client_id", clientId); - roleService.page(pageParam, wrapper); - return R.ok().put("items", pageParam.getRecords()).put("total", pageParam.getTotal()); - } - - @ApiOperation(value = "获取角色") - @GetMapping("/get/{id}") - public R get(@PathVariable String id) { - AclRole role = roleService.getById(id); - return R.ok().put("item", role); - } - - @ApiOperation(value = "根据学校id获取角色") - @GetMapping("/getRole") - public R getRole(@RequestParam Integer clientId) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("client_id", clientId); - List roleList = roleService.list(wrapper); - return R.ok().put("data", roleList); - } - - @ApiOperation(value = "根据学校id和角色名称获取角色id") - @GetMapping("/getRoleId") - public AclRole getRoleId(@RequestParam AclRole role) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("client_id", role.getClientId()).eq("role_name", role.getRoleName()); - AclRole roleId = roleService.getOne(wrapper); - return roleId; - } - - @ApiOperation(value = "新增或更新角色") - @PostMapping("/saveOrUpdate") - public R save(@RequestBody AclRole role) { - //判重 - boolean isRepeat = roleService.repeat(role); - if (isRepeat && role.getId() == null) { - return R.error("角色已存在"); - } - roleService.saveOrUpdate(role); - return R.ok().put("roleId", role.getId()); - } - - @ApiOperation(value = "删除角色") - @DeleteMapping("/remove/{id}") - public R remove(@PathVariable String id) { - boolean re = roleService.removeRolePermission(id); - boolean remove = roleService.removeById(id); - return remove ? R.ok() : R.error(); - } - - @ApiOperation(value = "批量删除角色") - @DeleteMapping("/batchRemove") - public R batchRemove(@ApiParam(name = "roleIds", value = "多个角色id", required = true) - @RequestParam("roleIds") List roleIds) { - if (roleIds != null && roleIds.size() != 0) { - boolean re = roleService.removeRolePermissions(roleIds); - boolean remove = roleService.removeByIds(roleIds); - return remove ? R.ok() : R.error(); - } else { - return R.error(); - } - } -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/SchoolClassificationController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/SchoolClassificationController.java deleted file mode 100644 index 889408b..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/SchoolClassificationController.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.huoran.occupationlab.controller; - - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.EduCourseClassification; -import com.huoran.occupationlab.service.CourseClassificationService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import java.util.List; - -/** - *

- * 前端控制器 - *

- * - * @author Cheney - * @since 2020-12-11 - */ -@Api(tags = {"企业端课程分类管理"}) -@RestController -@RequestMapping("/occupationlab/management/schoolClassification") -public class SchoolClassificationController { - - @Autowired - private CourseClassificationService courseClassificationService; - - @ApiOperation(value = "查询企业端所有分类") - @GetMapping("/queryQyClassification") - public R queryQyClassification() { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("distinguish", 1); - List classificationList = courseClassificationService.list(wrapper); - return R.ok().put("classificationList", classificationList); - } - -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/SchoolCourseController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/SchoolCourseController.java deleted file mode 100644 index a99b4b6..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/SchoolCourseController.java +++ /dev/null @@ -1,137 +0,0 @@ -package com.huoran.occupationlab.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.google.common.collect.Maps; -import com.huoran.api.UserClient; -import com.huoran.common.constant.EnableStatus; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.occupationlab.entity.SchoolCourse; -import com.huoran.occupationlab.entity.vo.CourseVO; -import com.huoran.occupationlab.service.SchoolCourseService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.HashMap; -import java.util.List; - -/** - *

- * 学校内置课程表 前端控制器 - *

- * - * @author Cheney - * @since 2020-11-30 - */ -@Api(tags = {"企业课程管理"}) -@RestController -@RequestMapping("/occupationlab/management/schoolCourse") -public class SchoolCourseController { - - @Autowired - private SchoolCourseService schoolCourseService; - @Autowired - private UserClient userClient; - - @ApiOperation(value = "企业课程列表分页条件查询") - @GetMapping("/queryCourseByCondition/{current}") - public R conditionPageList( - @ApiParam(name = "current", value = "当前页码", required = true) - @PathVariable int current, - @ApiParam(name = "name", value = "课程名称或创建人,模糊查询", required = false) - @RequestParam(value = "name", required = false) String name, - @ApiParam(name = "classificationId", value = "课程分类ID", required = false) - @RequestParam(value = "classificationId", required = false) String classificationId) { - // 每页记录数,默认为10 - int pageSize = 10; - HashMap map = Maps.newHashMap(); - map.put("current", (current - 1) * pageSize); - map.put("pageSize", pageSize); - map.put("classificationId", classificationId); - map.put("name", name); - //每页记录数 - List courseList = schoolCourseService.coursePageConditionQuery(map); - //总数 - int total = schoolCourseService.coursePageConditionCount(map); - return R.ok().put("courseList", courseList).put("total", total); - } - - @ApiOperation(value = "内置课程列表分页条件查询") - @GetMapping("/queryBuiltInCourseByCondition/{current}") - public R queryBuiltInCourseByCondition( - @ApiParam(name = "current", value = "当前页码", required = true) - @PathVariable int current, - @ApiParam(name = "schoolId", value = "学校ID") - @RequestParam(value = "schoolId") String schoolId) { - // 每页记录数,默认为10 - int pageSize = 10; - HashMap map = Maps.newHashMap(); - map.put("current", (current - 1) * pageSize); - map.put("pageSize", pageSize); - map.put("schoolId", schoolId); - //每页记录数 - List courseList = schoolCourseService.builtInCoursePageQuery(map); - //总数 - int total = schoolCourseService.builtInCoursePageCount(map); - return R.ok().put("total", total).put("courseList", courseList); - } - - @ApiOperation(value = "添加内置课程") - @PostMapping("/addBuiltInCourse") - public R addBuiltInCourse( - @ApiParam(name = "schoolId", value = "学校ID", example = "1") - @RequestParam(value = "schoolId") String schoolId, - @ApiParam(name = "courseIds", value = "课程ids") - @RequestParam(value = "courseIds") String courseIds, - @ApiParam(name = "classificationIds", value = "课程分类ids") - @RequestParam(value = "classificationIds") String classificationIds) { - boolean ok = schoolCourseService.addBuiltInCourse(schoolId, courseIds, classificationIds); - return ok ? R.ok() : R.error(); - } - - - @ApiOperation(value = "删除内置课程") - @DeleteMapping("/deleteBuiltInCourse") - public R deleteBuiltInCourse( - @ApiParam(name = "courseId", value = "课程ID", required = true) - @RequestParam String courseId, - @ApiParam(name = "schoolId", value = "学校ID", required = true) - @RequestParam String schoolId, - @ApiParam(name = "classificationId", value = "分类ID", required = true) - @RequestParam String classificationId) { - //是否删除管理端的分类,删除该课程之前如果分类数只有1时,删除该管理端的分类对应关系 - schoolCourseService.removeClassificationId(schoolId, classificationId); - //删除课程与学校的对应关系 - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("course_id", courseId).eq("school_id", schoolId); - boolean remove = schoolCourseService.remove(wrapper); - return remove ? R.ok() : R.error(); - } - - @ApiOperation(value = "是否启用管理端课程") - @PutMapping("/enableGlCourse") - public R enableGlCourse( - @ApiParam(name = "courseId", value = "课程ID", required = true) - @RequestParam String courseId, - @ApiParam(name = "isEnable", value = "isEnable", required = true) - @RequestParam String isEnable, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - if (EnableStatus.ENABLE.equals(isEnable) || EnableStatus.NOT_ACTIVATED.equals(isEnable)) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("course_id", courseId).eq("school_id", schoolId); - SchoolCourse schoolCourse = schoolCourseService.getOne(wrapper); - schoolCourse.setIsEnable(Integer.parseInt(isEnable)); - boolean update = schoolCourseService.updateById(schoolCourse); - return update ? R.ok() : R.error(); - } else { - return R.error("启用状态错误"); - } - } - -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/SchoolProjectHintOpenController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/SchoolProjectHintOpenController.java deleted file mode 100644 index 971b630..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/SchoolProjectHintOpenController.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.huoran.occupationlab.controller; - - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.api.UserClient; -import com.huoran.common.entity.ProjectManage; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.occupationlab.entity.SchoolProjectHintOpen; -import com.huoran.occupationlab.service.ProjectManageService; -import com.huoran.occupationlab.service.SchoolProjectHintOpenService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.servlet.http.HttpServletRequest; - -/** - *

- * 学校项目实验提示管理表 前端控制器 - *

- * - * @author lr - * @since 2023-06-02 - */ -@Api(tags = {"学校项目实验提示管理"}) -@RestController -@RequestMapping("/schoolProjectHintOpen") -public class SchoolProjectHintOpenController { - - @Autowired - private UserClient userClient; - - @Autowired - private SchoolProjectHintOpenService schoolProjectHintOpenService; - - @Autowired - private ProjectManageService projectManageService; - - - @ApiOperation("学校内《系统》项目实验提示禁用启用") - @PostMapping("/schoolProjectPromptsEnabled") - public R schoolProjectPromptsEnabled( - @ApiParam(value = "项目id") Integer projectId, - @ApiParam(value = "实验提示是否开启(0开启 1不开启)") Integer hintOpen, - HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - //token查询学校id - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - if (schoolId == -1) { - return R.error("学校查询失败"); - } - boolean update = false; - QueryWrapper openQueryWrapper = new QueryWrapper<>(); - openQueryWrapper.eq("school_id", schoolId); - openQueryWrapper.eq("project_id",projectId); - SchoolProjectHintOpen one = schoolProjectHintOpenService.getOne(openQueryWrapper); - if (ObjectUtil.isNotNull(one)){ - one.setHintOpen(hintOpen); - update = schoolProjectHintOpenService.updateById(one); - }else { - SchoolProjectHintOpen schoolProjectHintOpen = new SchoolProjectHintOpen(); - schoolProjectHintOpen.setSchoolId(schoolId); - schoolProjectHintOpen.setProjectId(projectId); - schoolProjectHintOpen.setHintOpen(hintOpen); - update = schoolProjectHintOpenService.save(schoolProjectHintOpen); - } - - return update ? R.ok() : R.error(); - } - - @ApiOperation("学校内《自建》项目实验提示禁用启用") - @PostMapping("/schoolCreateProjectPromptsEnabled") - public R schoolCreateProjectPromptsEnabled( - @ApiParam(value = "项目id") Integer projectId, - @ApiParam(value = "实验提示是否开启(0开启 1不开启)") Integer hintOpen) { - ProjectManage projectManage = projectManageService.getById(projectId); - projectManage.setHintOpen(hintOpen); - boolean update = projectManageService.updateById(projectManage); - return update ? R.ok() : R.error(); - } -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/StaffController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/StaffController.java deleted file mode 100644 index c391097..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/StaffController.java +++ /dev/null @@ -1,325 +0,0 @@ -package com.huoran.occupationlab.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.api.UserClient; -import com.huoran.common.constant.DelConstant; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.occupationlab.entity.Architecture; -import com.huoran.occupationlab.entity.Staff; -import com.huoran.occupationlab.entity.StaffGrade; -import com.huoran.occupationlab.entity.StaffProfessionalArchitecture; -import com.huoran.occupationlab.entity.req.AddStaffReq; -import com.huoran.occupationlab.entity.req.ModifyStaffReq; -import com.huoran.occupationlab.entity.req.PageStaffListReq; -import com.huoran.occupationlab.entity.resp.StaffResp; -import com.huoran.occupationlab.service.StaffGradeService; -import com.huoran.occupationlab.service.StaffProfessionalArchitectureService; -import com.huoran.occupationlab.service.StaffService; -import com.huoran.occupationlab.service.StudentService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - * @描述:员工组织架构 - * @作者: Rong - * @日期: 2021-10-13 - */ -@RestController -@RequestMapping("/occupationlab/staff") -@Api(value = "API - 职站:员工组织架构", tags = "职站:员工组织架构") -public class StaffController { - @Autowired - public StaffProfessionalArchitectureService architectureService; - - @Autowired - public StaffGradeService gradeService; - - @Autowired - public StaffService staffService; - - @Autowired - private UserClient userClient; - - /** - * @Description : 新增初始员工组织架构数据 - * @Param architecture - * @Param request - * @Author Rong---2021/11/11 - */ - @PostMapping("/saveStaffData") - @ApiOperation(value = "新增初始员工组织架构数据(远程调用)") - public boolean saveStaffData(Integer schoolId) { - //新增一级部门 - StaffProfessionalArchitecture dept = new StaffProfessionalArchitecture(); - dept.setSchoolId(schoolId) - .setIsDel(DelConstant.NOT_DEL) - .setStaffArchitectureName("一级部门"); - boolean ret = architectureService.save(dept); - //新增二级部门 - StaffGrade grade = new StaffGrade(); - grade.setGradeName("二级部门") - .setStaffArchitectureId(dept.getStaffArchitectureId()); - boolean ret1 = gradeService.save(grade); - return ret && ret1; - - } - - /** - * @Description : 新增专业 - * @Param architecture - * @Param request - * @Author Rong---2021/10/13 - */ - @PostMapping("/saveProfessional") - @ApiOperation(value = "新增专业") - public R saveProfessional(@RequestBody @Valid StaffProfessionalArchitecture architecture, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - architecture.setSchoolId(userClient.getSchoolIdByAccountId(accountId)) - .setIsDel(DelConstant.NOT_DEL); - if (architectureService.repeat(architecture) == false) { - boolean ret = architectureService.save(architecture); - return ret ? R.ok().put("staffArchitectureId", architecture.getStaffArchitectureId()) : R.error(); - } else { - return R.error(architecture.getStaffArchitectureName() + "一级部门已存在"); - } - - } - - /** - * @Description : 新增年级 - * @Param staffGrade - * @Param request - * @Author Rong---2021/10/13 - */ - @PostMapping("/saveGrade") - @ApiOperation(value = "新增年级") - public R saveGrade(@RequestBody @Valid StaffGrade staffGrade, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - if (gradeService.repeat(staffGrade) == false) { - boolean ret = gradeService.save(staffGrade); - return ret ? R.ok().put("gradeId", staffGrade.getGradeId()) : R.error(); - } else { - return R.error(staffGrade.getGradeName() + "二级部门已存在"); - } - - } - - /** - * @Description : 编辑专业 - * @Param architecture - * @Param request - * @Author Rong---2021/10/19 - */ - @PostMapping("/updateProfessional") - @ApiOperation(value = "编辑专业") - public R updateProfessional(@RequestBody @Valid StaffProfessionalArchitecture architecture, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - architecture.setSchoolId(userClient.getSchoolIdByAccountId(accountId)) - .setIsDel(DelConstant.NOT_DEL); - if (architectureService.repeat(architecture) == false) { - boolean ret = architectureService.updateById(architecture); - return ret ? R.ok().put("staffArchitectureId", architecture.getStaffArchitectureId()) : R.error(); - } else { - return R.error(architecture.getStaffArchitectureName() + "一级部门已存在"); - } - - } - - /** - * @Description : 编辑年级 - * @Param staffGrade - * @Param request - * @Author Rong---2021/10/19 - */ - @PostMapping("/updateGrade") - @ApiOperation(value = "编辑年级") - public R updateProfessional(@RequestBody @Valid StaffGrade staffGrade, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - if (gradeService.repeat(staffGrade) == false) { - boolean ret = gradeService.updateById(staffGrade); - return ret ? R.ok().put("gradeId", staffGrade.getGradeId()) : R.error(); - } else { - return R.error(staffGrade.getGradeName() + "二级部门已存在"); - } - - } - - /** - * @Description : 删除专业 - * @Param architecture - * @Param request - * @Author Rong---2021/10/19 - */ - @PostMapping("/deleteProfessional") - @ApiOperation(value = "删除专业") - public R deleteProfessional(@ApiParam(name = "staffArchitectureId", value = "员工专业组织架构ID", required = true) @RequestParam Integer staffArchitectureId, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - boolean delRet = architectureService.removeById(staffArchitectureId); - return delRet ? R.ok() : R.error(); - } - - /** - * @Description : 删除年级 - * @Param staffGrade - * @Param request - * @Author Rong---2021/10/19 - */ - @PostMapping("/deleteGrade") - @ApiOperation(value = "删除年级") - public R deleteGrade(@ApiParam(name = "gradeId", value = "年级id", required = true) @RequestParam Integer gradeId, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - boolean delRet = gradeService.removeById(gradeId); - return delRet ? R.ok() : R.error(); - - } - - /** - * @Description : 新增员工 - * @Param staffReq - * @Param request - * @Author Rong---2021/10/13 - */ - @PostMapping("/saveStaff") - @ApiOperation(value = "新增员工") - public R saveStaff(@RequestBody @Valid AddStaffReq staffReq, HttpServletRequest request) throws Exception { - String accountId = TokenUtils.getIdByJwtToken(request); - staffReq.setSchoolId(userClient.getSchoolIdByAccountId(accountId)) - .setAccountId(Integer.valueOf(accountId)); - return staffService.saveStaff(staffReq); - } - - /** - * @Description : 查询专业 - * @Param request - * @Author Rong---2021/10/13 - */ - @GetMapping("/professionalList") - @ApiOperation(value = "查询专业", response = StaffProfessionalArchitecture.class) - public R professionalList(HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("school_id", schoolId); - queryWrapper.eq("is_del", DelConstant.NOT_DEL); - List list = architectureService.list(queryWrapper); - return R.ok().put("data", list); - - } - - /** - * @Description : 根据专业id查询年级 - * @Param request - * @Author Rong---2021/10/13 - */ - @GetMapping("/staffGradeList") - @ApiOperation(value = "根据专业id查询年级", response = StaffGrade.class) - public R staffGradeList( - @ApiParam(name = "staffArchitectureId", value = "员工专业组织架构ID", required = true) @RequestParam Integer staffArchitectureId - , HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("staff_architecture_id", staffArchitectureId); - List list = gradeService.list(queryWrapper); - return R.ok().put("data", list); - - } - - /** - * @Description : 员工列表 - * @Param req - * @Param request - * @Author Rong---2021/10/14 - */ - @PostMapping("/staffList") - @ApiOperation(value = "员工列表", response = StaffResp.class) - public R staffList(@RequestBody @Valid PageStaffListReq req, - HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - req.setSchoolId(schoolId); - return staffService.pageStaffList(req); - } - - /** - * @Description : 员工详情 - * @Param accountId - * @Param request - * @Author Rong---2021/10/15 - */ - @GetMapping("/staffDetail") - @ApiOperation(value = "员工详情", response = StaffResp.class) - public R staffDetail(@ApiParam(name = "accountId", value = "员工账号id") @RequestParam Integer accountId, - HttpServletRequest request) { - return staffService.staffDetail(accountId); - } - - /** - * @Description : 编辑员工 - * @Param staffReq - * @Param request - * @Author Rong---2021/10/13 - */ - @PostMapping("/modifyStaff") - @ApiOperation(value = "编辑员工") - public R modifyStaff(@RequestBody @Valid ModifyStaffReq staffReq, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - return staffService.modifyStaff(staffReq, schoolId); - } - - /** - * @Description : 删除员工 - * @Param ids - * @Param request - * @Author Rong---2021/10/15 - */ - @PostMapping("/delStaff") - @ApiOperation(value = "删除员工") - public R delStaff(@ApiParam(name = "accountIds", value = "要删除的账号id") @RequestParam List accountIds, - HttpServletRequest request) { - return staffService.delStaff(accountIds); - } - - /** - * @Description : 批量导入员工 - * @Param file - * @Param request - * @Author Rong---2021/10/15 - */ - @PostMapping("/importStaff") - @ApiOperation("批量导入员工") - public R importStaff(@RequestParam(name = "file") MultipartFile file, HttpServletRequest request) throws IOException { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - Map map = staffService.importStaff(file, schoolId); - return R.ok().put("data", map); - } - - /** - * 批量导入员工失败数据导出 - * - * @param response - * @param exportCode - * @throws Exception - */ - @ApiOperation(value = "批量导入员工失败数据导出") - @GetMapping("/exportFailure") - public void exportFailureRecord(HttpServletResponse response, @ApiParam(name = "exportCode", value = "importQuestion接口返回的exportCode", required = true) @RequestParam String exportCode) throws Exception { - staffService.exportFailureRecord(response, exportCode); - } - -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/StudentArchitectureController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/StudentArchitectureController.java deleted file mode 100644 index f4084a1..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/StudentArchitectureController.java +++ /dev/null @@ -1,863 +0,0 @@ -package com.huoran.occupationlab.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; -import com.google.common.collect.Maps; -import com.huoran.common.constant.DelConstant; -import com.huoran.common.entity.Student; -import com.huoran.common.entity.UserAccount; -import com.huoran.common.entity.UserInfo; -import com.huoran.common.response.R; -import com.huoran.common.utils.MD5; -import com.huoran.common.utils.TokenUtils; -import com.huoran.occupationlab.entity.*; -import com.huoran.occupationlab.entity.Class; -import com.huoran.occupationlab.entity.req.*; -import com.huoran.occupationlab.entity.resp.StudentInfoResp; -import com.huoran.api.UserClient; -import com.huoran.occupationlab.service.ArchitectureService; -import com.huoran.occupationlab.service.ClassService; -import com.huoran.occupationlab.service.StudentService; -import com.huoran.common.utils.DateUtil; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; -import java.io.IOException; -import java.util.*; - -/** - *

- * 学生组织架构 - *

- * - * @author lr - * @since 2021-08-24 - */ -@RestController -@RequestMapping("/occupationlab/architecture") -@Api(value = "职站:学生组织架构相关", tags = "职站:学生组织架构相关") -public class StudentArchitectureController { - @Autowired - public ArchitectureService service; - @Autowired - public StudentService studentService; - @Autowired - private UserClient userClient; - - @Autowired - public ClassService classService; - @Autowired - private StringRedisTemplate redisTemplate; - - /** - * 新增组织架构 - * - * @param req - * @return - */ - @PostMapping("/save") - @ApiOperation(value = "新增") - public R save(@RequestBody @Valid AddArchitectureReq req, HttpServletRequest request) { - Architecture architecture = new Architecture(); - BeanUtils.copyProperties(req, architecture); - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - architecture.setSchoolId(schoolId); - - boolean ret = false; - //层级为3时候表示新增到班级表 - if (req.getLevel() == 3) { - //新增前校验同级下是否存在重复的 - List classList = classService.chenckReapt(new Class().setArchitectureId(req.getParentId()) - .setClassName(req.getOrganizationName())); - if (classList.size() > 0) { - return R.error("同级下已存在相同的名称:" + req.getOrganizationName()); - } - - ret = classService.save(new Class().setArchitectureId(req.getParentId()) - .setClassName(req.getOrganizationName())); - - return ret ? R.ok().put("id", architecture.getId()) : R.error(); - } else if (req.getLevel() == 1) { - //为1时候 表示新增专业 - architecture.setParentId(schoolId); - } - - List architectureList = service.chenckReapt(architecture); - if (architectureList.size() > 0) { - return R.error("同级下已存在相同的名称:" + req.getOrganizationName()); - } - ret = service.save(architecture); - return ret ? R.ok().put("id", architecture.getId()) : R.error(); - - } - - /** - * 编辑组织架构 - * - * @param architecture - * @return - */ - @PostMapping("/update") - @ApiOperation(value = "编辑组织架构") - public R update(@RequestBody @Valid Architecture architecture, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - architecture.setSchoolId(schoolId); - boolean ret = false; - if (architecture.getLevel() == 3) { - //新增前校验同级下是否存在重复的 - Class cla = new Class().setArchitectureId(architecture.getParentId()) - .setClassName(architecture.getOrganizationName()); - if (architecture.getId() != null) { - cla.setId(architecture.getId()); - } - List classList = classService.chenckReapt(cla); - if (classList.size() > 0) { - return R.error("同级下已存在相同的名称:" + architecture.getOrganizationName()); - } - - ret = classService.updateById(new Class().setClassName(architecture.getOrganizationName()) - .setId(architecture.getId()) - .setArchitectureId(architecture.getParentId())); - return ret ? R.ok().put("id", architecture.getId()) : R.error(); - } else { - - List architectureList = service.chenckReapt(architecture); - if (architectureList.size() > 0) { - return R.error("同级下已存在相同的名称:" + architecture.getOrganizationName()); - } - - ret = service.updateById(architecture); - } - return ret ? R.ok() : R.error(); - } - - /** - * 删除组织架构 - * - * @param id - * @return - */ - @PostMapping("/delete") - @ApiOperation(value = "删除组织架构") - public R delete(@ApiParam(name = "id", value = "架构id", required = true) @RequestParam Integer id, - @ApiParam(name = "level", value = "等级", required = true) @RequestParam Integer level) { - - //level : 1表示专业 2表示年级 - switch (level) { - //将parent_id为要删除的id的表示存在该专业下的年级 需要下面的年级、班级做删除操作 - case 1: - QueryWrapper queryWrapper1 = new QueryWrapper<>(); - queryWrapper1.eq("parent_id", id); - List list = service.list(queryWrapper1); - - //list获取到所有该专业下的年级 同时需要将年级全部删除以及年级下的班级 以及学生表的班级id包含了该班级需遍历后删除 - for (Architecture delGrade : list) { - service.removeById(delGrade);//这里执行的是删除专业下的年级 - - //查询年级下的班级 - QueryWrapper queryWrapper2 = new QueryWrapper<>(); - queryWrapper2.eq("architecture_id", delGrade.getId()); - List list1 = classService.list(queryWrapper2); - for (Class delClass : list1) { - classService.removeById(delClass);//这里执行的是删除班级操作 - //删除班级的同时将学生表包含该班级id的也删除 - - QueryWrapper queryWrapper3 = new QueryWrapper<>(); - queryWrapper3.eq("is_del", DelConstant.NOT_DEL); - queryWrapper3.last(" and find_in_set(" + delClass.getId() + ",class_id)"); - List studentList = studentService.list(queryWrapper3); - - for (Student student : studentList) { - String classIdStr = "";//用来拼接未删除的班级id的 - //循环将包含该班级id的学生表中的classId遍历出来且删除 - for (String classId : student.getClassId().split(",")) { - - if (classId.equals("")) { - continue; - } - if (Integer.valueOf(classId) != delClass.getId()) { - classIdStr += delClass.getId() + ","; - } - } - - //将遍历删除后的classId再塞回去 - UpdateWrapper updateWrapper = new UpdateWrapper<>(); - if (!classIdStr.equals("")) { - updateWrapper.set("class_id", classIdStr); - } else { - updateWrapper.set("class_id", 1); - } - - updateWrapper.eq("id", student.getId()); - studentService.update(new Student(), updateWrapper); - } - - } - - } - //执行删除操作 - service.removeById(id); - - break; - case 2: - //查询年级下的班级 - QueryWrapper queryWrapper3 = new QueryWrapper<>(); - queryWrapper3.eq("architecture_id", id); - List list3 = classService.list(queryWrapper3); - for (Class delClass : list3) { - classService.removeById(delClass);//这里执行的是删除班级操作 - //删除班级的同时将学生表包含该班级id的也删除 - - QueryWrapper queryWrapper4 = new QueryWrapper<>(); - queryWrapper4.eq("is_del", DelConstant.NOT_DEL); - queryWrapper4.last(" and find_in_set(" + delClass.getId() + ",class_id)"); - List studentList = studentService.list(queryWrapper4); - String classIdStr = "";//用来拼接未删除的班级id的 - for (Student student : studentList) { - //循环将包含该班级id的学生表中的classId遍历出来且删除 - for (String classId : student.getClassId().split(",")) { - - if (classId.equals("")) { - continue; - } - if (Integer.valueOf(classId) != delClass.getId()) { - classIdStr += delClass.getId() + ","; - } - } - - //将遍历删除后的classId再塞回去 - UpdateWrapper updateWrapper = new UpdateWrapper<>(); - if (!classIdStr.equals("")) { - updateWrapper.set("class_id", classIdStr); - } else { - updateWrapper.set("class_id", 1); - } - updateWrapper.eq("id", student.getId()); - studentService.update(new Student(), updateWrapper); - } - - } - //执行删除操作 - service.removeById(id); - - break; - case 3: - classService.removeById(id);//这里执行的是删除班级操作 - QueryWrapper queryWrapper4 = new QueryWrapper<>(); - queryWrapper4.eq("is_del", DelConstant.NOT_DEL); - queryWrapper4.last(" and find_in_set(" + id + ",class_id)"); - List studentList = studentService.list(queryWrapper4); - - if (studentList != null) { - String classIdStr = "";//用来拼接未删除的班级id的 - for (Student student : studentList) { - //循环将包含该班级id的学生表中的classId遍历出来且删除 - for (String classId : student.getClassId().split(",")) { - if (classId.equals("")) { - continue; - } - if (Integer.valueOf(classId) != id) { - classIdStr += id + ","; - } - } - - //将遍历删除后的classId再塞回去 - UpdateWrapper updateWrapper = new UpdateWrapper<>(); - if (!classIdStr.equals("")) { - updateWrapper.set("class_id", classIdStr); - } else { - updateWrapper.set("class_id", 1); - } - updateWrapper.eq("id", student.getId()); - studentService.update(new Student(), updateWrapper); - } - break; - } - } - - return R.ok(); - } - - // set 集合特点,存储元素唯一,不重复 - public static String stringSet(String s) { - - // 创建set集合 - Set set = new HashSet(); - // for循环,遍历字符串 - for (int i = 0; i < s.length(); i++) { - // 将字符串添加到Set集合中 - // s.substring(0,1)截取字符串s,位置从0到1,左闭右开 - set.add(s.substring(i, i + 1)); - } - // 定义一个空的字符串ss - String ss = ""; - // foreach遍历set集合 - for (Object o : set) { - // 字符串拼接 - ss += o; - } - // 输出去重后的字符串 - //System.out.println(ss); - return ss; - - } - - public static void main(String[] args) { - stringSet("106,106,106,106,106,106,"); - } - - /** - * 学生组织架构树形列表 - * - * @param request - * @return - */ - @PostMapping("/treeList") - @ApiOperation(value = "学生组织架构树形列表", response = Architecture.class) - public R treeList(HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - List list = service.treeList(schoolId); - return R.ok().put("treeList", list); - - } - - /** - * 学生组织架构树 - * - * @param request - * @return - */ - @PostMapping("/stuOrganizationTree") - @ApiOperation(value = "学生组织架构树", response = Architecture.class) - public R stuOrganizationTree(HttpServletRequest request, - @ApiParam(name = "level", value = "层级(专业1、年级2、班级3)", required = true) @RequestParam String level - , @ApiParam(name = "parentId", value = "父id(层级为1时候不用传)") @RequestParam Integer parentId) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - - return service.stuOrganizationTree(schoolId, Integer.valueOf(accountId), Integer.valueOf(level), parentId); - } - - /** - * 新增学生 - * - * @param addStudentReq - * @return - */ - @PostMapping("/addStudent") - @ApiOperation(value = "新增学生") - public R addStudent(@RequestBody @Valid AddStudentReq addStudentReq, HttpServletRequest request) { - //根据token获取账号id - String accountId = TokenUtils.getIdByJwtToken(request); - //根据账号id获取当前院校 - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - addStudentReq.setSchoolId(schoolId); - - //22.4.13补充: 学号判重依据学校id、平台端(教师、学生端、无端(数据平台的用户)) 以及 平台来源(职站、数据平台) - //22.4.13补充: 账号组成条件:平台(职站/数据平台/中台)-端(教师、学生端、无端(数据平台的用户))-学校(学校id)-学号/工号(用户输入的工号学号) - UserInfo userInfo = new UserInfo(); - userInfo.setSchoolId(schoolId); - userInfo.setRoleId("0"); - BeanUtils.copyProperties(addStudentReq, userInfo); - boolean addUserRet = studentService.addUserInfo(userInfo); - - UserAccount account = new UserAccount(); - account.setSchoolId(schoolId); - account.setPassword(MD5.encrypt("1122aa")); - account.setPlatformId("1");//所属平台id 1.职站 - account.setType(1);//平台端区分:0->教师端 1->学生端 2->无端 - account.setUserId(userInfo.getUserId()); - account.setRoleId("0"); - BeanUtils.copyProperties(addStudentReq, account); - - account.setPhone(null); - if (!addStudentReq.getPhone().equals("")) { - account.setPhone(addStudentReq.getPhone()); - account.setPhoneBindingTime(DateUtil.currentDate()); - } - boolean addAccountRet = studentService.addUserAccount(account); - - Student student = new Student(); - student.setAccountId(account.getId()); - BeanUtils.copyProperties(addStudentReq, student); - if (student.getClassId().equals("")) { - student.setClassId("1"); - } - - boolean addStuRet = studentService.save(student); - return addStuRet && addUserRet && addAccountRet ? R.ok().put("id", student.getId()) : R.error(); - } - - /** - * 按学号获取详细信息 - * - * @param workNumber - * @param platformId - * @param type - * @return - */ - @PostMapping("/getDetailByAccount") - @ApiOperation(value = "新增用户前调用:按学号获取详细信息", response = StudentInfoResp.class) - public R getDetailByAccount(HttpServletRequest request, @ApiParam(name = "workNumber", value = "输入的学生学号", required = true) @RequestParam String workNumber, - @ApiParam(name = "platformId", value = "所属平台id(1.职站 2.数据平台 3.中台)", required = true) @RequestParam Integer platformId, - @ApiParam(name = "type", value = "平台端区分:0教师 1学生 2无端", required = true) @RequestParam Integer type) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - HashMap objectObjectHashMap = Maps.newHashMap(); - objectObjectHashMap.put("workNumber", workNumber); - objectObjectHashMap.put("schoolId", schoolId); - objectObjectHashMap.put("platformId", platformId); - objectObjectHashMap.put("type", type); - //根据账号获取到账号信息 - StudentInfoResp studentInfoResp = studentService.getStudentInfoDetailByWorkNum(objectObjectHashMap); - - if (studentInfoResp != null) { - //获取学生中的classId - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("is_del", DelConstant.NOT_DEL); - queryWrapper.eq("account_id", studentInfoResp.getAccountId()); - Student student = studentService.getOne(queryWrapper); - - if (student != null) { - - List classList = new ArrayList<>(); - - for (String classId : student.getClassId().split(",")) { - //获取student中的classId后查询class表 - QueryWrapper classQueryWrapper = new QueryWrapper<>(); - classQueryWrapper.eq("is_del", DelConstant.NOT_DEL); - classQueryWrapper.eq("id", Integer.valueOf(classId)); - //获取到班级信息 - Class classes = classService.getOne(classQueryWrapper); - - classList.add(classes); - } - studentInfoResp.setClassList(classList); - - } - } - - return R.ok().put("data", studentInfoResp); - - } - - /** - * 新增学生前:校验手机号或者邮箱 - * - * @param phone - * @param email - * @return - */ - /* @PostMapping("/checkEmailOrPhone") - @ApiOperation(value = "新增学生前:校验手机号或者邮箱", response = Architecture.class) - public R checkEmailAndPhone(@ApiParam(name = "phone", value = "手机号(一次校验只传一个参数)", required = false) @RequestParam(required = false) String phone, - @ApiParam(name = "email", value = "邮 箱(一次校验只传一个参数)", required = false) @RequestParam(required = false) String email - , @ApiParam(name = "accountId", value = "编辑传:被编辑用户的账号id") @RequestParam(value = "accountId", required = false) Integer accountId) { - - UserInfo userInfo = new UserInfo(); - userInfo.setEmail(email); - userInfo.setPhone(phone); - if (accountId != null) { - Integer userId = studentService.getUserId(accountId); - userInfo.setUserId(userId); - } - List user = studentService.checkUserInfo(userInfo); - - String msg = ""; - if (user.size() > 0) { - if (phone != null && !phone.equals("")) { - msg = "该手机号已存在!"; - } else if (email != null && !email.equals("")) { - msg = "该Email已存在!"; - } - - return R.error(msg); - } - return R.ok(); - }*/ - - /** - * 学生列表 - * - * @param request - * @return - */ - @PostMapping("/studentList") - @ApiOperation(value = "学生列表", response = StudentInfoResp.class) - public R StudentList(@RequestBody PageStudentListReq req, - HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - req.setSchoolId(schoolId); - req.setAccountId(Integer.valueOf(accountId)); - List list = studentService.studentList(req); - return R.ok().put("page", list).put("total", studentService.studentListNum(req)); - } - - /** - * 将学生移除班级 - * - * @param request - * @param classId - * @param stuAccountId - * @return - */ - @PostMapping("/removeStudent") - @ApiOperation(value = "移除学生", response = StudentInfoResp.class) - public R removeStudent(HttpServletRequest request, @ApiParam(name = "classId", value = "要移除的班级id", required = true) @RequestParam String classId, - @ApiParam(name = "stuAccountId", value = "要移除的学生账号id", required = true) @RequestParam String stuAccountId) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("is_del", DelConstant.NOT_DEL); - queryWrapper.eq("account_id", stuAccountId); - - String removeId = ""; - - Student student = studentService.getOne(queryWrapper); - if (student.getClassId().contains(",")) { - for (String id : student.getClassId().split(",")) { - if (!id.equals(classId)) { - //循环的id不等于要移除的id时保存该id - removeId += id + ","; - } - } - removeId = removeId.substring(0, removeId.length() - 1); - } else { - removeId = "1"; - } - - UpdateWrapper updateWrapper = new UpdateWrapper<>(); - updateWrapper.set("class_id", removeId); - updateWrapper.set("school_id", schoolId); - updateWrapper.eq("account_id", stuAccountId); - updateWrapper.eq("is_del", DelConstant.NOT_DEL); - boolean ret = studentService.update(new Student(), updateWrapper); - return ret ? R.ok() : R.error(); - } - - /** - * 单个、批量删除学生 - * - * @param accountIds - * @param request - * @return - */ - @PostMapping("/delStudent") - @ApiOperation(value = "单个、批量删除学生", response = StudentInfoResp.class) - public R delStudent(@ApiParam(name = "accountIds", value = "多个账号id", required = true) @RequestParam("accountIds") List accountIds, HttpServletRequest request - ) { - - boolean ret = false; - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - if (accountIds != null && accountIds.size() != 0) { - for (Integer stuAccountId : accountIds) { - //修改学生表删除状态为已删除 同时班级id设置为1表示无指定班级 - UpdateWrapper updateWrapper = new UpdateWrapper<>(); - //updateWrapper.set("class_id", 1); - updateWrapper.set("school_id", schoolId); - updateWrapper.set("is_del", DelConstant.IS_DEL); - updateWrapper.eq("account_id", stuAccountId); - ret = studentService.update(new Student(), updateWrapper); - } - - //修改账号表逻辑删除状态 修改用户表逻辑删除状态 - //22.04.15补充: - // 教师管理端的学生管理或员工管理进行删除的操作时, - // 如果手机号绑定了多个用户的信息则只是删除了该账号在这个平台(职站,或数据平台)对应端的用户信息(同时该账号也与该学校组织对应端解绑了) - // 不是真的把账号删除,但是如果手机号有且只有一个用户信息则一并把该账号进行删除。 - - //执行删除账号、用户信息表 - userClient.delStudent(accountIds); - } - return ret ? R.ok() : R.error(); - } - - /** - * 编辑学生 - * - * @param modifyStudentReq - * @return - */ - @PostMapping("/modifyStudent") - @ApiOperation(value = "编辑学生") - public R modifyStudent(@RequestBody @Valid ModifyStudentReq modifyStudentReq, HttpServletRequest request) { - - - //账户信息 - UserAccount userAccount = new UserAccount(); - userAccount.setId(modifyStudentReq.getAccountId()); - BeanUtils.copyProperties(modifyStudentReq, userAccount); - boolean updateUserAccount = studentService.modifyUserAccount(userAccount); - - //用户信息 - UserInfo userInfo = new UserInfo(); - userInfo.setUserId(userInfo.getUserId()); - BeanUtils.copyProperties(modifyStudentReq, userInfo); - boolean updateUserInfo = studentService.modifyUserInfo(userInfo); - - //学生信息 - UpdateWrapper updateWrapper = new UpdateWrapper<>(); - updateWrapper.set("class_id", modifyStudentReq.getClassId()); - updateWrapper.eq("is_del", DelConstant.NOT_DEL); - updateWrapper.eq("account_id", modifyStudentReq.getAccountId()); - boolean updateStu = studentService.update(new Student(), updateWrapper); - - return updateUserAccount && updateUserInfo && updateStu ? R.ok() : R.error(); - } - - /** - * 新增/编辑账号前:校验(学号/工号)或者账号 - * 学号、工号通过分平台id、学校id以及平台端区分 - * (账号)全平台校验 - * - * @param workNumber - * @param account - * @return - */ - @PostMapping("/checkWorkNumOrAccount") - @ApiOperation(value = "新增/编辑账号前:校验(学号/工号) 或者(账号)全平台校验", response = Architecture.class) - public R checkWorkNumOrAccount(@ApiParam(name = "workNumber", value = "学号/工号(一次校验只传一个参数)") @RequestParam(value = "workNumber", required = false) String workNumber, - @ApiParam(name = "account", value = "账号(一次校验只传一个参数)") @RequestParam(value = "account", required = false) String account, - @ApiParam(name = "accountId", value = "编辑传:被编辑用户的账号id") @RequestParam(value = "accountId", required = false) Integer accountId, - @ApiParam(name = "platformId", value = "必填:所属平台id 1.职站 2数据平台 3中台", required = true) @RequestParam(value = "platformId", required = true) Integer platformId, - @ApiParam(name = "type", value = "必填:平台端区分:0->教师端 1->学生端 2->无端", required = true) @RequestParam(value = "type", required = true) Integer type, - HttpServletRequest request) { - - String accId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accId); - UserAccount userAccount = new UserAccount(); - userAccount.setAccount(account); - userAccount.setWorkNumber(workNumber); - userAccount.setSchoolId(schoolId); - userAccount.setType(type); - userAccount.setPlatformId(platformId + ""); - if (accountId != null) { - userAccount.setId(accountId); - } - - List user = studentService.checkUserAccount(userAccount); - - String msg = ""; - if (user.size() > 0) { - if (workNumber != null && !workNumber.equals("")) { - msg = "工号/学号已存在!"; - } else if (account != null && !account.equals("")) { - msg = "账号已存在!"; - } - - return R.error(msg); - } - return R.ok(); - } - - /** - * 查看学生信息 - * - * @param stuAccountId - * @return - */ - @PostMapping("/getStudentInfoByAccountId") - @ApiOperation(value = "查看学生信息", response = StudentInfoResp.class) - public R getStudentInfoByAccountId(@ApiParam(name = "stuAccountId", value = "要查看的学生账号id", required = true) @RequestParam Integer stuAccountId, HttpServletRequest request) { - StudentInfoResp data = studentService.getStudentInfoByAccountId(stuAccountId); - return R.ok().put("data", data); - } - - /** - * 批量导入学生 - * - * @param file - * @param request - * @return - * @throws IOException - */ - @PostMapping("/importStudent") - @ApiOperation("批量导入学生") - public R importStudent(@RequestParam(name = "file") MultipartFile file, HttpServletRequest request) throws IOException { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - Map map = studentService.uploadStudent(file, schoolId); - return R.ok().put("data", map); - } - - /** - * 批量导入学生失败数据导出 - * - * @param response - * @param exportCode - * @throws Exception - */ - @ApiOperation(value = "批量导入学生失败数据导出") - @GetMapping("/exportFailure") - public void exportFailureRecord(HttpServletResponse response, @ApiParam(name = "exportCode", value = "importQuestion接口返回的exportCode", required = true) @RequestParam String exportCode) throws Exception { - studentService.exportFailureRecord(response, exportCode); - } - - /** - * 根据组织架构筛选学生列表 - * - * @param request - * @return - */ - @PostMapping("/organizationalStudentList") - @ApiOperation(value = "根据组织架构筛选学生列表", response = StudentInfoResp.class) - public R organizationalStudentList(@RequestBody OrganizationStudentReq req, - HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - req.setSchoolId(schoolId); - req.setPageNum((req.getPageNum() - 1) * req.getPageSize()); - req.setPageSize(req.getPageSize()); - List list = new ArrayList<>(); - Set allList = new HashSet<>(); - //1.专业 2.年级 3.班级 - switch (req.getLevel()) { - case 1: - //选择专业时 - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("school_id", schoolId); - queryWrapper.eq("parent_id", req.getArchitectureId()); - queryWrapper.eq("level", req.getLevel() + 1); - List getGrade = service.list(queryWrapper); - //获取到所有该专业下的年级 - for (Architecture architecture : getGrade) { - QueryWrapper classQueryWrapper = new QueryWrapper<>(); - classQueryWrapper.eq("architecture_id", architecture.getId()); - //获取到所有班级id - List getClass = classService.list(classQueryWrapper); - if (getClass.size() == 0) { - continue; - } - req.setClassList(getClass); - - list = studentService.organizationalStudentList(req); - allList.addAll(list); - } - - return R.ok().put("page", allList).put("total", allList.size()); - - case 2: - //选择年级时 - QueryWrapper classQueryWrapper = new QueryWrapper<>(); - classQueryWrapper.eq("architecture_id", req.getArchitectureId()); - List getClass = classService.list(classQueryWrapper); - req.setClassList(getClass); - list = studentService.organizationalStudentList(req); - if (getClass.size() == 0) { - return R.ok().put("total", 0); - } - return R.ok().put("page", list).put("total", studentService.organizationalStudentListNum(req)); - - case 3: - List classList = new ArrayList<>(); - Class classes = new Class(); - classes.setId(req.getArchitectureId()); - classList.add(classes); - req.setClassList(classList); - - list = studentService.organizationalStudentList(req); - return R.ok().put("page", list).put("total", studentService.organizationalStudentListNum(req)); - - } - return R.ok(); - - } - - /** - * 修改账号禁用启用功能 - * - * @param id - * @param isEnable - * @return - */ - @ApiOperation(value = "修改账号禁用启用功能") - @GetMapping("/updateAccountEnable") - public R updateAccountEnable(@RequestParam("id") @ApiParam(value = "账号id") Integer id, - @RequestParam("isEnable") @ApiParam(value = "是否禁用(0->禁用,1->启用") Integer isEnable) { - int result = studentService.updateAccountEnable(id, isEnable); - return result > 0 ? R.ok() : R.error(); - } - - /** - * @Description :新增初始学生组织架构数据 - * @Param architecture - * @Author Rong---2021/11/2 - */ - @PostMapping("/saveData") - @ApiOperation(value = "新增初始学生组织架构数据(远程调用)") - public boolean saveData(@RequestParam("schoolId") @ApiParam(value = "学校id") Integer schoolId) { - - //新增专业 - Architecture addProfessional1 = new Architecture() - .setOrganizationName("金融专业") - .setLevel(1) - .setParentId(schoolId) - .setSchoolId(schoolId); - boolean ret1 = service.save(addProfessional1); - - Architecture addProfessional2 = new Architecture() - .setOrganizationName("金融工程专业") - .setLevel(1) - .setParentId(schoolId) - .setSchoolId(schoolId); - boolean ret2 = service.save(addProfessional2); - - Architecture addProfessional3 = new Architecture() - .setOrganizationName("金融科技专业") - .setLevel(1) - .setParentId(schoolId) - .setSchoolId(schoolId); - boolean ret3 = service.save(addProfessional3); - - //新增年级 - Architecture addGrade1 = new Architecture() - .setOrganizationName("2021级") - .setLevel(2) - .setParentId(addProfessional1.getId()) - .setSchoolId(schoolId); - boolean ret4 = service.save(addGrade1); - - Architecture addGrade2 = new Architecture() - .setOrganizationName("2021级") - .setLevel(2) - .setParentId(addProfessional2.getId()) - .setSchoolId(schoolId); - boolean ret5 = service.save(addGrade2); - - Architecture addGrade3 = new Architecture() - .setOrganizationName("2021级") - .setLevel(2) - .setParentId(addProfessional3.getId()) - .setSchoolId(schoolId); - boolean ret6 = service.save(addGrade3); - - //新增班级 - boolean ret7 = classService.save(new Class().setArchitectureId(addGrade1.getId()) - .setClassName("一班")); - - boolean ret8 = classService.save(new Class().setArchitectureId(addGrade2.getId()) - .setClassName("一班")); - - boolean ret9 = classService.save(new Class().setArchitectureId(addGrade3.getId()) - .setClassName("一班")); - - return ret1 && ret2 && ret3 && ret4 && ret5 && ret6 && ret7 && ret8 && ret9; - - } -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/StudentController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/StudentController.java deleted file mode 100644 index 53fdfd4..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/StudentController.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.huoran.occupationlab.controller; - - -import com.huoran.occupationlab.service.StudentService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; - -/** - *

- * 学生表 前端控制器 - *

- * - * @author Mr.JK - * @since 2021-11-03 - */ -@RestController -@RequestMapping("/occupationlab/student") -public class StudentController { - - @Autowired - private StudentService studentService; - -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/SysJobController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/SysJobController.java deleted file mode 100644 index 4d1c92b..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/SysJobController.java +++ /dev/null @@ -1,159 +0,0 @@ -//package com.huoran.occupationlab.controller; -// -//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -//import com.baomidou.mybatisplus.core.metadata.IPage; -//import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -//import com.huoran.common.aop.annotation.LogAnnotation; -//import com.huoran.common.response.R; -//import com.huoran.occupationlab.entity.SysJob; -//import com.huoran.occupationlab.entity.req.PageSysJobReq; -//import com.huoran.occupationlab.job.utils.ScheduleJob; -//import com.huoran.occupationlab.service.SysJobService; -//import io.swagger.annotations.Api; -//import io.swagger.annotations.ApiOperation; -//import io.swagger.annotations.ApiParam; -//import org.apache.shiro.authz.annotation.RequiresPermissions; -//import org.quartz.TriggerUtils; -//import org.quartz.impl.triggers.CronTriggerImpl; -//import org.springframework.util.StringUtils; -//import org.springframework.web.bind.annotation.*; -// -//import javax.annotation.Resource; -//import java.text.ParseException; -//import java.text.SimpleDateFormat; -//import java.util.ArrayList; -//import java.util.Date; -//import java.util.List; -// -// -///** -// * 定时任务 -// * @author cheney -// * @version V1.0 -// * @date 2022年7月28日 -// */ -// -//@Api(tags = "定时任务") -//@RestController -//@RequestMapping("/sysJob") -//public class SysJobController { -// @Resource -// private SysJobService sysJobService; -// -// @ApiOperation(value = "新增") -// @PostMapping("/add") -// public R add(@RequestBody SysJob sysJob) { -// if (isValidExpression(sysJob.getCronExpression())) { -// return R.error("cron表达式有误"); -// } -// ScheduleJob.judgeBean(sysJob.getBeanName()); -// -// sysJobService.saveJob(sysJob); -// return R.ok(); -// } -// -// @ApiOperation(value = "删除") -// @DeleteMapping("/delete") -// public R delete(@RequestBody @ApiParam(value = "id集合") List ids) { -// sysJobService.delete(ids); -// return R.ok(); -// } -// -// @ApiOperation(value = "更新") -// @PutMapping("/update") -// public R update(@RequestBody SysJob sysJob) { -// if (isValidExpression(sysJob.getCronExpression())) { -// return R.error("cron表达式有误"); -// } -// R R = ScheduleJob.judgeBean(sysJob.getBeanName()); -// -// sysJobService.updateJobById(sysJob); -// return R.ok(); -// } -// -// @ApiOperation(value = "查询分页数据") -// @PostMapping("/listByPage") -// public R findListByPage(@RequestBody PageSysJobReq req) { -// QueryWrapper queryWrapper = new QueryWrapper<>(); -// -// //查询条件示例 -// if (!StringUtils.isEmpty(req.getBeanName())) { -// queryWrapper.like("bean_name", req.getBeanName()); -// } -// Page page = new Page(req.getPageNum(), req.getPageSize()); -// IPage iPage = sysJobService.page(page, queryWrapper); -// return R.ok(iPage); -// } -// -// -// /** -// * 立即执行任务 -// */ -// -// @ApiOperation(value = "立即执行任务") -// @PostMapping("/run") -// public R run(@RequestBody List ids) { -// sysJobService.run(ids); -// return R.ok(); -// } -// -// /** -// * 暂停定时任务 -// */ -// @ApiOperation(value = "暂停定时任务") -// @LogAnnotation(title = "暂停定时任务") -// @PostMapping("/pause") -// @RequiresPermissions("sysJob:pause") -// public R pause(@RequestBody List ids) { -// sysJobService.pause(ids); -// return R.ok(); -// } -// -// /** -// * 恢复定时任务 -// */ -// @ApiOperation(value = "恢复定时任务") -// @PostMapping("/resume") -// public R resume(@RequestBody List ids) { -// sysJobService.resume(ids); -// return R.ok(); -// } -// -// /** -// * 判断cron表达式 -// * -// * @param cronExpression cron表达式 -// * @return 是否有误 -// */ -// public static boolean isValidExpression(String cronExpression) { -// CronTriggerImpl trigger = new CronTriggerImpl(); -// try { -// trigger.setCronExpression(cronExpression); -// Date date = trigger.computeFirstFireTime(null); -// return date == null || !date.after(new Date()); -// } catch (Exception e) { -// return true; -// } -// } -// -// -// @ApiOperation(value = "获取运行时间") -// @PostMapping("/getRecentTriggerTime") -// public R getRecentTriggerTime(String cron) { -// List list = new ArrayList<>(); -// try { -// CronTriggerImpl cronTriggerImpl = new CronTriggerImpl(); -// cronTriggerImpl.setCronExpression(cron); -// // 这个是重点,一行代码搞定 -// List dates = TriggerUtils.computeFireTimes(cronTriggerImpl, null, 5); -// SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); -// for (Date date : dates) { -// list.add(dateFormat.format(date)); -// } -// } catch (ParseException e) { -// e.printStackTrace(); -// } -// return R.ok(list); -// } -// -//} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/SysJobLogController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/SysJobLogController.java deleted file mode 100644 index 6bd5870..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/SysJobLogController.java +++ /dev/null @@ -1,61 +0,0 @@ -//package com.huoran.occupationlab.controller; -// -//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -//import com.baomidou.mybatisplus.core.metadata.IPage; -//import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -//import com.huoran.common.aop.annotation.LogAnnotation; -//import com.huoran.common.response.R; -//import com.huoran.occupationlab.entity.SysJobLog; -//import com.huoran.occupationlab.entity.req.PageSysJobLogReq; -//import com.huoran.occupationlab.service.SysJobLogService; -//import io.swagger.annotations.Api; -//import io.swagger.annotations.ApiOperation; -//import org.apache.shiro.authz.annotation.RequiresPermissions; -//import org.springframework.util.StringUtils; -//import org.springframework.web.bind.annotation.*; -// -//import javax.annotation.Resource; -// -// -///** -// * 定时任务日志 -// * -// * @author cheney -// * @version V1.0 -// * @date 2022年7月28日 -// */ -// -//@Api(tags = "定时任务日志") -//@RestController -//@RequestMapping("/sysJobLog") -//public class SysJobLogController { -// @Resource -// private SysJobLogService sysJobLogService; -// -// @ApiOperation(value = "查询分页数据") -// @PostMapping("/listByPage") -// @RequiresPermissions("sysJob:list") -// public R findListByPage(@RequestBody PageSysJobLogReq req) { -// QueryWrapper queryWrapper = new QueryWrapper<>(); -// //查询条件示例 -// if (!StringUtils.isEmpty(req.getJobId())) { -// queryWrapper.like("job_id", req.getJobId()); -// } -// queryWrapper.orderByDesc("create_time"); -// -// -// Page page = new Page(req.getPageNum(), req.getPageSize()); -// IPage iPage = sysJobLogService.page(page, queryWrapper); -// return R.ok(iPage); -// } -// -// @ApiOperation(value = "清空定时任务日志") -// @DeleteMapping("/delete") -// @RequiresPermissions("sysJob:delete") -// @LogAnnotation(title = "清空") -// public R delete() { -// sysJobLogService.remove(null); -// return R.ok(); -// } -// -//} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/SysLogController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/SysLogController.java deleted file mode 100644 index 4a47b90..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/SysLogController.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.huoran.occupationlab.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.huoran.api.NakadaiClient; -import com.huoran.common.aop.annotation.LogAnnotation; -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.SysLog; -import com.huoran.occupationlab.entity.req.PageSysLogReq; -import com.huoran.occupationlab.service.LogService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.util.ObjectUtils; -import org.springframework.util.StringUtils; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 系统操作日志 - * - * @author cheney - * @version V1.0 - * @date 2022年7月28日 - */ - -@RequestMapping("/sys") -@Api(tags = "系统模块-系统操作日志管理") -@RestController -public class SysLogController { - @Resource - private LogService logService; - @Autowired - private NakadaiClient nakadaiClient; - - @PostMapping("/logs") - @ApiOperation(value = "分页查询系统操作日志接口") - public R pageInfo(@RequestBody PageSysLogReq vo) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - if (!StringUtils.isEmpty(vo.getUserName())) { - queryWrapper.like("user_name", vo.getUserName()); - } - if (!StringUtils.isEmpty(vo.getOperation())) { - queryWrapper.like("operation", vo.getOperation()); - } - - queryWrapper.orderByDesc("create_time"); - - Page page = new Page(vo.getPageNum(), vo.getPageSize()); - - IPage sysLogPage = logService.page(page, queryWrapper); - if (sysLogPage.getRecords()!=null){ - for (SysLog log : sysLogPage.getRecords()) { - if (!ObjectUtils.isEmpty(log.getSchoolId())&&log.getSchoolId()!=-1&&log.getSchoolId()!=0) { - log.setSchoolName(nakadaiClient.getTheSchoolNameBySchoolId(log.getSchoolId()).getSchoolName()); - } - } - } - return R.ok(sysLogPage); - } - - @DeleteMapping("/logs") - @ApiOperation(value = "删除日志接口") - @LogAnnotation(title = "系统操作日志管理", action = "删除系统操作日志") - public R deleted(@RequestBody List logIds) { - logService.removeByIds(logIds); - return R.ok(); - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/SystemLogoController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/SystemLogoController.java deleted file mode 100644 index e53f23b..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/SystemLogoController.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.huoran.occupationlab.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; -import com.huoran.api.UserClient; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.occupationlab.entity.SystemLogo; -import com.huoran.occupationlab.entity.req.AddStaffReq; -import com.huoran.occupationlab.service.SystemLogoService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; - -/** - *

- * 职站教师端-系统logo设置 前端控制器 - *

- * - * @author lr - * @since 2021-10-18 - */ -@RestController -@RequestMapping("/occupationlab/sys/logo") -@Api(value = "API - 职站:系统logo设置", tags = "职站:系统logo设置") -public class SystemLogoController { - @Autowired - private UserClient userClient; - - @Autowired - public SystemLogoService service; - - /** - * @Description : 系统logo设置 - * @Param staffReq - * @Param request - * @Author Rong---2021/10/13 - */ - @PostMapping("/save") - @ApiOperation(value = "新增系统设置信息") - public R save(@RequestBody @Valid SystemLogo systemLogo, HttpServletRequest request) throws Exception { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - systemLogo.setSchoolId(schoolId); - boolean ret = service.save(systemLogo); - return ret ? R.ok() : R.error(); - } - - @GetMapping("/detail") - @ApiOperation(value = "查看系统设置信息") - public R save(HttpServletRequest request) throws Exception { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - SystemLogo logo = service.getOne(new QueryWrapper().eq("school_id", schoolId)); - return R.ok().put("data", logo); - } - - @PostMapping("/update") - @ApiOperation(value = "编辑系统设置信息") - public R update(@RequestBody @Valid SystemLogo systemLogo, HttpServletRequest request) throws Exception { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - UpdateWrapper updateWrapper = new UpdateWrapper<>(); - - if (systemLogo.getTitle() != null) { - updateWrapper.set("title", systemLogo.getTitle()); - } - if (systemLogo.getLogoUrl() != null) { - updateWrapper.set("logo_url", systemLogo.getLogoUrl()); - } - updateWrapper.eq("school_id", schoolId); - boolean ret = service.update(new SystemLogo(), updateWrapper); - return ret ? R.ok() : R.error(); - } -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/TheoreticalCourseChapterController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/TheoreticalCourseChapterController.java deleted file mode 100644 index 7728249..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/TheoreticalCourseChapterController.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.huoran.occupationlab.controller; - -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.TheoreticalCourseChapter; -import com.huoran.occupationlab.entity.vo.ReorderVO; -import com.huoran.occupationlab.entity.vo.TheoreticalChapterVO; -import com.huoran.occupationlab.service.TheoreticalCourseChapterService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -/** - *

- * 理论课程章节表 前端控制器 - *

- * - * @author lr - * @since 2022-09-22 - */ -@Api(tags = "理论课程章节管理") -@RestController -@RequestMapping("/occupationlab/theoreticalCourseChapter") -public class TheoreticalCourseChapterController { - - @Autowired - private TheoreticalCourseChapterService theoreticalCourseChapterService; - - @ApiOperation(value = "根据课程id查询章节小节,树状结构") - @GetMapping("/queryChaptersAndSubsections") - public R queryChaptersAndSubsections( - @ApiParam(name = "courseId", value = "课程ID", required = true) - @RequestParam String courseId) { - List chapterList = theoreticalCourseChapterService.getChapterTree(courseId); - return R.ok().put("chapterList", chapterList); - } - - @ApiOperation(value = "编辑排序") - @PostMapping("/reorder") - public R chapterReorder( - @ApiParam(name = "sortVO", value = "章节小节重排序对象", required = true) - @RequestBody ReorderVO reorderVO) { - boolean update = theoreticalCourseChapterService.updateSort(reorderVO); - return update ? R.ok() : R.error(); - - } - - @ApiOperation(value = "添加章节") - @PostMapping("/addChapter") - public R addChapter( - @ApiParam(name = "courseChapter", value = "章节对象", required = true) - @RequestBody TheoreticalCourseChapter theoreticalCourseChapter) { - //判重 - boolean isRepeat = theoreticalCourseChapterService.repeat(theoreticalCourseChapter); - if (isRepeat) { - return R.error("章节已存在"); - } - boolean save = theoreticalCourseChapterService.saveChapter(theoreticalCourseChapter); - return save ? R.ok() : R.error(); - } - - @ApiOperation(value = "修改章节") - @PutMapping("/editChapter") - public R editChapter( - @ApiParam(name = "courseChapter", value = "章节对象", required = true) - @RequestBody TheoreticalCourseChapter theoreticalCourseChapter) { - boolean update = theoreticalCourseChapterService.updateById(theoreticalCourseChapter); - return update ? R.ok() : R.error(); - } - - @ApiOperation(value = "根据id删除章节") - @DeleteMapping("/deleteChapter") - public R deleteChapter( - @ApiParam(name = "chapterId", value = "章节ID", required = true) - @RequestParam Integer chapterId) { - boolean remove = theoreticalCourseChapterService.removeChapter(chapterId); - return remove ? R.ok() : R.error(); - } -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/TheoreticalCourseClassificationController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/TheoreticalCourseClassificationController.java deleted file mode 100644 index 0bd0db5..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/TheoreticalCourseClassificationController.java +++ /dev/null @@ -1,126 +0,0 @@ -package com.huoran.occupationlab.controller; - -import com.huoran.api.UserClient; -import com.huoran.common.constant.DelConstant; -import com.huoran.common.constant.PlatformConstant; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.occupationlab.entity.TheoreticalCourseClassification; -import com.huoran.occupationlab.entity.req.ClassificationPageReq; -import com.huoran.occupationlab.service.TheoreticalCourseClassificationService; -import com.huoran.occupationlab.utils.Constant; -import io.swagger.annotations.*; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import org.springframework.web.bind.annotation.RequestParam; -import io.swagger.annotations.ApiOperation; - -import javax.servlet.http.HttpServletRequest; -import java.util.Date; -import java.util.List; - - -/** - * @描述:理论课程分类信息控制类 - * @作者: Rong - * @日期: 2022-09-14 - */ -@RestController -@RequestMapping("/occupationlab/theoreticalCourseClassification") -@Api(value = "理论课程分类信息:TheoreticalCourseClassificationController", tags = "R-理论课程分类信息") -public class TheoreticalCourseClassificationController { - - @Autowired - public TheoreticalCourseClassificationService service; - @Autowired - private UserClient userClient; - - @PostMapping("/pagingQuery") - @ApiOperation(value = "分页查询", response = TheoreticalCourseClassification.class) - public R pagingQuery(@RequestBody ClassificationPageReq pageReq, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - - if (pageReq.getPlatformSource() == PlatformConstant.POST_STATION) { - pageReq.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - } - return service.pagingQuery(pageReq); - } - - - @PostMapping("/checkRepeat") - @ApiOperation(value = "判重(传来源、名称、如若编辑则多传一个id)", response = TheoreticalCourseClassification.class) - public R checkRepeat(@RequestBody TheoreticalCourseClassification classification, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - classification.setFounderId(Integer.valueOf(accountId)); - if (classification.getPlatformSource() == PlatformConstant.POST_STATION) { - classification.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - } - return service.checkRepeat(classification); - } - - - @PostMapping("/findById") - @ApiOperation(value = "查询详情", response = TheoreticalCourseClassification.class) - public R findById(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { - TheoreticalCourseClassification theoreticalCourseClassification = service.getById(id); - return R.ok().put("data", theoreticalCourseClassification); - } - - - @PostMapping("/save") - @ApiOperation(value = "新增", response = TheoreticalCourseClassification.class) - public R save(@RequestBody @ApiParam(name = "理论课程分类信息对象", value = "传入json格式", required = true) TheoreticalCourseClassification theoreticalCourseClassification, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - theoreticalCourseClassification.setFounderId(Integer.valueOf(accountId)); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - theoreticalCourseClassification.setSchoolId(schoolId); - boolean addState = service.save(theoreticalCourseClassification); - return addState ? R.ok() : R.error("新增失败"); - } - - - @PostMapping("/update") - @ApiOperation(value = "修改", response = TheoreticalCourseClassification.class) - public R update(@RequestBody @ApiParam(name = "理论课程分类信息对象", value = "传入json格式", required = true) TheoreticalCourseClassification theoreticalCourseClassification, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - theoreticalCourseClassification.setFounderId(Integer.valueOf(accountId)); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - theoreticalCourseClassification.setSchoolId(schoolId); - boolean updateState = service.updateById(theoreticalCourseClassification); - return updateState ? R.ok() : R.error("编辑失败"); - } - - - @PostMapping("/batchDeletion") - @ApiOperation(value = "批量删除", response = TheoreticalCourseClassification.class) - public R delete(@RequestBody List ids) { - boolean delState = service.removeByIds(ids); - return delState ? R.ok() : R.error("删除失败"); - } - - - @PostMapping("/queryAllCategoriesOfSchools") - @ApiOperation(value = "查询院校所有发布的分类", response = TheoreticalCourseClassification.class) - public R queryAllCategoriesOfSchools() { - return service.queryAllCategoriesOfSchools(); - } - - - @PostMapping("/builtInCourseClassification") - @ApiOperation(value = "内置课程分类数据", response = TheoreticalCourseClassification.class) - public boolean builtInCourseClassification(Integer schoolId, Integer accountId) { - TheoreticalCourseClassification addCourseClassification1 = new TheoreticalCourseClassification().setClassificationName("金融").setSchoolId(schoolId).setFounderId(accountId).setPlatformSource(PlatformConstant.POST_STATION).setIsDel(DelConstant.NOT_DEL).setCreateTime(new Date()).setUpdateTime(new Date()); - boolean ret1 = service.save(addCourseClassification1); - TheoreticalCourseClassification addCourseClassification2 = new TheoreticalCourseClassification().setClassificationName("金融科技").setSchoolId(schoolId).setFounderId(accountId).setPlatformSource(PlatformConstant.POST_STATION).setIsDel(DelConstant.NOT_DEL).setCreateTime(new Date()).setUpdateTime(new Date()); - boolean ret2 = service.save(addCourseClassification2); - TheoreticalCourseClassification addCourseClassification3 = new TheoreticalCourseClassification().setClassificationName("大数据").setSchoolId(schoolId).setFounderId(accountId).setPlatformSource(PlatformConstant.POST_STATION).setIsDel(DelConstant.NOT_DEL).setCreateTime(new Date()).setUpdateTime(new Date()); - boolean ret3 = service.save(addCourseClassification3); - return ret1 && ret2 && ret3; - } - -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/TheoreticalCourseConfigureController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/TheoreticalCourseConfigureController.java deleted file mode 100644 index 98101c6..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/TheoreticalCourseConfigureController.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.huoran.occupationlab.controller; - -import com.huoran.common.response.R; -import io.swagger.annotations.*; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import org.springframework.beans.factory.annotation.Autowired; -import org.apache.commons.lang.StringUtils; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import org.springframework.web.bind.annotation.RequestParam; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import com.huoran.occupationlab.service.TheoreticalCourseConfigureService; -import com.huoran.occupationlab.entity.TheoreticalCourseConfigure; - -import java.util.List; - - -/** - * @描述:理论课程与理论课程分类配置表控制类 - * @作者: Rong - * @日期: 2022-09-14 - */ -@RestController -@RequestMapping("/occupationlab/theoreticalCourseConfigure") -@Api(value = "理论课程与理论课程分类配置表:TheoreticalCourseConfigureController", tags = "R-理论课程与理论课程分类配置表") -public class TheoreticalCourseConfigureController { - - @Autowired - public TheoreticalCourseConfigureService service; - - - /*@PostMapping("/listByEntity") - @ApiOperation(value = "分页查询", response = TheoreticalCourseConfigure.class) - public R listByEntity(@RequestBody TheoreticalCourseConfigure theoreticalCourseConfigure) { - - return null; - }*/ - - - @PostMapping("/findById") - @ApiOperation(value = "查询详情", response = TheoreticalCourseConfigure.class) - public R findById(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { - TheoreticalCourseConfigure theoreticalCourseConfigure = service.getById(id); - return R.ok().put("data", theoreticalCourseConfigure); - } - - - @PostMapping("/save") - @ApiOperation(value = "新增", response = TheoreticalCourseConfigure.class) - public R save(@RequestBody @ApiParam(name = "理论课程与理论课程分类配置表对象", value = "传入json格式", required = true) TheoreticalCourseConfigure theoreticalCourseConfigure) { - boolean addState = service.save(theoreticalCourseConfigure); - return addState ? R.ok() : R.error("新增失败"); - } - - - @PostMapping("/update") - @ApiOperation(value = "修改", response = TheoreticalCourseConfigure.class) - public R update(@RequestBody @ApiParam(name = "理论课程与理论课程分类配置表对象", value = "传入json格式", required = true) TheoreticalCourseConfigure theoreticalCourseConfigure) { - boolean updateState = service.updateById(theoreticalCourseConfigure); - return updateState ? R.ok() : R.error("编辑失败"); - } - - - @PostMapping("/delete") - @ApiOperation(value = "删除", response = TheoreticalCourseConfigure.class) - public R delete(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { - boolean delState = service.removeById(id); - return delState ? R.ok() : R.error("删除失败"); - } - - @PostMapping("/batchDeletion") - @ApiOperation(value = "批量删除", response = TheoreticalCourseConfigure.class) - public R batchDeletion(@ApiParam(name = "id", value = "主键", required = true) @RequestParam List ids) { - boolean delState = service.removeByIds(ids); - return delState ? R.ok() : R.error("删除失败"); - } -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/TheoreticalCourseController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/TheoreticalCourseController.java deleted file mode 100644 index 61c3e58..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/TheoreticalCourseController.java +++ /dev/null @@ -1,239 +0,0 @@ -package com.huoran.occupationlab.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.api.UserClient; -import com.huoran.common.constant.PlatformConstant; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.occupationlab.entity.PlayRecord; -import com.huoran.occupationlab.entity.TheoreticalCourse; -import com.huoran.occupationlab.entity.TheoreticalCourseCollect; -import com.huoran.occupationlab.entity.req.AddTheoreticalCourseReq; -import com.huoran.occupationlab.entity.req.DisableEnableCourseReq; -import com.huoran.occupationlab.entity.req.PageStudentTheoreticalCourseReq; -import com.huoran.occupationlab.entity.req.PageTheoreticalCourseReq; -import com.huoran.occupationlab.entity.resp.PageTheoreticalCourseByNakadaiResp; -import com.huoran.occupationlab.entity.resp.TheoreticalCourseDetailResp; -import com.huoran.occupationlab.service.PlayRecordService; -import com.huoran.occupationlab.service.TheoreticalCourseCollectService; -import com.huoran.occupationlab.service.TheoreticalCourseService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.Date; -import java.util.List; -import java.util.concurrent.TimeUnit; - - -/** - * @描述:理论课程基本信息控制类 - * @作者: Rong - * @日期: 2022-09-14 - */ -@RestController -@RequestMapping("/occupationlab/theoreticalCourse") -@Api(value = "理论课程基本信息:TheoreticalCourseController", tags = "R-理论课程基本信息") -public class TheoreticalCourseController { - - @Autowired - public TheoreticalCourseService service; - - @Autowired - public PlayRecordService playRecordService; - - @Autowired - public TheoreticalCourseCollectService courseCollectService; - @Autowired - private UserClient userClient; - - @Autowired - private StringRedisTemplate redisTemplate; - - @PostMapping("/pageConditionalQueryCourse") - @ApiOperation(value = "分页条件查询课程(本接口可用于中台、职站教师端理论课程)", response = PageTheoreticalCourseByNakadaiResp.class) - public R pageConditionalQueryCourse(@RequestBody PageTheoreticalCourseReq pageReq, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - pageReq.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - return service.pageConditionalQueryCourse(pageReq); - } - - @PostMapping("/pageConditionalQueryCourseByStudent") - @ApiOperation(value = "分页条件查询课程(学生端理论课程)", response = PageTheoreticalCourseByNakadaiResp.class) - public R pageConditionalQueryCourseByStudent(@RequestBody PageStudentTheoreticalCourseReq pageReq, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - pageReq.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - pageReq.setAccountId(Integer.valueOf(accountId)); - return service.pageConditionalQueryCourseByStudent(pageReq); - } - - - @PostMapping("/studentLoginPreCourse") - @ApiOperation(value = "分页条件查询课程(学生登录前)", response = PageTheoreticalCourseByNakadaiResp.class) - public R studentLoginPreCourse(@RequestBody PageTheoreticalCourseReq pageReq) { - return service.studentLoginPreCourse(pageReq); - } - - - @PostMapping("/findById") - @ApiOperation(value = "查询详情", response = TheoreticalCourseDetailResp.class) - public R findById(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { - return service.theoryCoursesDetail(id); - } - - - @PostMapping("/save") - @ApiOperation(value = "新增理论课程", response = TheoreticalCourse.class) - public R save(@RequestBody @ApiParam(name = "理论课程基本信息对象", value = "传入json格式", required = true) AddTheoreticalCourseReq req, HttpServletRequest request) { - return service.addTheoryCourses(req, request); - } - - - /** - * 同校内判重 - * 平台和学校内可重复 - * - * @param theoreticalCourse - * @param request - * @return - */ - @PostMapping("/checkRepeat") - @ApiOperation(value = "课程判重(传来源、名称、如若编辑则多传一个id)", response = TheoreticalCourse.class) - public R checkRepeat(@RequestBody TheoreticalCourse theoreticalCourse, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - theoreticalCourse.setFounderId(Integer.valueOf(accountId)); - if (theoreticalCourse.getPlatformSource() == PlatformConstant.POST_STATION) { - theoreticalCourse.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - } - return service.checkRepeat(theoreticalCourse); - } - - @PostMapping("/update") - @ApiOperation(value = "修改", response = TheoreticalCourse.class) - public R update(@RequestBody @ApiParam(name = "理论课程基本信息对象", value = "传入json格式", required = true) AddTheoreticalCourseReq req, HttpServletRequest request) { - return service.modifyTheoryCourses(req, request); - } - - - @PostMapping("/delete") - @ApiOperation(value = "删除", response = TheoreticalCourse.class) - public R delete(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { - boolean delState = service.removeById(id); - return delState ? R.ok() : R.error("删除失败"); - } - - @PostMapping("/batchDeletion") - @ApiOperation(value = "批量删除", response = TheoreticalCourse.class) - public R batchDeletion(@ApiParam(name = "id", value = "主键", required = true) @RequestParam List ids) { - boolean delState = service.removeByIds(ids); - return delState ? R.ok() : R.error("删除失败"); - } - - - @ApiOperation(value = "课程禁启用", response = TheoreticalCourse.class) - @PostMapping("/disabledEvents") - public R disabledEvents(@RequestBody DisableEnableCourseReq req) { - - TheoreticalCourse getDetail = service.getById(req.getCourseId()); - TheoreticalCourse contest = new TheoreticalCourse(); - contest.setId(req.getCourseId()); - //禁用平台来源(0中台,1职站) - switch (req.getType()) { - case 0: - contest.setZtOpen(req.getIsOpen()); - break; - case 1: - //原理论课程需求: - // 用户创建的理论课程,禁用时职站首页以及学生登录后的理论课程模块看不到对应的课程,创建的老师在理论课程管理还是可以看到该理论课程,可以编辑,但是无法启用。 - // 即中台禁用的理论课程,即使是该院校老师创建的,老师端也不能自己启用,需要中台启用。 - //1.判断当前院校禁启用状态为要启用时候再判断当前课程中台禁启用的状态 - if (req.getIsOpen() == 0) { - if (getDetail.getZtOpen() == 1) { - return R.error("当前课程已被平台禁用,请联系平台管理员!"); - } - } - contest.setIsOpen(req.getIsOpen()); - break; - - } - boolean ret = service.updateById(contest); - - /*if (req.getIsOpen() == 1) {*/ - //保存的key名 - String key = "theoryCoursesAreDisabled"; - //保存到缓存中 - redisTemplate.opsForValue().set(key, "true"); - /*}*/ - return ret ? R.ok() : R.error(); - } - - - @PostMapping("/getRedisCache") - @ApiOperation(value = "获取Redis缓存(返回true 刷新)") - public R getRedisCache() { - //保存的key名 - String key = "theoryCoursesAreDisabled"; - //查看缓存是否有数据 - String returnValue = redisTemplate.opsForValue().get(key); - - //使用缓存返回数据 - if (returnValue != null) { - - //设置key过期时间 - redisTemplate.expire(key, 5000, TimeUnit.MILLISECONDS);//设置过期时间 - return R.ok().put("data", returnValue); - } - - - return R.ok(); - } - - - @PostMapping("/addBrowsingData") - @ApiOperation(value = "增加浏览数据", response = TheoreticalCourse.class) - public void addBrowsingData(@RequestBody @ApiParam(name = "资源播放记录对象", value = "传入json格式", required = true) PlayRecord playRecord) { - for (int i = 0; i <= playRecord.getNum(); i++) { - playRecordService.save(playRecord); - } - } - - - @PostMapping("/collectCourse") - @ApiOperation(value = "收藏课程", response = TheoreticalCourseCollect.class) - public R collectCourse(@ApiParam(name = "courseId", value = "课程id", required = true) @RequestParam Integer courseId, - @ApiParam(name = "state", value = "操作状态(state = 1收藏,0取消收藏)", required = true) @RequestParam Integer state, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("course_id", courseId); - queryWrapper.eq("account_id", accountId); - - TheoreticalCourseCollect detail = courseCollectService.getOne(queryWrapper); - switch (state) { - case 0://取消收藏 - if (detail != null) { - courseCollectService.removeById(detail.getId()); - } - break; - - case 1://收藏 - if (detail != null) { - return R.ok("已经收藏过了!"); - } - TheoreticalCourseCollect courseCollect = new TheoreticalCourseCollect(); - courseCollect.setCourseId(courseId); - courseCollect.setCollectionTime(new Date()); - courseCollect.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - courseCollect.setAccountId(Integer.valueOf(accountId)); - courseCollectService.save(courseCollect); - break; - } - return R.ok(); - } - - -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/TheoreticalCourseSubsectionController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/TheoreticalCourseSubsectionController.java deleted file mode 100644 index 021328d..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/TheoreticalCourseSubsectionController.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.huoran.occupationlab.controller; - -import com.aliyuncs.exceptions.ClientException; -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.TheoreticalCourseSubsection; -import com.huoran.occupationlab.service.TheoreticalCourseSubsectionService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -/** - *

- * 课程小节 前端控制器 - *

- * - * @author lr - * @since 2022-09-22 - */ -@Api(tags = "理论课程小节管理") -@RestController -@RequestMapping("/occupationlab/theoreticalCourseSubsection") -public class TheoreticalCourseSubsectionController { - - @Autowired - private TheoreticalCourseSubsectionService theoreticalCourseSubsectionService; - - @ApiOperation(value = "添加小节") - @PostMapping("/addSubsection") - public R addSubsection( - @ApiParam(name = "theoreticalCourseSubsection", value = "小节对象", required = true) - @RequestBody TheoreticalCourseSubsection theoreticalCourseSubsection) { - //判重 - boolean isRepeat = theoreticalCourseSubsectionService.repeat(theoreticalCourseSubsection); - if (isRepeat) { - return R.error("小节已存在"); - } - boolean save = theoreticalCourseSubsectionService.saveSubsection(theoreticalCourseSubsection); - return save ? R.ok() : R.error(); - } - - @ApiOperation(value = "修改小节") - @PutMapping("/editSubsection") - public R editSubsection( - @ApiParam(name = "theoreticalCourseSubsection", value = "小节对象", required = true) - @RequestBody TheoreticalCourseSubsection theoreticalCourseSubsection) { - boolean update = theoreticalCourseSubsectionService.updateById(theoreticalCourseSubsection); - return update ? R.ok() : R.error(); - } - - @ApiOperation(value = "根据id删除小节") - @DeleteMapping("/deleteSubsection") - public R deleteSubsection( - @ApiParam(name = "subsectionId", value = "小节ID", required = true) - @RequestParam Integer subsectionId) throws ClientException { - boolean remove = theoreticalCourseSubsectionService.removeSubsection(subsectionId); - return remove ? R.ok() : R.error(); - } - - @ApiOperation(value = "根据小节id获取预览文件地址") - @GetMapping("/getSubsection") - public R getSubsection( - @ApiParam(name = "subsectionId", value = "小节ID", required = true) - @RequestParam String subsectionId) { - String officeUrl = "https://view.officeapps.live.com/op/view.aspx?src="; - // String xDocUrl = "http://view.xdocin.com/xdoc?_xdoc="; - TheoreticalCourseSubsection courseSubsection = theoreticalCourseSubsectionService.getById(subsectionId); - if (courseSubsection != null) { - String fileUrl = courseSubsection.getFileUrl(); - String previewUrl = officeUrl + fileUrl; - return R.ok().put("previewUrl", previewUrl); - } else { - return R.error(); - } - } -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/UserInfoController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/UserInfoController.java deleted file mode 100644 index fd56b78..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/UserInfoController.java +++ /dev/null @@ -1,150 +0,0 @@ -package com.huoran.occupationlab.controller; - - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.AclPermission; -import com.huoran.occupationlab.entity.AclRole; -import com.huoran.occupationlab.entity.HrUserInfo; -import com.huoran.occupationlab.service.PermissionService; -import com.huoran.occupationlab.service.RoleService; -import com.huoran.occupationlab.service.UserInfoService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.bind.annotation.*; - -import java.util.HashMap; -import java.util.List; - -/** - *

- * 用户信息表 前端控制器 - *

- * - * @author Ning - * @since 2020-10-21 - */ -@RestController -@RequestMapping("/occupationlab/management/userInfo") -@Api(tags = "用户管理") -public class UserInfoController { - - @Autowired - private UserInfoService userInfoService; - - @Autowired - private RoleService roleService; - - @Autowired - private PermissionService permissionService; - - - /** - * 个人中心 - */ - @ApiOperation(value = "个人中心") - @GetMapping("/getUserInfo") - public R getUserInfo( - @ApiParam(name = "userId", value = "用户id", required = true) - @RequestParam(value = "userId", required = true) Integer userId) { - HrUserInfo userInfo = userInfoService.getUserInfo(userId); - return R.ok().put("userInfo", userInfo); - } - - /** - * 登陆 - */ - @Transactional - @ApiOperation(value = "登陆") - @GetMapping("/login") - public R login( - @ApiParam(name = "account", value = "账号", required = true) - @RequestParam(value = "account", required = true) String account, - @ApiParam(name = "password", value = "密码", required = true) - @RequestParam(value = "password", required = true) String password) { - HashMap map = new HashMap<>(); - map.put("account", account); - map.put("password", password); - HrUserInfo userInfo = userInfoService.login(map); - if (userInfo == null) { - throw new RuntimeException("账号密码错误!"); - } else { - Integer userId = userInfo.getUserId(); - //获取当前用户角色id - String roleId = userInfo.getRoleId(); - //获取用户端口 - Integer isPort = userInfo.getIsPort(); - //根据角色查询菜单 - List permissions = permissionService.selectAllMenu(roleId, isPort); - //查询角色 - AclRole role = roleService.getById(roleId); - //更新登录时间 - userInfoService.updateTime(userId); - return R.ok().put("userInfo", userInfo).put("permissions", permissions).put("role", role); - } - } - - /** - * 注册 - */ - @ApiOperation(value = "注册") - @PostMapping("/add") - public R add( - @ApiParam(name = "userInfo", value = "用户对象", required = true) - @RequestBody HrUserInfo userInfo) { - boolean status = userInfoService.save(userInfo); - return R.ok().put("status", status); - } - - /** - * 查询用户账号 - */ - @ApiOperation(value = "查询用户账号") - @GetMapping("/getAccount") - public R getAccount( - @ApiParam(name = "account", value = "账号", required = true) - @RequestParam(value = "account", required = true) String account) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("account", account).eq("isdel", 0); - HrUserInfo userInfo = userInfoService.getOne(wrapper); - return R.ok().put("userInfo", userInfo); - } - - /** - * 修改 - */ - @ApiOperation(value = "修改") - @PostMapping("/update") - public R update( - @ApiParam(name = "userInfo", value = "用户对象", required = true) - @RequestBody HrUserInfo userInfo) { - boolean status = userInfoService.updateById(userInfo); - return status ? R.ok() : R.error(); - } - - // @ApiOperation(value = "根据用户获取角色数据") - // @GetMapping("/toAssign/{userId}") - // public R toAssign(@PathVariable String userId) { - // Map roleMap = roleService.findRoleByUserId(userId); - // return R.ok().put(roleMap); - // } - - @ApiOperation(value = "根据用户分配角色") - @PostMapping("/doAssign") - public R doAssign(@RequestParam String userId, @RequestParam String[] roleId) { - roleService.saveUserRoleRelationShip(userId, roleId); - return R.ok(); - } - - // @ApiOperation(value = "根据用户id拥有的角色id") - // @PostMapping("/getRoles") - // public R getRoles(@RequestParam String userId) { - // List roles = roleService.selectRoleByUserId(userId); - // return R.ok().put("roles",roles); - // } - -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/UserManagementController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/UserManagementController.java deleted file mode 100644 index f341165..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/UserManagementController.java +++ /dev/null @@ -1,131 +0,0 @@ -package com.huoran.occupationlab.controller; - - -import com.google.common.collect.Maps; -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.UserManagement; -import com.huoran.occupationlab.entity.vo.UserVO; -import com.huoran.occupationlab.service.UserManagementService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - *

- * 企业端用户管理 前端控制器 - *

- * - * @author Ning - * @since 2020-10-27 - */ -@RestController -@RequestMapping("/occupationlab/enterprise/user") -@Api(description = "用户管理", tags = "用户管理") -public class UserManagementController { - - @Autowired - private UserManagementService service; - - /** - * 添加用户信息 - */ - @ApiOperation(value = "添加用户信息") - @PostMapping("/addUser") - public R addUser(@ApiParam(name = "userManagement", value = "用户管理实体", required = true) - @RequestBody UserVO vo) { - if (vo == null) { - return R.error("数据有误,新增用户失败!"); - } else { - boolean ret = service.addUser(vo); - return ret ? R.ok() : R.error(); - } - } - - /** - * 查询用户列表 - */ - @ApiOperation(value = "查询用户列表") - @GetMapping("/list/{current}/{pageSize}") - public R list( - @ApiParam(name = "current", value = "当前页码", required = true) - @PathVariable int current, - @ApiParam(name = "pageSize", value = "每页记录数", required = true) - @PathVariable int pageSize, - @ApiParam(name = "searchContent", value = "搜索内容", required = false) - @RequestParam(value = "searchContent", required = false) String searchContent) { - HashMap map = Maps.newHashMap(); - map.put("current", (current - 1) * pageSize); - map.put("pageSize", pageSize); - if (searchContent != null) { - map.put("searchContent", searchContent); - } - List list = service.queryList(map); - int total = service.queryListCount(map); - return R.ok().put("list", list).put("total", total); - } - - /** - * 批量删除用户 - */ - @ApiOperation(value = "批量删除用户") - @PostMapping("/deleteUser") - public R deleteClient(@ApiParam(name = "userIds", value = "多个用户id", required = true) - @RequestParam List userIds) { - if (userIds.isEmpty()) { - return R.error("用户id为空,删除失败!"); - } else { - boolean ret = service.deleteUser(userIds); - return ret ? R.ok() : R.error(); - } - } - - /** - * 更新用户 - */ - @ApiOperation(value = "更新用户") - @PostMapping("/updateUser") - public R updateClient(@ApiParam(name = "UserManagement", value = "用户实体", required = true) - @RequestBody UserVO vo) { - if (vo == null) { - return R.error("用户实体为空,修改失败!"); - } else { - boolean ret = service.updateUser(vo); - return ret ? R.ok() : R.error(); - } - } - - /** - * 批量导入用户信息 - * - * @param file - * @return - */ - @ApiOperation(value = "批量导入用户信息") - @PostMapping("/uploadFile") - public R uploadFile(@ApiParam(name = "file", value = "用户信息文件", required = true) MultipartFile file) throws IOException { - Map upload = service.upload(file); - return R.ok().put("data", upload); - } - - /** - * 导出失败原因 - * - * @param token - * @return - */ - @ApiOperation(value = "导出失败原因") - @GetMapping("/exportFailure") - public void exportFailureRecord(HttpServletResponse response, String token) throws Exception { - service.exportFailureRecord(response, token); - } -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/UserScoreController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/UserScoreController.java deleted file mode 100644 index d8f3c4a..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/UserScoreController.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.huoran.occupationlab.controller; - - -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.UserScore; -import com.huoran.occupationlab.service.UserScoreService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; - -/** - *

- * 用户分数表 前端控制器 - *

- * - * @author Mr.JK - * @since 2021-09-14 - */ -@RestController -@RequestMapping("/occupationlab/userScore") -@Api(tags = "用户分数") -public class UserScoreController { - - @Autowired - private UserScoreService userScoreService; - - @PostMapping("/addUserScore") - @ApiOperation(value = "新增用户分数表 远程feign") - public Integer addUserScore(@RequestBody UserScore userScore){ - if (userScoreService.save(userScore)){ - return userScore.getId(); - } - return null; - } - -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/controller/XxlJobController.java b/occupationlab/src/main/java/com/huoran/occupationlab/controller/XxlJobController.java deleted file mode 100644 index b1b937e..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/controller/XxlJobController.java +++ /dev/null @@ -1,70 +0,0 @@ -//package com.huoran.occupationlab.controller; -// -//import io.swagger.annotations.Api; -//import io.swagger.annotations.ApiOperation; -//import io.swagger.annotations.ApiParam; -//import org.springframework.beans.factory.annotation.Autowired; -//import org.springframework.web.bind.annotation.PostMapping; -//import org.springframework.web.bind.annotation.RequestMapping; -//import org.springframework.web.bind.annotation.RequestParam; -//import org.springframework.web.bind.annotation.RestController; -// -//import java.text.DateFormat; -//import java.text.SimpleDateFormat; -// -// -//@Api(tags = "xxlJob定时任务管理") -//@RestController -//@RequestMapping("/xxlJob") -//public class XxlJobController { -// -//// @Autowired -//// private XxlJobService xxlJobService; -// -// //添加任务并运行 -// @PostMapping("/addTask") -// @ApiOperation(value = "新增") -// public void addTask( -// @ApiParam(name = "customId", value = "用户id", required = true) -// @RequestParam(value = "customId", required = true) String customId, -// @RequestParam(value = "triggerTime", required = true) String triggerTime, -// @RequestParam(value = "executorParam", required = true) String executorParam) { -// try { -// /** -// customId – 自定义的唯一的业务id,此id在所有任务中保持唯一,注意:这个唯一标识被放到了负责人字段 -// triggerTime – 任务执行时间,必须大于当前时间 -// executorParam – 任务执行参数 -// executorHandler – 任务处理器,关联@XxlJob的value "2023-11-03 12:05:00" -// */ -// -// DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); -// Integer taskId = xxlJobService.addJustExecuteOnceJob(customId,dateFormat.parse(triggerTime),executorParam,"testHandler"); -// //开始运行任务 -// xxlJobService.start(taskId); -// }catch (Exception e) { -// e.printStackTrace(); -// } -// } -// -// @PostMapping("/deleteTask") -// @ApiOperation(value = "删除任务") -// public void deleteTask(@RequestParam String data) { -// try { -// //通过自定义的唯一的业务id获取任务的id -// Integer taskId = xxlJobService.getJobIdByCustomId(data); -// //删除任务 -// xxlJobService.remove(taskId); -// }catch (Exception e) { -// e.printStackTrace(); -// } -// } -// -// //任务处理器 -//// @XxlJob("testHandler") -//// public void test() { -//// System.out.println("计划任务开始执行"); -//// // 获取任务参数 -//// String param = XxlJobHelper.getJobParam(); -//// System.out.println("计划任务传输过来的参数 ------" + param); -//// } -//} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/AclPermission.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/AclPermission.java deleted file mode 100644 index 028f257..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/AclPermission.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.Date; -import java.util.List; - -/** - *

- * 权限表 - *

- * - * @author lr - * @since 2021-08-10 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_acl_permission") -@ApiModel(value = "AclPermission对象", description = "权限表") -public class AclPermission implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "id") - @TableId(value = "id", type = IdType.ID_WORKER_STR) - private String id; - - @ApiModelProperty(value = "所属上级") - private String pid; - - @ApiModelProperty(value = "权限名称") - private String name; - - @ApiModelProperty(value = "权限类型(1:菜单,2:按钮)") - private Integer type; - - @ApiModelProperty(value = "权限值") - private String permissionValue; - - @ApiModelProperty(value = "访问路径") - private String path; - - @ApiModelProperty(value = "组件路径") - private String component; - - @ApiModelProperty(value = "图标") - private String icon; - - @ApiModelProperty(value = "状态(0:正常,1:禁止)") - private Integer status; - - - @ApiModelProperty(value = "层级") - @TableField(exist = false) - private Integer level; - - @ApiModelProperty(value = "下级") - @TableField(exist = false) - private List children; - - @ApiModelProperty(value = "是否选中") - @TableField(exist = false) - private boolean isSelect; - - @ApiModelProperty(value = "创建时间") - private Date gmtCreate; - - @ApiModelProperty(value = "更新时间") - private Date gmtModified; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/AclRole.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/AclRole.java deleted file mode 100644 index 4cdac93..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/AclRole.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; -import java.util.Date; -import com.baomidou.mybatisplus.annotation.TableId; -import java.io.Serializable; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 角色表 - *

- * - * @author lr - * @since 2021-08-10 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_acl_role") -@ApiModel(value="AclRole对象", description="角色表") -public class AclRole implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "角色id") - @TableId(value = "id", type = IdType.ID_WORKER_STR) - private String id; - - @ApiModelProperty(value = "角色名称") - private String roleName; - - @ApiModelProperty(value = "角色编码") - private String roleCode; - - @ApiModelProperty(value = "备注") - private String remark; - - @ApiModelProperty(value = "创建时间") - private Date gmtCreate; - - @ApiModelProperty(value = "更新时间") - private Date gmtModified; - - @ApiModelProperty(value = "绑定客户id") - private Integer clientId; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/AclRolePermission.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/AclRolePermission.java deleted file mode 100644 index cd7182e..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/AclRolePermission.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; -import java.util.Date; -import com.baomidou.mybatisplus.annotation.TableId; -import java.io.Serializable; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 角色权限表 - *

- * - * @author lr - * @since 2021-08-10 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_acl_role_permission") -@ApiModel(value="AclRolePermission对象", description="角色权限表") -public class AclRolePermission implements Serializable { - - private static final long serialVersionUID = 1L; - - @TableId(value = "id", type = IdType.ID_WORKER_STR) - private String id; - - @ApiModelProperty(value = "角色id") - private String roleId; - - @ApiModelProperty(value = "权限id") - private String permissionId; - - @ApiModelProperty(value = "创建时间") - private Date gmtCreate; - - @ApiModelProperty(value = "更新时间") - private Date gmtModified; - - @ApiModelProperty(value = "端口(1、企业端 2、管理端)") - private Integer isPort; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/AclUserRole.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/AclUserRole.java deleted file mode 100644 index 92eb043..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/AclUserRole.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; -import java.util.Date; -import com.baomidou.mybatisplus.annotation.TableId; -import java.io.Serializable; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 用户角色表 - *

- * - * @author lr - * @since 2021-08-10 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_acl_user_role") -@ApiModel(value="AclUserRole对象", description="用户角色表") -public class AclUserRole implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "主键id") - @TableId(value = "id", type = IdType.ID_WORKER_STR) - private String id; - - @ApiModelProperty(value = "角色id") - private String roleId; - - @ApiModelProperty(value = "用户id") - private String userId; - - @ApiModelProperty(value = "创建时间") - private Date gmtCreate; - - @ApiModelProperty(value = "更新时间") - private Date gmtModified; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/Applicant.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/Applicant.java deleted file mode 100644 index 141158f..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/Applicant.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.Date; - -/** - *

- * 报名人员表 - *

- * - * @author lr - * @since 2021-08-10 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_applicant") -@ApiModel(value = "Applicant对象", description = "报名人员表") -public class Applicant implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "主键") - @TableId(value = "id", type = IdType.ID_WORKER_STR) - private String id; - - @ApiModelProperty(value = "用户主键Id", example = "1") - private String userId; - - @ApiModelProperty(value = "竞赛主键Id", example = "1435884916087099393") - private String contestId; - - @ApiModelProperty(value = "是否禁用(1未禁用,0禁用)", example = "1") - private Integer isDisable; - - @ApiModelProperty(value = "创建时间") - private Date gmtCreate; - - @ApiModelProperty(value = "修改时间") - private Date gmtModified; - - @ApiModelProperty(value = "用户名称", example = "张昭") - private String username; - - @ApiModelProperty(value = "学校名称", example = "湖南科技大学") - private String school; - - @ApiModelProperty(value = "账号", example = "hunan") - private String account; - - @ApiModelProperty(value = "手机号", example = "17777777777") - private String phone; - - @ApiModelProperty(value = "账号id", example = "1") - private String accountId; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/Architecture.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/Architecture.java deleted file mode 100644 index 444dc4e..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/Architecture.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.*; - -import java.util.Date; - -import java.io.Serializable; -import java.util.List; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; - -/** - *

- * 学生组织架构 - *

- * - * @author lr - * @since 2021-08-24 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_architecture") -@ApiModel(value = "Architecture对象", description = "学生组织架构") -public class Architecture implements Serializable { - - private static final long serialVersionUID = 1L; - - @TableId(type = IdType.AUTO) - @ApiModelProperty(value = "自增id 新增无需传值") - private Integer id; - - @ApiModelProperty(value = "组织名称") - private String organizationName; - - @ApiModelProperty(value = "父id 一级为0", example = "0", name = "parentId") - private Integer parentId; - - @ApiModelProperty(value = "学校id", example = "1", name = "schoolId") - private Integer schoolId; - - @ApiModelProperty(value = "创建时间") - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - @ApiModelProperty(value = "更新时间") - @TableField(fill = FieldFill.INSERT_UPDATE) - private Date updateTime; - - @ApiModelProperty(value = "逻辑删除") - @TableLogic - private Integer isDel; - - - @ApiModelProperty(value = "层级") - private Integer level; - - @ApiModelProperty(value = "子级") - @TableField(exist = false) - private List children; - - @ApiModelProperty(value = "层级拼接") - @TableField(exist = false) - private String splicingLevel; - - /*@ApiModelProperty(value = "班級") - @TableField(exist = false) - private List classList;*/ - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/Article.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/Article.java deleted file mode 100644 index fdf7d62..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/Article.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.*; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.Date; - -/** - *

- * 文章表 - *

- * - * @author lr - * @since 2021-08-10 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_article") -@ApiModel(value = "Article对象", description = "文章表") -public class Article implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "主键") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "文章标题", example = "今天天气不错") - private String title; - - @ApiModelProperty(value = "文章作者", example = "Rong") - private String author; - - @ApiModelProperty(value = "创建人") - private String createUser; - - @ApiModelProperty(value = "栏目ID") - private Integer columnId; - - @ApiModelProperty(value = "文章封面图", example = "https://www.baidu.com/") - private String coverUrl; - - @ApiModelProperty(value = "文章内容", example = "DDD 是 Eric Evans 在2003年出版的书名,同时也是这个架构设计方法名的起源。Eric Evans “领域驱动设计之父”,世界杰出软件建模专家。他创建的 “Domain Language” 公司,就是致力帮助公司机构创建与业务紧密相关的软件。") - private String content; - - @ApiModelProperty(value = "排序号", example = "0") - private Integer sort; - - @ApiModelProperty(value = "浏览量", example = "0") - private Long viewCount; - - @ApiModelProperty(value = "状态(0不展示,1展示)", example = "0") - private Integer status; - - @ApiModelProperty(value = "文章日期", example = "2021-09-09 10:00:00") - private Date date; - - @ApiModelProperty(value = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - @ApiModelProperty(value = "更新时间") - @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") - @TableField(fill = FieldFill.INSERT_UPDATE) - private Date updateTime; - - @ApiModelProperty(value = "是否删除") - @TableLogic(value = "0",delval = "1") - private Integer isDel; - - @ApiModelProperty(value = "学校id") - private Integer schoolId; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/Assessment.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/Assessment.java deleted file mode 100644 index d4fe146..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/Assessment.java +++ /dev/null @@ -1,125 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.*; - -import java.util.Date; - -import java.io.Serializable; -import java.util.List; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.huoran.occupationlab.entity.req.ClassReq; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; -import org.springframework.format.annotation.DateTimeFormat; - -import javax.validation.constraints.NotNull; - -/** - *

- * 考核管理 - *

- * - * @author lr - * @since 2021-08-18 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_assessment") -@ApiModel(value = "Assessment对象", description = "考核管理") -public class Assessment implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "主键id") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "考核名称") - private String experimentalName; - - @ApiModelProperty(value = "班级id(可多个班级参加,逗号隔开)") - private String classId; - - @ApiModelProperty(value = "绑定项目id") - private Integer projectId; - - @ApiModelProperty(value = "实验时长") - private String experimentDuration; - - @ApiModelProperty(value = "发布类型(1、手动发布 2、定时发布)") - private Integer type; - - @ApiModelProperty(value = "起始时间") - private Date startTime; - - @ApiModelProperty(value = "结束时间") - private Date stopTime; - - @ApiModelProperty(value = "状态(0、待开始 1、进行中 2、已结束)") - private Integer status; - - @ApiModelProperty(value = "邀请码") - private Integer invitationCode; - - @ApiModelProperty(value = "指定范围(0无指定范围 1指定范围)") - @NotNull(message = "指定范围不能为空") - private Integer isSpecify; - - @ApiModelProperty(value = "创建人用户账号id") - private Integer accountId; - - @ApiModelProperty(value = "课程id 默认不传(nakadai curriculum表)") - private Integer curriculumId; - - @ApiModelProperty(value = "是否启用邀请码(0、未启用 1、启用)") - private Integer isEnableCode; - - @ApiModelProperty(value = "是否删除(0、未删除 1、已删除)") - @TableLogic - private Integer isDel; - - @ApiModelProperty(value = "创建时间") - @TableField(fill = FieldFill.INSERT) - @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") - private Date createTime; - - @ApiModelProperty(value = "商品id", name = "mallId") - private Integer mallId; - - @ApiModelProperty(value = "班级名称") - @TableField(exist = false) - private String className; - - @ApiModelProperty(value = "项目名称") - @TableField(exist = false) - private String projectName; - - @ApiModelProperty(value = "实验人数") - @TableField(exist = false) - private Integer experimenterNum; - - @ApiModelProperty(value = "绑定学生信息") - @TableField(exist = false) - private List stuInfo; - - @ApiModelProperty(value = "班级信息") - @TableField(exist = false) - private List classInfo; - - @ApiModelProperty(value = "学校id", name = "schoolId", example = "1") - private Integer schoolId; - - @ApiModelProperty(value = "倒计时") - @TableField(exist = false) - private String countdownTime; - - @ApiModelProperty(value = "考核发布人角色") - @TableField(exist = false) - private String roleName; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/AssessmentExam.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/AssessmentExam.java deleted file mode 100644 index fe43505..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/AssessmentExam.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; - -import java.util.Date; - -import com.baomidou.mybatisplus.annotation.TableId; - -import java.io.Serializable; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 学生考试表(考核) - *

- * - * @author lr - * @since 2021-08-19 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_assessment_exam") -@ApiModel(value = "AssessmentExam对象", description = "学生考试表(考核)") -public class AssessmentExam implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = " 考试主键id") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "绑定考核id") - private Integer assessmentId; - - @ApiModelProperty(value = "绑定用户id") - private Integer accountId; - - @ApiModelProperty(value = "用时") - private Integer timeCost; - - @ApiModelProperty(value = "得分") - private Integer score; - - @ApiModelProperty(value = "班级id(用于区分学生端同一考核下,该生在两个不同的班级需要进入两次)") - private Integer classId; - - @ApiModelProperty(value = "考试状态(0、未考 1、在考 2、已考)") - private Integer state; - - @ApiModelProperty(value = "学生开考时间") - private Date examTime; - - @ApiModelProperty(value = "学生结束时间") - private Date stopTime; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/City.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/City.java deleted file mode 100644 index f02d1f4..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/City.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableField; - -import java.io.Serializable; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 城市 - *

- * - * @author lr - * @since 2021-08-10 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_city") -@ApiModel(value = "City对象", description = "城市") -public class City implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "城市主键ID") - @TableField("cityId") - private Integer cityId; - - @ApiModelProperty(value = "城市名称") - @TableField("cityName") - private String cityName; - - @ApiModelProperty(value = "绑定省份ID") - @TableField("provinceId") - private Integer provinceId; - - @ApiModelProperty(value = "是否删除(0、为删除 1、已删除)") - private Integer isdel; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/Class.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/Class.java deleted file mode 100644 index d7d576f..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/Class.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.*; - -import java.io.Serializable; -import java.util.Date; -import java.util.List; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 班级表 - *

- * - * @author lr - * @since 2021-08-18 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_class") -@ApiModel(value = "Class对象", description = "班级表") -public class Class implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "主键id") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "班级名称") - private String className; - - @ApiModelProperty(value = "学生架构id(ol_architecture表)") - private Integer architectureId; - - @TableLogic - @ApiModelProperty(value = "是否删除(0、未删除 1、已删除)") - private Integer isDel; - - @ApiModelProperty(value = "创建时间") - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - @ApiModelProperty(value = "备注") - private String remark; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/ClientManagement.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/ClientManagement.java deleted file mode 100644 index 0bb1410..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/ClientManagement.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import java.io.Serializable; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 企业端客户管理 - *

- * - * @author lr - * @since 2021-08-10 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_client_management") -@ApiModel(value="ClientManagement对象", description="企业端客户管理") -public class ClientManagement implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "主键id") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "客户名称") - private String clientName; - - @ApiModelProperty(value = "省份id") - private Integer provinceId; - - @ApiModelProperty(value = "城市id") - private Integer cityId; - - @ApiModelProperty(value = "联系人姓名") - private String contactPersonName; - - @ApiModelProperty(value = "手机号") - private String phone; - - @ApiModelProperty(value = "省份名称") - private String provinceName; - - @ApiModelProperty(value = "城市名称") - private String cityName; - - @ApiModelProperty(value = "客户类型") - private Integer type; - - @ApiModelProperty(value = "是否禁用(0、未禁用 1、已禁用)") - private Integer isDisable; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/Column.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/Column.java deleted file mode 100644 index 328739a..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/Column.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.*; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.Date; -import java.util.List; - -/** - *

- * 栏目表 - *

- * - * @author lr - * @since 2021-08-10 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_column") -@ApiModel(value = "Column对象", description = "栏目表") -public class Column implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "栏目id") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "父栏目id,一级栏目的父id是0", example = "0") - private Integer parentId; - - @ApiModelProperty(value = "栏目名称", example = "测试栏目") - private String name; - - @ApiModelProperty(value = "排序号", example = "0") - private Integer sort; - - @ApiModelProperty(value = "层级", example = "0") - private Integer level; - - @ApiModelProperty(value = "平台id", example = "3") - private Integer platformId; - - @ApiModelProperty(value = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - @ApiModelProperty(value = "更新时间") - @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") - @TableField(fill = FieldFill.INSERT_UPDATE) - private Date updateTime; - - @ApiModelProperty(value = "是否删除") - @TableLogic(value = "0",delval = "1") - private Integer isDel; - - @ApiModelProperty(value = "学校id") - private Integer schoolId; - - @ApiModelProperty(value = "子级") - @TableField(exist = false) - private List children; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/Contest.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/Contest.java deleted file mode 100644 index 4c3cdfd..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/Contest.java +++ /dev/null @@ -1,125 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.*; - -import java.util.Date; - -import java.io.Serializable; -import java.util.List; - -import com.huoran.occupationlab.entity.resp.ContestRangeResp; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 竞赛管理表 - *

- * - * @author lr - * @since 2021-08-10 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_contest") -@ApiModel(value = "Contest对象", description = "竞赛管理表") -public class Contest implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "主键") - @TableId(value = "id", type = IdType.ID_WORKER_STR) - private String id; - - @ApiModelProperty(value = "创建人Id", example = "1") - private String founderId; - - @ApiModelProperty(value = "创建人名称", example = "张三李四王五") - private String founderName; - - @ApiModelProperty(value = "竞赛名称", example = "数据库数据库色即是空") - private String name; - - @ApiModelProperty(value = "竞赛封面图", example = "http://localhost:9400/occupationlab/doc.html") - private String coverUrl; - - @ApiModelProperty(value = "竞赛轮播图", example = "http://localhost:9400/occupationlab/doc.html") - private String carouselUrl; - - @ApiModelProperty(value = "主办方", example = "或然科技") - private String sponsor; - - @ApiModelProperty(value = "承办方", example = "或然科技") - private String undertaker; - - @ApiModelProperty(value = "竞赛描述", example = "或然科技赛事") - private String description; - - @ApiModelProperty(value = "发布状态(0未发布,1已发布)", example = "0") - private Integer publishStatus; - - - @ApiModelProperty(value = "竞赛开始时间", example = "2021-09-09 16:24:24") - private Date playStartTime; - - @ApiModelProperty(value = "竞赛结束时间", example = "2021-09-20 16:24:24") - private Date playEndTime; - - @ApiModelProperty(value = "报名开始时间", example = "2021-09-10 16:24:24") - private Date signUpStartTime; - - @ApiModelProperty(value = "报名结束时间", example = "2021-09-20 16:24:24") - private Date signUpEndTime; - - @ApiModelProperty(value = "创建时间") - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - @ApiModelProperty(value = "更新时间") - @TableField(fill = FieldFill.INSERT_UPDATE) - private Date updateTime; - - @ApiModelProperty(value = "学校id", example = "0") - private Integer schoolId; - - - @ApiModelProperty(value = "平台来源(0:中台,1:职站)", example = "0") - private Integer platformSource; - - @ApiModelProperty(value = "大赛范围(0:本校内 1:全平台 2:指定区域、院校)", example = "0") - private Integer competitionScope; - - - @ApiModelProperty(value = "中台是否开启(0开启 1未开启 默认0)", example = "0") - private Integer ztOpen; - - @ApiModelProperty(value = "是否开启(0开启 1未开启 默认0)", example = "0") - private Integer isOpen; - - - @ApiModelProperty(value = "赛事附件") - @TableField(exist = false) - private List contestAnnexList; - - - @ApiModelProperty(value = "大赛范围选择") - @TableField(exist = false) - private List contestRangeList; - - - - @ApiModelProperty(value = "比赛范围") - @TableField(exist = false) - private String range; - - @ApiModelProperty(value = "比赛范围(省市学校集合)") - @TableField(exist = false) - private List contestRangeRespList; - /* @ApiModelProperty(value = "学生参加状态(0未发布,1已发布)", example = "0") - @TableField(exist = false) - private Integer stuStatus;*/ -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/ContestAnnex.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/ContestAnnex.java deleted file mode 100644 index dfd59fd..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/ContestAnnex.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.*; - -import java.util.Date; -import java.io.Serializable; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 赛事附件 - *

- * - * @author lr - * @since 2022-06-16 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_contest_annex") -@ApiModel(value="ContestAnnex对象", description="赛事/公告附件") -public class ContestAnnex implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "竞赛附件主键") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "大赛主键(ol_contest表主键)") - private String contestId; - - @ApiModelProperty(value = "文件名称") - private String fileName; - - @ApiModelProperty(value = "文件路径") - private String filePath; - - @ApiModelProperty(value = "创建时间") - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - @ApiModelProperty(value = "更新时间") - @TableField(fill = FieldFill.INSERT_UPDATE) - private Date updateTime; - - @ApiModelProperty(value = "是否删除(默认0 1为已删除)") - @TableLogic - private Integer isDel; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/ContestAnnouncement.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/ContestAnnouncement.java deleted file mode 100644 index 6b1c62d..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/ContestAnnouncement.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.*; - -import java.util.Date; -import java.io.Serializable; -import java.util.List; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 赛事公告 - *

- * - * @author lr - * @since 2022-06-17 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_contest_announcement") -@ApiModel(value="ContestAnnouncement对象", description="赛事公告") -public class ContestAnnouncement implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "竞赛公告主键") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "大赛主键(ol_contest表主键)") - private String contestId; - - @ApiModelProperty(value = "公告标题") - private String announcementTitle; - - @ApiModelProperty(value = "公告正文") - private String announcementText; - - @ApiModelProperty(value = "创建时间") - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - @ApiModelProperty(value = "更新时间") - @TableField(fill = FieldFill.INSERT_UPDATE) - private Date updateTime; - - @ApiModelProperty(value = "是否删除(默认0 1为已删除)") - @TableLogic - private Integer isDel; - - @ApiModelProperty(value = "创建人id") - private Integer accountId; - - @ApiModelProperty(value = "0草稿 1为已发布") - private Integer status; - - @ApiModelProperty(value = "是否开启(0开启 1未开启 默认0)") - private Integer isOpen; - - - @ApiModelProperty(value = "创建人(列表展示)") - @TableField(exist = false) - private String founderName; - - @ApiModelProperty(value = "大赛公告附件存储集合") - @TableField(exist = false) - private List announcementAnnexList; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/ContestAnnouncementAnnex.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/ContestAnnouncementAnnex.java deleted file mode 100644 index 16d9b1d..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/ContestAnnouncementAnnex.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.*; - -import java.util.Date; -import java.io.Serializable; -import java.util.List; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 大赛公告附件存储 - *

- * - * @author lr - * @since 2022-06-17 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_contest_announcement_annex") -@ApiModel(value = "大赛公告附件存储", description = "大赛公告附件存储") -public class ContestAnnouncementAnnex implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "竞赛附件主键") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "大赛公告主键(ol_contest_announcement表主键)") - private String announcementId; - - @ApiModelProperty(value = "文件名称") - private String fileName; - - @ApiModelProperty(value = "文件路径") - private String filePath; - - @ApiModelProperty(value = "创建时间") - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - @ApiModelProperty(value = "更新时间") - @TableField(fill = FieldFill.INSERT_UPDATE) - private Date updateTime; - - @ApiModelProperty(value = "是否删除(默认0 1为已删除)") - @TableLogic - private Integer isDel; - - - @ApiModelProperty(value = "是否删除(默认0 1为已删除)") - @TableField(exist = false) - List contestAnnouncementAnnexList; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/ContestProgress.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/ContestProgress.java deleted file mode 100644 index 035b0ff..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/ContestProgress.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; - -import java.util.Date; - -import com.baomidou.mybatisplus.annotation.TableId; - -import java.io.Serializable; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 竞赛进展表 - *

- * - * @author lr - * @since 2021-08-10 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_contest_progress") -@ApiModel(value = "ContestProgress对象", description = "竞赛进展表") -public class ContestProgress implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "主键") - @TableId(value = "id", type = IdType.ID_WORKER_STR) - private String id; - - @ApiModelProperty(value = "竞赛进展标题", example = "竞赛进展标题") - private String title; - - @ApiModelProperty(value = "竞赛主键Id", example = "1") - private String contestId; - - @ApiModelProperty(value = "竞赛进展状态(0未完成,1进行中,2已完成)", example = "0") - private Integer status; - - @ApiModelProperty(value = "竞赛进展描述", example = "竞赛进展描述") - private String description; - - @ApiModelProperty(value = "创建时间") - private Date gmtCreate; - - @ApiModelProperty(value = "修改时间") - private Date gmtModified; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/ContestRange.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/ContestRange.java deleted file mode 100644 index 6bb87bf..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/ContestRange.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; - -import java.io.Serializable; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * - *

- * - * @author lr - * @since 2022-06-16 - */ -@Data -@ApiModel(value = "大赛范围选择") -@TableName("ol_contest_range") -public class ContestRange implements Serializable { - - private static final long serialVersionUID = 1L; - - @TableId(type = IdType.AUTO) - @ApiModelProperty(value = "主键") - private Integer id; - - @ApiModelProperty(value = "竞赛主键") - private String contestId; - - @ApiModelProperty(value = "省") - private String provinceId; - - @ApiModelProperty(value = "市") - private String cityId; - - @ApiModelProperty(value = "学校id") - private String schoolId; - - @ApiModelProperty(value = "范围类型(0为学校 1为地区)") - private Integer type; - - @ApiModelProperty(value = "是否删除(默认0 ,1为已删除)") - @TableLogic - private Integer isDel; -} \ No newline at end of file diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/Course.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/Course.java deleted file mode 100644 index 8834c27..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/Course.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.Date; - -/** - *

- * 企业课程表 - *

- * - * @author lr - * @since 2021-08-10 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_course") -@ApiModel(value = "Course对象", description = "企业课程表") -public class Course implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "课程ID") - @TableId(value = "id", type = IdType.ID_WORKER_STR) - private String id; - - @ApiModelProperty(value = "课程名称") - private String name; - - @ApiModelProperty(value = "课程封面图片路径") - private String coverUrl; - - @ApiModelProperty(value = "创建人ID") - private String founderId; - - @ApiModelProperty(value = "创建人名称") - private String founderName; - - @ApiModelProperty(value = "课程类别ID") - private String classificationId; - - @ApiModelProperty(value = "是否启用(0启用,1未启用)") - private Integer isEnable; - - @ApiModelProperty(value = "课程描述") - private String description; - - @ApiModelProperty(value = "创建时间") - private Date gmtCreate; - - @ApiModelProperty(value = "更新时间") - private Date gmtModified; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/CourseChapter.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/CourseChapter.java deleted file mode 100644 index 391657c..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/CourseChapter.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; - -import java.util.Date; - -import com.baomidou.mybatisplus.annotation.TableId; - -import java.io.Serializable; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 企业课程章节表 - *

- * - * @author lr - * @since 2021-08-10 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_course_chapter") -@ApiModel(value = "CourseChapter对象", description = "企业课程章节表") -public class CourseChapter implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "章节ID") - @TableId(value = "id", type = IdType.ID_WORKER_STR) - private String id; - - @ApiModelProperty(value = "章节名称", example = "章节名称") - private String name; - - @ApiModelProperty(value = "课程ID", example = "1436155708163129346") - private String courseId; - - @ApiModelProperty(value = "显示排序", example = "0") - private Integer sort; - - @ApiModelProperty(value = "创建时间") - private Date gmtCreate; - - @ApiModelProperty(value = "更新时间") - private Date gmtModified; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/CourseClassification.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/CourseClassification.java deleted file mode 100644 index 28d85a6..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/CourseClassification.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; -import java.util.Date; -import com.baomidou.mybatisplus.annotation.TableId; -import java.io.Serializable; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 企业课程分类表 - *

- * - * @author lr - * @since 2021-08-10 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_course_classification") -@ApiModel(value="CourseClassification对象", description="企业课程分类表") -public class CourseClassification implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "课程类别ID") - @TableId(value = "id", type = IdType.ID_WORKER_STR) - private String id; - - @ApiModelProperty(value = "类别名称") - private String name; - - @ApiModelProperty(value = "创建时间") - private Date gmtCreate; - - @ApiModelProperty(value = "更新时间") - private Date gmtModified; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/CourseSubsection.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/CourseSubsection.java deleted file mode 100644 index 2312ef9..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/CourseSubsection.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.Date; - -/** - *

- * 企业课程小节表 - *

- * - * @author lr - * @since 2021-08-10 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_course_subsection") -@ApiModel(value = "CourseSubsection对象", description = "企业课程小节表") -public class CourseSubsection implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "小节ID") - @TableId(value = "id", type = IdType.ID_WORKER_STR) - private String id; - - @ApiModelProperty(value = "小节名称", example = "2021年9月10日11:13:22") - private String name; - - @ApiModelProperty(value = "课程ID", example = "1436155708163129346") - private String courseId; - - @ApiModelProperty(value = "章节ID",example = "1436155708163124569") - private String chapterId; - - @ApiModelProperty(value = "资源文件ID") - private String fileId; - - @ApiModelProperty(value = "文件存储路径") - private String fileUrl; - - @ApiModelProperty(value = "资源文件类型") - private String fileType; - - @ApiModelProperty(value = "阿里云文件名称") - private String fileName; - - @ApiModelProperty(value = "原始文件名称") - private String originalFileName; - - @ApiModelProperty(value = "排序字段") - private Integer sort; - - @ApiModelProperty(value = "创建时间") - private Date gmtCreate; - - @ApiModelProperty(value = "更新时间") - private Date gmtModified; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/EduCourse.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/EduCourse.java deleted file mode 100644 index 354cb51..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/EduCourse.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; -import java.io.Serializable; -import java.util.Date; - -/** - *

- * 课程基本信息 - *

- * - * @author lr - * @since 2021-08-10 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_edu_course") -@ApiModel(value = "EduCourse对象", description = "课程基本信息") -public class EduCourse implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "课程ID") - @TableId(value = "id", type = IdType.ID_WORKER_STR) - private String id; - - @ApiModelProperty(value = "课程名称", example = "电子竞技教学课程") - private String name; - - @ApiModelProperty(value = "课程封面图片路径", example = "www.baidu.com") - private String coverUrl; - - @ApiModelProperty(value = "学校id", example = "1", hidden = true) - private String schoolId; - - @ApiModelProperty(value = "创建人ID", example = "1", hidden = true) - private String founderId; - - @ApiModelProperty(value = "创建人名称", example = "刘怼怼") - private String founderName; - - @ApiModelProperty(value = "课程类别ID", example = "1436149119016452097") - private String classificationId; - - @ApiModelProperty(value = "是否启用(0启用,1未启用)", example = "0") - private Integer isEnable; - - @ApiModelProperty(value = "内置标识:1为内置课程,0为自己添加", example = "0") - @TableField(exist = false) - private Integer builtIn; - - @ApiModelProperty(value = "课程描述", example = "如果请求瞬间增多,超过最大处理请求,会导致系统奔溃。加以限制,让系统慢慢处理,就可以缓解请求突增的情况。") - private String description; - - @ApiModelProperty(value = "创建时间") - private Date gmtCreate; - - @ApiModelProperty(value = "更新时间") - private Date gmtModified; - - @ApiModelProperty(value = "区分标识:1为企业端课程,0为管理端课程", example = "0") - private Integer distinguish; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/EduCourseChapter.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/EduCourseChapter.java deleted file mode 100644 index a80759b..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/EduCourseChapter.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; -import java.util.Date; -import com.baomidou.mybatisplus.annotation.TableId; -import java.io.Serializable; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 课程章节 - *

- * - * @author lr - * @since 2021-08-10 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_edu_course_chapter") -@ApiModel(value="EduCourseChapter对象", description="课程章节") -public class EduCourseChapter implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "章节ID") - @TableId(value = "id", type = IdType.ID_WORKER_STR) - private String id; - - @ApiModelProperty(value = "章节名称") - private String name; - - @ApiModelProperty(value = "课程ID") - private String courseId; - - @ApiModelProperty(value = "显示排序") - private Integer sort; - - @ApiModelProperty(value = "创建时间") - private Date gmtCreate; - - @ApiModelProperty(value = "更新时间") - private Date gmtModified; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/EduCourseClassification.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/EduCourseClassification.java deleted file mode 100644 index 694a4c2..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/EduCourseClassification.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.Date; - -/** - *

- * 课程类别 - *

- * - * @author lr - * @since 2021-08-10 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_edu_course_classification") -@ApiModel(value = "EduCourseClassification对象", description = "课程类别") -public class EduCourseClassification implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "课程类别ID") - @TableId(value = "id", type = IdType.ID_WORKER_STR) - private String id; - - @ApiModelProperty(value = "类别名称") - private String name; - - @ApiModelProperty(value = "区分标识:1为企业端分类,0为管理端分类") - private Integer distinguish; - - @ApiModelProperty(value = "创建时间") - private Date gmtCreate; - - @ApiModelProperty(value = "更新时间") - private Date gmtModified; - - @TableField(exist = false) - private Integer schoolId; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/EduCourseSubsection.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/EduCourseSubsection.java deleted file mode 100644 index d98d247..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/EduCourseSubsection.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; -import java.util.Date; -import com.baomidou.mybatisplus.annotation.TableId; -import java.io.Serializable; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 课程小节 - *

- * - * @author lr - * @since 2021-08-10 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_edu_course_subsection") -@ApiModel(value="EduCourseSubsection对象", description="课程小节") -public class EduCourseSubsection implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "小节ID") - @TableId(value = "id", type = IdType.ID_WORKER_STR) - private String id; - - @ApiModelProperty(value = "小节名称") - private String name; - - @ApiModelProperty(value = "课程ID") - private String courseId; - - @ApiModelProperty(value = "章节ID") - private String chapterId; - - @ApiModelProperty(value = "资源文件ID") - private String fileId; - - @ApiModelProperty(value = "文件存储路径") - private String fileUrl; - - @ApiModelProperty(value = "资源文件类型") - private String fileType; - - @ApiModelProperty(value = "阿里云文件名称") - private String fileName; - - @ApiModelProperty(value = "原始文件名称") - private String originalFileName; - - @ApiModelProperty(value = "排序字段") - private Integer sort; - - @ApiModelProperty(value = "创建时间") - private Date gmtCreate; - - @ApiModelProperty(value = "更新时间") - private Date gmtModified; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/EntrepreneurialActivity.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/EntrepreneurialActivity.java deleted file mode 100644 index 7007074..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/EntrepreneurialActivity.java +++ /dev/null @@ -1,117 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.*; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.io.Serializable; -import java.util.Date; -import java.util.List; - -/** - * @描述:创业活动管理表 - * @作者: Rong - * @日期: 2023-04-27 - */ -@Data -@ApiModel(value = "创业活动管理表") -@TableName("ol_entrepreneurial_activity") -public class EntrepreneurialActivity implements Serializable { - - private static final long serialVersionUID = 1L; - - @TableId(type = IdType.AUTO) - @ApiModelProperty(value = "主键") - private Integer id; - - @ApiModelProperty(value = "创建人id") - private Integer accountId; - - @ApiModelProperty(value = "学校id") - private Integer schoolId; - - @ApiModelProperty(value = "创建人角色(0、系统 1、老师 2、学生)") - private Integer founder; - - @ApiModelProperty(value = "发布状态(默认0、草稿箱 1、已发布)") - private Integer publishStatus; - - @ApiModelProperty(value = "项目名称") - private String projectName; - - @ApiModelProperty(value = "发起人(可多选,用逗号隔开)") - private String initiator; - - @ApiModelProperty(value = "项目封面图") - private String coverUrl; - - @ApiModelProperty(value = "项目轮播图") - private String carouselUrl; - - @ApiModelProperty(value = "项目开始时间") - private Date playStartTime; - - @ApiModelProperty(value = "项目结束时间") - private Date playEndTime; - - @ApiModelProperty(value = "报名开始时间") - private Date signUpStartTime; - - @ApiModelProperty(value = "报名结束时间") - private Date signUpEndTime; - - @ApiModelProperty(value = "创建时间") - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - @ApiModelProperty(value = "更新时间") - @TableField(fill = FieldFill.INSERT_UPDATE) - private Date updateTime; - - @ApiModelProperty(value = "是否开启(0开启 1未开启 默认0)") - private Integer isOpen; - - @ApiModelProperty(value = "用于教师端控制学生端是否开启(0开启 1未开启 默认0)") - private Integer schoolOpen; - - @ApiModelProperty(value = "项目描述") - private String projectDescribe; - - @ApiModelProperty(value = "邀请码") - private String invitationCode; - - @ApiModelProperty(value = "是否需要邀请码(0不需要,1需要)默认为0") - private Integer isNeedCode; - - @ApiModelProperty(value = "报名人数限制(0表示不限制)默认为0") - private Integer maximumNumber; - - @ApiModelProperty(value = "是否删除(0、未删除 1、已删除 默认0)") - @TableLogic(value = "0", delval = "1") - private Integer isDel; - - - @ApiModelProperty(value = "活动附件") - @TableField(exist = false) - private List activityFileList; - - - @ApiModelProperty(value = "是否报名(0为已报名 1为未报名)", example = "0") - @TableField(exist = false) - private Integer whetherToSignUp; - - @ApiModelProperty(value = "取消报名传的id", example = "0") - @TableField(exist = false) - private Integer cancelId; - - - @ApiModelProperty(value = "是否收藏:(state = 1收藏,0:未收藏)") - @TableField(exist = false) - private Integer collectionStatus; - - - @ApiModelProperty(value = "收藏人数") - @TableField(exist = false) - private Integer collectorsNum; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/EntrepreneurialActivityAnnouncement.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/EntrepreneurialActivityAnnouncement.java deleted file mode 100644 index 5753866..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/EntrepreneurialActivityAnnouncement.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.*; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.Date; -import java.util.List; - -/** - *

- * 活动公告表 - *

- * - * @author lr - * @since 2023-05-12 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_entrepreneurial_activity_announcement") -@ApiModel(value="EntrepreneurialActivityAnnouncement对象", description="活动公告表") -public class EntrepreneurialActivityAnnouncement implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "活动公告主键") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "活动主键(ol_entrepreneurial_activity表主键)") - private Integer activityId; - - @ApiModelProperty(value = "公告标题") - private String announcementTitle; - - @ApiModelProperty(value = "公告正文") - private String announcementText; - - @ApiModelProperty(value = "0草稿 1为已发布") - private Integer status; - - @ApiModelProperty(value = "是否开启(0开启 1未开启 默认0)") - private Integer isOpen; - - @ApiModelProperty(value = "创建人") - private Integer accountId; - - @ApiModelProperty(value = "创建时间") - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - @ApiModelProperty(value = "更新时间") - @TableField(fill = FieldFill.INSERT_UPDATE) - private Date updateTime; - - @ApiModelProperty(value = "是否删除(默认0 1为已删除)") - @TableLogic - private Integer isDel; - - @ApiModelProperty(value = "大赛公告附件存储集合") - @TableField(exist = false) - private List announcementAnnexList; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/EntrepreneurialActivityAnnouncementAnnex.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/EntrepreneurialActivityAnnouncementAnnex.java deleted file mode 100644 index 1477153..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/EntrepreneurialActivityAnnouncementAnnex.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.*; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.Date; - -/** - *

- * 活动公告附件表 - *

- * - * @author lr - * @since 2023-05-12 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_entrepreneurial_activity_announcement_annex") -@ApiModel(value="EntrepreneurialActivityAnnouncementAnnex对象", description="活动公告附件表") -public class EntrepreneurialActivityAnnouncementAnnex implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "活动附件主键") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "活动公告主键(ol_entrepreneurial_activity_announcement表主键)") - private Integer announcementId; - - @ApiModelProperty(value = "文件名称") - private String fileName; - - @ApiModelProperty(value = "文件路径") - private String filePath; - - @ApiModelProperty(value = "创建时间") - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - @ApiModelProperty(value = "更新时间") - @TableField(fill = FieldFill.INSERT_UPDATE) - private Date updateTime; - - @ApiModelProperty(value = "是否删除(默认0 1为已删除)") - @TableLogic - private Integer isDel; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/EntrepreneurialActivityApplicant.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/EntrepreneurialActivityApplicant.java deleted file mode 100644 index be60561..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/EntrepreneurialActivityApplicant.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.*; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.Date; - -/** - *

- * 创业活动报名人员表 - *

- * - * @author lr - * @since 2023-04-27 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_entrepreneurial_activity_applicant") -@ApiModel(value="EntrepreneurialActivityApplicant对象", description="创业活动报名人员表") -public class EntrepreneurialActivityApplicant implements Serializable { - - private static final long serialVersionUID = 1L; - - @TableId(type = IdType.AUTO) - @ApiModelProperty(value = "主键") - private Integer id; - - @ApiModelProperty(value = "报名账号id") - private Integer accountId; - - @ApiModelProperty(value = "活动主键Id") - private Integer activityId; - - @ApiModelProperty(value = "是否禁用(0未禁用,1禁用)") - private Integer isDisable; - - @ApiModelProperty(value = "创建时间") - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - @ApiModelProperty(value = "更新时间") - @TableField(fill = FieldFill.INSERT_UPDATE) - private Date updateTime; - - - @ApiModelProperty(value = "学校id") - private Integer schoolId; - - - - @ApiModelProperty(value = "报名邀请码") - @TableField(exist = false) - private String registrationInvitationCode; - - @ApiModelProperty(value = "是否需要邀请码(0不需要,1需要)默认为0") - @TableField(exist = false) - private Integer isNeedCode; - - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/EntrepreneurialActivityCollect.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/EntrepreneurialActivityCollect.java deleted file mode 100644 index ea3aa24..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/EntrepreneurialActivityCollect.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; -import java.util.Date; -import com.baomidou.mybatisplus.annotation.TableId; -import java.io.Serializable; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 活动收藏表 - *

- * - * @author lr - * @since 2023-06-01 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_entrepreneurial_activity_collect") -@ApiModel(value="EntrepreneurialActivityCollect对象", description="活动收藏表") -public class EntrepreneurialActivityCollect implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "活动收藏id") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "活动id") - private Integer activityId; - - @ApiModelProperty(value = "收藏时间") - private Date collectionTime; - - @ApiModelProperty(value = "账号id") - private Integer accountId; - - @ApiModelProperty(value = "学校id") - private Integer schoolId; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/EntrepreneurialActivityFile.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/EntrepreneurialActivityFile.java deleted file mode 100644 index ad188ef..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/EntrepreneurialActivityFile.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.*; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.Date; - -/** - *

- * 创业活动附件存储 - *

- * - * @author lr - * @since 2023-04-26 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_entrepreneurial_activity_file") -@ApiModel(value = "EntrepreneurialActivityFile对象", description = "创业活动附件存储") -public class EntrepreneurialActivityFile implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "创业活动附件主键") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "创业活动主键(ol_entrepreneurial_activity表主键)") - private Integer activityId; - - @ApiModelProperty(value = "文件名称") - private String fileName; - - @ApiModelProperty(value = "文件路径") - private String filePath; - - @ApiModelProperty(value = "创建时间") - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - @ApiModelProperty(value = "更新时间") - @TableField(fill = FieldFill.INSERT_UPDATE) - private Date updateTime; - - @ApiModelProperty(value = "是否删除(默认0 1为已删除)") - @TableLogic - private Integer isDel; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/EntrepreneurialActivityProgress.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/EntrepreneurialActivityProgress.java deleted file mode 100644 index 1db73b4..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/EntrepreneurialActivityProgress.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.*; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.Date; - -/** - *

- * 活动进展表 - *

- * - * @author lr - * @since 2023-05-12 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_entrepreneurial_activity_progress") -@ApiModel(value="EntrepreneurialActivityProgress对象", description="活动进展表") -public class EntrepreneurialActivityProgress implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "主键") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "活动进展标题") - private String title; - - @ApiModelProperty(value = "活动主键Id(c_competition表主键)") - private Integer activityId; - - @ApiModelProperty(value = "活动进展状态(0未完成,1进行中,2已完成)") - private Integer status; - - @ApiModelProperty(value = "活动进展描述") - private String description; - - @ApiModelProperty(value = "创建时间") - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - @ApiModelProperty(value = "更新时间") - @TableField(fill = FieldFill.INSERT_UPDATE) - private Date updateTime; - - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/EvaluationFraction.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/EvaluationFraction.java deleted file mode 100644 index 94526cd..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/EvaluationFraction.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import java.io.Serializable; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 记录用户能力测评的总分数 - *

- * - * @author lr - * @since 2021-09-26 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_evaluation_fraction") -@ApiModel(value="EvaluationFraction对象", description="记录用户能力测评的总分数") -public class EvaluationFraction implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "主键id") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "绑定用户id") - private Integer accountId; - - @ApiModelProperty(value = "测评类型(1练习 2虚拟仿真实验 3教学实验 默认1)") - private Integer types; - - @ApiModelProperty(value = "总分数") - private Integer fraction; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/EvaluationQuestion.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/EvaluationQuestion.java deleted file mode 100644 index 2dd8145..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/EvaluationQuestion.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import java.io.Serializable; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 测评试题表,记录每次测评的试题,与测评记录表相关联 - *

- * - * @author lr - * @since 2021-09-26 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_evaluation_question") -@ApiModel(value="EvaluationQuestion对象", description="测评试题表,记录每次测评的试题,与测评记录表相关联") -public class EvaluationQuestion implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "自增主键") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "测评记录表id") - private Integer evaluationRecordId; - - @ApiModelProperty(value = "试题id") - private Integer questionId; - - @ApiModelProperty(value = "试题顺序号") - private Integer questionSortNo; - - @ApiModelProperty(value = "试题状态:是否已被作过:1、已作/0、未作") - private Integer questionStatus; - - @ApiModelProperty(value = "用户填写的答案") - private String userAnswer; - - @ApiModelProperty(value = "是否正确:1、正确/0、错误") - private Integer isTure; - - @ApiModelProperty(value = "试题分值") - private Integer questionPoints; - - @ApiModelProperty(value = "试题得分") - private Integer questionScore; - - @ApiModelProperty(value = "测评类型(0虚拟仿真实验,1教学实验)") - private Integer type; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/EvaluationRecord.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/EvaluationRecord.java deleted file mode 100644 index 7977693..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/EvaluationRecord.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; -import java.util.Date; -import com.baomidou.mybatisplus.annotation.TableId; -import java.io.Serializable; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 记录用户测评信息 - *

- * - * @author lr - * @since 2021-09-26 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_evaluation_record") -@ApiModel(value="EvaluationRecord对象", description="记录用户测评信息") -public class EvaluationRecord implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "自增主键") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "当前测评的用户的id") - private Integer accountId; - - @ApiModelProperty(value = "记录当前做到第几题,用于刷新页面以后保持在当前题目,默认开始时是第一题") - private Integer currentQuestionSortNo; - - @ApiModelProperty(value = "总题目数量") - private Integer totalQuestionNum; - - @ApiModelProperty(value = "当前测评状态:1:已提交/0:未提交") - private Integer evaluationStatus; - - @ApiModelProperty(value = "开始时间") - private Date startTime; - - @ApiModelProperty(value = "提交时间") - private Date submitTime; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/EvaluationRules.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/EvaluationRules.java deleted file mode 100644 index cbe9853..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/EvaluationRules.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import java.io.Serializable; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 测评规则信息记录,只记录一条信息 - *

- * - * @author lr - * @since 2021-08-12 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_evaluation_rules") -@ApiModel(value="EvaluationRules对象", description="测评规则信息记录,只记录一条信息") -public class EvaluationRules implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "主键") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "测评类型:1:随机类型,0:自定义类型") - private Integer evaluationType; - - @ApiModelProperty(value = "测评时长,单位:分钟") - private Integer duration; - - @ApiModelProperty(value = "测评总题数") - private Integer questionNum; - - @ApiModelProperty(value = "单选题数") - private Integer singleNum; - - @ApiModelProperty(value = "只在类型为自定义类型时才启用:1:启用,0:不启用,默认1启用") - private Integer isSingleEnable; - - @ApiModelProperty(value = "多选题数") - private Integer multipleNum; - - @ApiModelProperty(value = "只在类型为自定义类型时才启用:1:启用,0:不启用,默认1启用") - private Integer isMultipleEnable; - - @ApiModelProperty(value = "判断题数") - private Integer judgmentNum; - - @ApiModelProperty(value = "只在类型为自定义类型时才启用:1:启用,0:不启用,默认1启用") - private Integer isJudgmentEnable; - - @ApiModelProperty(value = "学校id") - private Integer schoolId; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/ExperimentalReport.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/ExperimentalReport.java deleted file mode 100644 index c7c5ec7..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/ExperimentalReport.java +++ /dev/null @@ -1,145 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.*; - -import java.util.Date; - -import java.io.Serializable; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 存储各子系统的实验报告 - *

- * - * @author lr - * @since 2021-09-08 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_experimental_report") -@ApiModel(value = "ExperimentalReport对象", description = "存储各子系统的实验报告") -public class ExperimentalReport implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "实验报告主键") - @TableId(value = "report_id", type = IdType.AUTO) - private Integer reportId; - - @ApiModelProperty(value = "项目管理id") - private Integer projectId; - - @ApiModelProperty(value = "班级id") - private Integer classId; - - @ApiModelProperty(value = "课程id(curriculum表主键)") - private Integer curriculumId; - - @ApiModelProperty(value = "考核id(当进入的实验为练习时本列为空)") - private Integer assessmentId; - - @ApiModelProperty(value = "学生账号id") - private Integer accountId; - - @ApiModelProperty(value = "用户名称 (学生姓名)") - @TableField(exist = false) - private String userName; - - @ApiModelProperty(value = "学号") - @TableField(exist = false) - private String workNumber; - - @ApiModelProperty(value = "实验原理") - private String principle; - - @ApiModelProperty(value = "实验内容") - private String content; - - @ApiModelProperty(value = "实验步骤") - private String step; - - @ApiModelProperty(value = "实验数据") - private String data; - - @ApiModelProperty(value = "实验分析") - private String analysis; - - @ApiModelProperty(value = "实验结论") - private String conclusion; - - @ApiModelProperty(value = "实验总结") - private String summarize; - - @ApiModelProperty(value = "实验器材") - private String equipment; - - @ApiModelProperty(value = "实验目的") - private String purpose; - - @ApiModelProperty(value = "对本实验过程方法及手段的改进建议") - private String improvement; - - @ApiModelProperty(value = "绑定教师评语id") - private Integer commentId; - - @ApiModelProperty(value = "教师评语") - private String comment; - - @ApiModelProperty(value = "绑定老师id") - private Integer teacherId; - - @ApiModelProperty(value = "老师名称") - @TableField(exist = false) - private String teacherName; - - @ApiModelProperty(value = "学时") - private String period; - - @ApiModelProperty(value = "实验室名称") - private String laboratory; - - @ApiModelProperty(value = "是否启用教师签名(0不启用,1启用,默认0)") - private Integer isSignature; - - @ApiModelProperty(value = "绑定教师签名id") - private Integer signatureId; - - @ApiModelProperty(value = "指导老师:(考核的自动读取发布考核的老师名称,可修改)") - private String instructor; - - @ApiModelProperty(value = "实验项目名称:(自动读取,可修改)") - private String projectName; - - @ApiModelProperty(value = "学生班级:(自动读取学生班级,可修改)") - private String className; - - @ApiModelProperty(value = "得分") - private Integer score; - - @ApiModelProperty(value = "进入时间") - private Date startTime; - - @ApiModelProperty(value = "结束时间") - private Date endTime; - - @ApiModelProperty(value = "提交时间") - private Date submitTime; - - @ApiModelProperty(value = "耗时") - private Integer timeSum; - - @ApiModelProperty(value = "是否删除(0未删除1已删除 默认0)") - @TableLogic - private Integer isDel; - - @ApiModelProperty(value = "学校id") - private Integer schoolId; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/HrProject.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/HrProject.java deleted file mode 100644 index b5f0da4..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/HrProject.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.huoran.occupationlab.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; - -/** - * @description 爬虫迁移程序使用 其他地方勿用 - * @author: Mr.JK - * @create: 2021-10-20 10:36 - **/ -@Data -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -public class HrProject { - - private String projectName; - private Integer projectPermissions; - private Integer state; - private String experimentalGoal; - private String caseDescription; - private String experimentSuggests; - private Integer experimentIntroductionIsEnable; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/HrScore.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/HrScore.java deleted file mode 100644 index c9a109b..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/HrScore.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.huoran.occupationlab.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; - -/** - * @description 爬虫迁移程序使用 其他地方勿用 - * @author: Mr.JK - * @create: 2021-10-20 10:41 - **/ -@Data -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -public class HrScore { - - private String judgmentPointsName; - private Integer score; - private String experimentalRequirements; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/HrUserInfo.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/HrUserInfo.java deleted file mode 100644 index 7dd5edd..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/HrUserInfo.java +++ /dev/null @@ -1,129 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableField; -import java.io.Serializable; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 用户信息表 - *

- * - * @author lr - * @since 2021-08-10 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_hr_user_info") -@ApiModel(value="HrUserInfo对象", description="用户信息表") -public class HrUserInfo implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "用户id") - @TableId(value = "userId", type = IdType.AUTO) - private Integer userId; - - @ApiModelProperty(value = "用户姓名") - @TableField("userName") - private String userName; - - @ApiModelProperty(value = "唯一标识账号") - @TableField("uniqueIdentificationAccount") - private String uniqueIdentificationAccount; - - @ApiModelProperty(value = "证件类型(1、身份证)") - @TableField("documentType") - private Integer documentType; - - @ApiModelProperty(value = "证件号码") - @TableField("IDNumber") - private String IDNumber; - - @ApiModelProperty(value = "绑定省份id") - @TableField("provinceId") - private Integer provinceId; - - @ApiModelProperty(value = "绑定城市id") - @TableField("cityId") - private Integer cityId; - - @ApiModelProperty(value = "国家归属地") - private String countries; - - @ApiModelProperty(value = "出生日期") - @TableField("dateBirth") - private String dateBirth; - - @ApiModelProperty(value = "教育程度") - @TableField("educationDegree") - private Integer educationDegree; - - @ApiModelProperty(value = "绑定客户id") - @TableField("clientId") - private Integer clientId; - - @ApiModelProperty(value = "客户名称") - @TableField("clientName") - private String clientName; - - @ApiModelProperty(value = "电话") - private String phone; - - @ApiModelProperty(value = "微信号") - @TableField("weChatID") - private String weChatID; - - @ApiModelProperty(value = "邮箱") - private String email; - - @ApiModelProperty(value = "账号") - private String account; - - @ApiModelProperty(value = "密码") - private String password; - - @ApiModelProperty(value = "创建时间") - @TableField("creationTime") - private String creationTime; - - @ApiModelProperty(value = "登陆次数") - @TableField("logInNumber") - private Integer logInNumber; - - @ApiModelProperty(value = "性别(1、男 2、女)") - private Integer sex; - - @ApiModelProperty(value = "用户头像路径") - @TableField("userAvatars") - private String userAvatars; - - @ApiModelProperty(value = "是否删除(0、未删除 1、已删除)") - private Integer isdel; - - @ApiModelProperty(value = "最后登陆时间") - @TableField("lastLoginTime") - private String lastLoginTime; - - @ApiModelProperty(value = "绑定角色id") - @TableField("roleId") - private String roleId; - - @ApiModelProperty(value = "禁用状态(0未禁用1已禁用默认0)") - @TableField("disableAccount") - private Integer disableAccount; - - @ApiModelProperty(value = "端口(1、企业端 2、管理端)") - @TableField("isPort") - private Integer isPort; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/ImportStaff.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/ImportStaff.java deleted file mode 100644 index 846de54..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/ImportStaff.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.huoran.occupationlab.entity; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - *

- * 员工表 - *

- * - * @author Ning - * @since 2020-10-21 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@ApiModel(value = "导入Staff对象", description = "导入员工") -public class ImportStaff implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "员工主键ID") - private Integer staffId; - - @ApiModelProperty(value = "用户账号") - private String account; - - @ApiModelProperty(value = "用户姓名") - private String userName; - - @ApiModelProperty(value = "员工工号") - private String workNumber; - - @ApiModelProperty(value = "绑定角色ID") - private String roleId; - - @ApiModelProperty(value = "绑定角色名称") - private String roleName; - - @ApiModelProperty(value = "绑定客户id") - private Integer clientId; - - @ApiModelProperty(value = "绑定客户名称") - private String clientName; - - @ApiModelProperty(value = "绑定用户Id") - private Integer userId; - - @ApiModelProperty(value = "绑定手机号") - private String phone; - - @ApiModelProperty(value = "绑定邮箱") - private String email; - - @ApiModelProperty(value = "唯一标识账号") - private String uniqueIdentificationAccount; - - @ApiModelProperty(value = "员工年级Id") - private Integer staffGradeId; - - @ApiModelProperty(value = "员工组织架构Id") - private Integer staffProfessionalArchitectureId; - - @ApiModelProperty(value = "员工年级名称") - private String staffGradeName; - - @ApiModelProperty(value = "员工组织架构名称") - private String staffProfessionalArchitectureName; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/ImportStudent.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/ImportStudent.java deleted file mode 100644 index 8378817..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/ImportStudent.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.huoran.occupationlab.entity; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - *

- * 学生表 - *

- * - * @author Ning - * @since 2020-10-21 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@ApiModel(value = "导入Student对象", description = "导入学生表") -public class ImportStudent implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "学生主键ID") - private Integer studentId; - - @ApiModelProperty(value = "用户账号") - private String account; - - @ApiModelProperty(value = "用户姓名") - private String userName; - - @ApiModelProperty(value = "学生学号") - private String workNumber; - - @ApiModelProperty(value = "绑定角色ID") - private Integer roleId; - - @ApiModelProperty(value = "绑定客户id") - private Integer clientId; - - @ApiModelProperty(value = "绑定客户名称") - private String clientName; - - @ApiModelProperty(value = "绑定用户Id") - private Integer userId; - - @ApiModelProperty(value = "绑定手机号") - private String phone; - - @ApiModelProperty(value = "绑定邮箱") - private String email; - - @ApiModelProperty(value = "唯一标识账号") - private String uniqueIdentificationAccount; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/LcJudgmentRule.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/LcJudgmentRule.java deleted file mode 100644 index b3d2bc7..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/LcJudgmentRule.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.*; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.Date; - -/** - *

- * 流程类判分点规则表 - *

- * - * @author Mr.JK - * @since 2021-08-13 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@ApiModel(value="LcJudgmentRule对象", description="流程类判分点规则表") -public class LcJudgmentRule implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "主键id") - private Integer id; - - @ApiModelProperty(value = "操作id串") - private String operationIds; - - @ApiModelProperty(value = "题目类型(1选择 2判断 3填空 4问答 5指标结果)") - private String type; - - @ApiModelProperty(value = "流程类判分点id") - private Integer lcId; - - @ApiModelProperty(value = "选项id") - private Integer itemId; - - @ApiModelProperty(value = "空格一",notes = "选择题、判断题、填空题、指标结果填subject_id,、问答题填需要字段") - private String emptyOne; - - @ApiModelProperty(value = "空格二",notes = "选择题、判断题填item_id,填空题、问答题、指标结果填需要字段") - private String emptyTwo; - - @ApiModelProperty(value = "结果运算符(0为与 1为或 默认0)") - private Integer resultOperation; - - @ApiModelProperty(value = "规则运算符(0为与 1为或 默认0)") - private Integer ruleOperation; - - @ApiModelProperty(value = "是否删除(0 未删除 1已删除 默认0)") - @TableLogic(value = "0",delval = "1") - private Integer isDel; - - @ApiModelProperty(value = "创建时间") - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - @ApiModelProperty(value = "更新时间") - @TableField(fill = FieldFill.INSERT_UPDATE) - private Date updateTime; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/PlayRecord.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/PlayRecord.java deleted file mode 100644 index fbb6a9e..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/PlayRecord.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.*; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotNull; -import java.io.Serializable; -import java.util.Date; - -/** - *

- * 资源播放记录表 - *

- * - * @author lr - * @since 2022-09-09 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_play_record") -@ApiModel(value = "PlayRecord对象", description = "资源播放记录表") -public class PlayRecord implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "主键") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "课程类型(0:课程管理 1:理论课程)") - @NotNull(message = "课程类型不能为空!") - private Integer courseType; - - @ApiModelProperty(value = "课程id") - @NotNull(message = "课程id不能为空!") - private Integer courseId; - - @ApiModelProperty(value = "播放时长(分钟,不满1分钟视为1分钟)") - @NotNull(message = "播放时长不能为空!") - private Integer playTime; - - @ApiModelProperty(value = "账号id") - private Integer accountId; - - @ApiModelProperty(value = "学校id") - private Integer schoolId; - - @ApiModelProperty(value = "创建时间") - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - - @ApiModelProperty(value = "生成次数") - @TableField(exist = false) - private Integer num; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/ProjectHidden.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/ProjectHidden.java deleted file mode 100644 index a3653d8..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/ProjectHidden.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; -import java.util.Date; -import com.baomidou.mybatisplus.annotation.TableId; -import java.io.Serializable; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 此表是在教师端成绩管理,虚仿以及教学列表展示中使用到 - *

- * - * @author lr - * @since 2021-09-23 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_project_hidden") -@ApiModel(value="ProjectHidden对象", description="此表是在教师端成绩管理,虚仿以及教学列表展示中使用到") -public class ProjectHidden implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "主键") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "项目id(对应hr_project_management主键)") - private Integer projectId; - - @ApiModelProperty(value = "考核id(ol_assessment主键)") - private Integer teachId; - - @ApiModelProperty(value = "是否隐藏(0不隐藏,1隐藏)") - private Integer isHidden; - - private Date updateTime; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/ProjectJudgment.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/ProjectJudgment.java deleted file mode 100644 index 3da1bba..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/ProjectJudgment.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.*; - -import java.util.Date; -import java.io.Serializable; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotNull; - -/** - *

- * 项目管理判分点绑定表 - *

- * - * @author Mr.JK - * @since 2021-08-26 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_project_judgment") -@ApiModel(value="ProjectJudgment对象", description="项目管理判分点绑定表") -public class ProjectJudgment implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "主键id") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "分数") - private Integer score; - - @ApiModelProperty(value = "项目id") - private Integer projectId; - - @ApiModelProperty(value = "判分点id(编程与流程)系统id为11时,是流程类") - @NotNull(message = "判分点id不能为空!") - private Integer judgmentId; - - @ApiModelProperty(value = "排序顺序") - @NotNull(message = "排序不能为空") - private Integer sort; - - @ApiModelProperty(value = "是否删除(0未删除 1已删除 默认0)") - @TableLogic(value = "0",delval = "1") - private Integer isDel; - - @ApiModelProperty(value = "创建时间") - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - @ApiModelProperty(value = "更新时间") - @TableField(fill = FieldFill.INSERT_UPDATE) - private Date updateTime; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/ProjectManage.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/ProjectManage.java deleted file mode 100644 index 0dada4c..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/ProjectManage.java +++ /dev/null @@ -1,142 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.*; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import java.io.Serializable; -import java.util.Date; - -/** - *

- * 项目管理表 - *

- * - * @author Mr.JK - * @since 2021-08-26 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_project_manage") -@ApiModel(value = "ProjectManage对象", description = "项目管理表") -public class ProjectManage implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "主键id") - @TableId(value = "project_id", type = IdType.AUTO) - private Integer projectId; - - @ApiModelProperty(value = "项目名称") - @NotBlank(message = "项目名称不能为空!") - private String projectName; - - @ApiModelProperty(value = "项目权限(0、练习 1、考核 2、竞赛)") - @NotNull(message = "项目权限不能为空!") - private Integer permissions; - - @ApiModelProperty(value = "系统id") - @NotNull(message = "系统id不能为空!") - private Integer systemId; - - @ApiModelProperty(value = "系统名称") - @TableField(exist = false) - private String systemName; - - @ApiModelProperty(value = "账号id") - private Integer accountId; - - @ApiModelProperty(value = "学校id") - private Integer schoolId; - - @ApiModelProperty(value = "创建人角色(0、系统 1、院校)") - @NotNull(message = "创建人角色不能为空!") - private Integer founder; - - - @ApiModelProperty(value = "创建人") - @TableField(exist = false) - private String creator; - - - @ApiModelProperty(value = "状态(0、草稿箱 1、已发布)") - @NotNull(message = "状态不能为空!") - private Integer state; - - @ApiModelProperty(value = "系统类型(0编程类 1流程类)") - @TableField(exist = false) - private Integer type; - - @ApiModelProperty(value = "实验目标") - private String experimentTarget; - - @ApiModelProperty(value = "实验描述") - private String experimentDescription; - - @ApiModelProperty(value = "实验提示") - private String experimentHint; - - @ApiModelProperty(value = "实验提示是否开启(0开启 1不开启 默认0)") - private Integer hintOpen; - - @ApiModelProperty(value = "学校实验提示是否开启(0开启 1不开启)") - @TableField(exist = false) - private Integer hintOpenBySchool; - - @ApiModelProperty(value = "是否开启(0开启 1未开启 默认0)") - private Integer isOpen; - - @ApiModelProperty(value = "中台是否开启(0开启 1未开启 默认0)") - private Integer ztOpen; - - @ApiModelProperty(value = "是否删除(0、未删除 1、已删除 默认0)") - @TableLogic(value = "0", delval = "1") - private Integer isDel; - - @ApiModelProperty(value = "中台是否删除(0未删除 1已删除 默认0)") - private Integer ztDel; - - @ApiModelProperty(value = "创建时间") - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - @ApiModelProperty(value = "更新时间") - @TableField(fill = FieldFill.INSERT_UPDATE) - private Date updateTime; - - @ApiModelProperty(value = "是否为管理员发布 0否 1是") - @TableField(exist = false) - private Integer isAdminRelease; - - @ApiModelProperty(value = "学校名称") - @TableField(exist = false) - private String schoolName; - - @ApiModelProperty(value = "职站是否禁用启用(0启用 1已禁用)") - @TableField(exist = false) - private Integer ccupationlabOpen; - - @ApiModelProperty(value = "创建人") - @TableField(exist = false) - private String createUser; - - @ApiModelProperty(value = "项目发布人角色") - @TableField(exist = false) - private String roleName; - - @ApiModelProperty(value = "备注") - private String remark; - - - @ApiModelProperty(value = "商品id") - private Integer mallId; - - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/ProjectManageDisable.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/ProjectManageDisable.java deleted file mode 100644 index 6f26b52..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/ProjectManageDisable.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.*; - -import java.util.Date; -import java.io.Serializable; - -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 记录项目学校端的禁用记录 - *

- * - * @author lr - * @since 2022-01-12 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_project_manage_disable") -@ApiModel(value = "ProjectManageDisable对象", description = "记录项目学校端的禁用记录") -public class ProjectManageDisable implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "主键") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "学校id") - private Integer schoolId; - - @ApiModelProperty(value = "项目id") - private Integer projectId; - - @ApiModelProperty(value = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - @ApiModelProperty(value = "更新时间") - @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") - @TableField(fill = FieldFill.INSERT_UPDATE) - private Date updateTime; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/Province.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/Province.java deleted file mode 100644 index 6f2e33b..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/Province.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableField; -import java.io.Serializable; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 省份表 - *

- * - * @author lr - * @since 2021-08-10 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_province") -@ApiModel(value="Province对象", description="省份表") -public class Province implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "省份主键ID") - @TableId(value = "provinceId", type = IdType.AUTO) - private Integer provinceId; - - @ApiModelProperty(value = "省份名称") - @TableField("provinceName") - private String provinceName; - - @ApiModelProperty(value = "是否删除(0、为删除 1、已删除)") - private Integer isdel; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/PythonFileData.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/PythonFileData.java deleted file mode 100644 index 321fd13..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/PythonFileData.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.huoran.occupationlab.entity; - -import cn.afterturn.easypoi.excel.annotation.ExcelTarget; -import com.baomidou.mybatisplus.annotation.*; - -import java.util.Date; - -import java.io.Serializable; - -import com.huoran.common.utils.PageUtils; -import com.huoran.occupationlab.entity.req.PageReq; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * - *

- * - * @author lr - * @since 2022-04-06 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@ApiModel(value = "PythonFileData对象", description = "") -public class PythonFileData implements Serializable { - - private static final long serialVersionUID = 1L; - - @TableId(type = IdType.AUTO) - @ApiModelProperty(value = "主键") - private Integer id; - - @ApiModelProperty(value = "账号id") - private Integer accountId; - - @ApiModelProperty(value = "学校id") - private Integer schoolId; - - @ApiModelProperty(value = "文件名") - private String fileName; - - @ApiModelProperty(value = "文件大小") - private String fileSize; - - @ApiModelProperty(value = "文件格式") - private String fileFormat; - - @ApiModelProperty(value = "文件路径") - private String filePath; - - @ApiModelProperty(value = "oss文件名") - private String ossFileName; - - @ApiModelProperty(value = "创建时间") - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - @ApiModelProperty(value = "当前页数", name = "pageNum", example = "1", required = true, hidden = true) - @TableField(exist = false) - private Integer pageNum; - @ApiModelProperty(value = "当前页需要显示的数量", name = "pageSize", example = "10", required = true, hidden = true) - @TableField(exist = false) - private Integer pageSize; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/PythonRunCode.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/PythonRunCode.java deleted file mode 100644 index 795484d..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/PythonRunCode.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import java.util.Date; -import com.baomidou.mybatisplus.annotation.TableId; -import java.io.Serializable; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * python储存实验运行记录 - *

- * - * @author lr - * @since 2021-12-22 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@ApiModel(value="PythonRunCode对象", description="python储存实验运行记录") -public class PythonRunCode implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "实验代码主键Id") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "实验代码") - private String code; - - @ApiModelProperty(value = "绑定的项目id") - private Integer projectId; - - @ApiModelProperty(value = "判分点主键Id") - private Integer judgmentPointsId; - - @ApiModelProperty(value = "0未提交,1为已提交") - private Integer isSubmit; - - @ApiModelProperty(value = "运行结果") - private String runResult; - - @ApiModelProperty(value = "运行的图片") - private String runPhotoUrl; - - @ApiModelProperty(value = "运行有没有出现错误(0、运行正确 1、运行错误)") - private Integer isError; - - @ApiModelProperty(value = "绑定账号id") - private Integer accountId; - - @ApiModelProperty(value = "实验报告id(ol_experimental_report)") - private Integer reportId; - - @ApiModelProperty(value = "逻辑删除默认0未删除,1为已删除") - private Integer isDel; - - @ApiModelProperty(value = "运行时间") - private Date createTime; - - @ApiModelProperty(value = "修改时间") - private Date updateTime; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/PythonSystem.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/PythonSystem.java deleted file mode 100644 index 03429fc..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/PythonSystem.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import java.io.Serializable; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * python系统记录表 - *

- * - * @author lr - * @since 2021-08-19 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_python_system") -@ApiModel(value="PythonSystem对象", description="python系统记录表") -public class PythonSystem implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "主键") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "系统名称") - private String sysName; - - @ApiModelProperty(value = "后缀") - private String suffix; - - @ApiModelProperty(value = "逻辑删除(默认0 1为已删除)") - private Boolean isDel; - - @ApiModelProperty(value = "是否启用(默认0已启用 1为禁用)") - private Boolean isEnable; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/PythonTableData.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/PythonTableData.java deleted file mode 100644 index 8a9da8b..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/PythonTableData.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; - -import java.util.Date; - -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; - -import java.io.Serializable; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 储存全部python表数据表导出Excel路径 - *

- * - * @author lr - * @since 2022-08-12 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@ApiModel(value = "PythonTableData对象", description = "储存全部python表数据表导出Excel路径") -public class PythonTableData implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "主键") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "表名") - private String tableName; - - @ApiModelProperty(value = "文件名") - private String fileName; - - @ApiModelProperty(value = "文件大小") - private String fileSize; - - @ApiModelProperty(value = "文件格式") - private String fileFormat; - - @ApiModelProperty(value = "oss文件名") - private String ossFileName; - - @ApiModelProperty(value = "文件路径") - private String filePath; - - @ApiModelProperty(value = "创建时间") - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/Questions.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/Questions.java deleted file mode 100644 index 074566d..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/Questions.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.*; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; -import org.junit.jupiter.params.shadow.com.univocity.parsers.annotations.Validate; - -import javax.validation.Valid; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import java.io.Serializable; -import java.util.Date; - -/** - *

- * 测评管理-题库记录表 - *

- * - * @author lr - * @since 2021-08-12 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_questions") -@ApiModel(value = "Questions对象", description = "测评管理-题库记录表") -public class Questions implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "自增主键") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "题型:1、单选题,2、多选题,3、判断题") - @NotBlank(message = "题型不能为空!") - private String questionType; - - @ApiModelProperty(value = "题干信息") - @NotBlank(message = "题干信息不能为空!") - private String questionStem; - - @ApiModelProperty(value = "A选项内容") - @NotBlank(message = "A选项内容不能为空!") - private String optionA; - - @ApiModelProperty(value = "B选项内容") - @NotBlank(message = "B选项内容不能为空!") - private String optionB; - - @ApiModelProperty(value = "C选项内容") - private String optionC; - - @ApiModelProperty(value = "D选项内容") - private String optionD; - - @ApiModelProperty(value = "E选项内容") - private String optionE; - - @ApiModelProperty(value = "F选项内容") - private String optionF; - - @ApiModelProperty(value = "正确答案") - @NotBlank(message = "正确答案不能为空!") - private String answer; - - @ApiModelProperty(value = "答案解析") - private String answerAnalysis; - - @ApiModelProperty(value = "是否禁用:1:启用,0:禁用,默认是1启用") - private Integer isEnable; - - @ApiModelProperty(value = "是否删除:0未删除,1删除,默认0未删除") - private Integer isDel; - - @ApiModelProperty(value = "创建人") - private String createUser; - - - @ApiModelProperty(value = "修改人") - private String modifyUser; - - - @ApiModelProperty(value = "创建时间") - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - @ApiModelProperty(value = "更新时间") - @TableField(fill = FieldFill.INSERT_UPDATE) - private Date updateTime; - - @ApiModelProperty(value = "创建人用户账号id", name = "accountId", example = "1", required = true) - private Integer accountId; - - @ApiModelProperty(value = "学校id", name = "schoolId", example = "1") - private Integer schoolId; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/SchoolClassification.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/SchoolClassification.java deleted file mode 100644 index c811d67..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/SchoolClassification.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; -import java.util.Date; -import com.baomidou.mybatisplus.annotation.TableId; -import java.io.Serializable; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 学校对应分类表 - *

- * - * @author lr - * @since 2021-09-09 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_school_classification") -@ApiModel(value="SchoolClassification对象", description="学校对应分类表") -public class SchoolClassification implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "唯一标识") - @TableId(value = "id", type = IdType.ID_WORKER_STR) - private String id; - - @ApiModelProperty(value = "学校id") - private String schoolId; - - @ApiModelProperty(value = "课程分类id") - private String classificationId; - - @ApiModelProperty(value = "创建时间") - private Date gmtCreate; - - @ApiModelProperty(value = "更新时间") - private Date gmtModified; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/SchoolCourse.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/SchoolCourse.java deleted file mode 100644 index db82cf5..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/SchoolCourse.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; -import java.util.Date; -import com.baomidou.mybatisplus.annotation.TableId; -import java.io.Serializable; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 学校内置课程表 - *

- * - * @author lr - * @since 2021-08-10 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_school_course") -@ApiModel(value="SchoolCourse对象", description="学校内置课程表") -public class SchoolCourse implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "唯一标识") - @TableId(value = "id", type = IdType.ID_WORKER_STR) - private String id; - - @ApiModelProperty(value = "学校id") - private String schoolId; - - @ApiModelProperty(value = "课程id") - private String courseId; - - @ApiModelProperty(value = "是否启用(0启用,1未启用)") - private Integer isEnable; - - @ApiModelProperty(value = "创建时间") - private Date gmtCreate; - - @ApiModelProperty(value = "更新时间") - private Date gmtModified; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/SchoolProjectHintOpen.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/SchoolProjectHintOpen.java deleted file mode 100644 index 398ed4e..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/SchoolProjectHintOpen.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import java.io.Serializable; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 学校项目实验提示管理表 - *

- * - * @author lr - * @since 2023-06-02 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_school_project_hint_open") -@ApiModel(value="SchoolProjectHintOpen对象", description="学校项目实验提示管理表") -public class SchoolProjectHintOpen implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "主键") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "学校id") - private Integer schoolId; - - @ApiModelProperty(value = "项目id") - private Integer projectId; - - @ApiModelProperty(value = "实验提示是否开启(0开启 1不开启)") - private Integer hintOpen; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/Staff.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/Staff.java deleted file mode 100644 index 0d1ff79..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/Staff.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; - -import java.io.Serializable; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 员工表 - *

- * - * @author lr - * @since 2021-10-13 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_staff") -@ApiModel(value = "Staff对象", description = "员工表") -public class Staff implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "员工主键ID") - @TableId(value = "staff_id", type = IdType.AUTO) - private Integer staffId; - - @ApiModelProperty(value = "绑定年级ID") - private Integer gradeId; - - @ApiModelProperty(value = "组织架构id") - private Integer staffArchitectureId; - - @ApiModelProperty(value = "绑定学校id") - private Integer schoolId; - - @ApiModelProperty(value = "绑定账号id") - private Integer accountId; - - /** - * @Description : roleId 员工表 一个员工 = 一个角色绑定一个一级部门及一个二级部门 - * @Author Rong---2021/10/15 - */ - @ApiModelProperty(value = "该员工绑定的角色id") - private Integer roleId; - - @ApiModelProperty(value = "是否删除(0、未删除 1、已删除)") - @TableLogic - private Integer isDel; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/StaffGrade.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/StaffGrade.java deleted file mode 100644 index c3a0d25..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/StaffGrade.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; - -import java.io.Serializable; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotNull; - -/** - *

- * 员工年级表 - *

- * - * @author lr - * @since 2021-10-13 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_staff_grade") -@ApiModel(value = "StaffGrade对象", description = "员工年级表") -public class StaffGrade implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "员工年级表主键ID") - @TableId(value = "grade_id", type = IdType.AUTO) - private Integer gradeId; - - @ApiModelProperty(value = "二级部门", example = "三生三世") - @NotNull(message = "二级部门不能为空") - private String gradeName; - - @ApiModelProperty(value = "绑定员工专业组织架构ID", example = "1") - private Integer staffArchitectureId; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/StaffProfessionalArchitecture.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/StaffProfessionalArchitecture.java deleted file mode 100644 index c723b8e..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/StaffProfessionalArchitecture.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; - -import java.io.Serializable; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotNull; - -/** - *

- * 员工专业组织架构 - *

- * - * @author lr - * @since 2021-10-13 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_staff_professional_architecture") -@ApiModel(value = "StaffProfessionalArchitecture对象", description = "员工专业组织架构") -public class StaffProfessionalArchitecture implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "员工专业架构主键ID") - @TableId(value = "staff_architecture_id", type = IdType.AUTO) - private Integer staffArchitectureId; - - @ApiModelProperty(value = "员工组织架构名称", example = "经济管理学院") - @NotNull(message = "组织名称不能为空") - private String staffArchitectureName; - - @ApiModelProperty(value = "绑定学校ID", example = "1") - private Integer schoolId; - - @ApiModelProperty(value = "是否删除(0、未删除 1、已删除)", example = "0") - @TableLogic - private Integer isDel; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/SysJob.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/SysJob.java deleted file mode 100644 index e11e7eb..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/SysJob.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.*; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.util.Date; - -/** - * 定时任务 - * - * @author cheney - * @version V1.0 - * @date 2022年7月28日 - */ -@EqualsAndHashCode(callSuper = false) -@Data -@TableName("sys_job") -public class SysJob implements Serializable { - private static final long serialVersionUID = 1L; - /** - * 任务调度参数key - */ - public static final String JOB_PARAM_KEY = "JOB_PARAM_KEY"; - /** - * 任务id - */ - @ApiModelProperty(value = "主键ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - /** - * spring bean名称 - */ - @TableField("bean_name") - private String beanName; - - /** - * 参数 - */ - @TableField("params") - private String params; - - /** - * cron表达式 - */ - @TableField("cron_expression") - private String cronExpression; - - /** - * 任务状态 0:正常 1:暂停 - */ - @TableField("status") - private Integer status; - - /** - * 备注 - */ - @TableField("remark") - private String remark; - - /** - * 创建时间 - */ - @TableField(value = "create_time", fill = FieldFill.INSERT) - private Date createTime; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/SysJobLog.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/SysJobLog.java deleted file mode 100644 index 84af087..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/SysJobLog.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.*; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.util.Date; - -/** - * 定时任务日志 - * - * @author cheney - * @version V1.0 - * @date 2022年7月28日 - */ -@EqualsAndHashCode(callSuper = false) -@Data -@TableName("sys_job_log") -public class SysJobLog implements Serializable { - private static final long serialVersionUID = 1L; - - /** - * 任务日志id - */ - @ApiModelProperty(value = "主键ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - /** - * 任务id - */ - @TableField("job_id") - private Integer jobId; - - /** - * spring bean名称 - */ - @TableField("bean_name") - private String beanName; - - /** - * 参数 - */ - @TableField("params") - private String params; - - /** - * 任务状态 0:成功 1:失败 - */ - @TableField("status") - private Integer status; - - /** - * 失败信息 - */ - @TableField("error") - private String error; - - /** - * 耗时(单位:毫秒) - */ - @TableField("times") - private Integer times; - - /** - * 创建时间 - */ - @TableField(value = "create_time", fill = FieldFill.INSERT) - private Date createTime; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/SysLog.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/SysLog.java deleted file mode 100644 index f7946e8..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/SysLog.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.*; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.Date; - -/** - * 操作日志 - * - * @author cheney - * @version V1.0 - * @date 2022年7月28日 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("sys_log") -@ApiModel(value = "sys_log", description = "sys_log") -public class SysLog implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "主键ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - private String userId; - - private String userName; - - private String operation; - - private Integer time; - - private Integer schoolId; - - private String method; - - private String params; - - private String ip; - - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - @TableField(exist = false) - private String startTime; - - @TableField(exist = false) - private String endTime; - - @TableField(exist = false) - private String schoolName; - -} \ No newline at end of file diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/SystemLogo.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/SystemLogo.java deleted file mode 100644 index f108f1d..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/SystemLogo.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import java.io.Serializable; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 职站教师端-系统logo设置 - *

- * - * @author lr - * @since 2021-10-18 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_system_logo") -@ApiModel(value="SystemLogo对象", description="职站教师端-系统logo设置") -public class SystemLogo implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "主键") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "标题") - private String title; - - @ApiModelProperty(value = "图标") - private String logoUrl; - - @ApiModelProperty(value = "学校id") - private Integer schoolId; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/TheoreticalCourse.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/TheoreticalCourse.java deleted file mode 100644 index 8518291..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/TheoreticalCourse.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.*; - -import java.util.Date; - -import java.io.Serializable; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 理论课程基本信息 - *

- * - * @author lr - * @since 2022-09-14 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_theoretical_course") -@ApiModel(value = "TheoreticalCourse对象", description = "理论课程基本信息") -public class TheoreticalCourse implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "理论课程主键") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "课程名称") - private String courseName; - - @ApiModelProperty(value = "课程类型(0.免费 1.付费)") - private Integer courseType; - - @ApiModelProperty(value = "创建时间") - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - @ApiModelProperty(value = "更新时间") - @TableField(fill = FieldFill.INSERT_UPDATE) - private Date updateTime; - - @ApiModelProperty(value = "学校id") - private Integer schoolId; - - @ApiModelProperty(value = "创建人Id") - private Integer founderId; - - @ApiModelProperty(value = "理论课程封面") - private String coverUrl; - - @ApiModelProperty(value = "理论课程介绍") - private String courseIntroduction; - - @ApiModelProperty(value = "平台来源(0中台,1职站)") - private Integer platformSource; - - @ApiModelProperty(value = "课程范围(0:本校内 1:全平台 2.指定区域、院校)") - private Integer visibleRange; - - @ApiModelProperty(value = "中台是否开启(0开启 1未开启 默认0)") - private Integer ztOpen; - - @ApiModelProperty(value = "是否开启(0开启 1未开启 默认0)") - private Integer isOpen; - - @ApiModelProperty(value = "是否删除(0未删除 1已删除 默认0)") - private Integer isDel; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/TheoreticalCourseChapter.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/TheoreticalCourseChapter.java deleted file mode 100644 index 0669585..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/TheoreticalCourseChapter.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.*; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.Date; - -/** - *

- * 理论课程章节表 - *

- * - * @author lr - * @since 2022-09-22 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_theoretical_course_chapter") -@ApiModel(value="TheoreticalCourseChapter对象", description="理论课程章节表") -public class TheoreticalCourseChapter implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "章节ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "章节名称") - private String name; - - @ApiModelProperty(value = "课程ID") - private Integer courseId; - - @ApiModelProperty(value = "显示排序") - private Integer sort; - - @ApiModelProperty(value = "创建时间") - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - @ApiModelProperty(value = "更新时间") - @TableField(fill = FieldFill.INSERT_UPDATE) - private Date updateTime; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/TheoreticalCourseClassification.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/TheoreticalCourseClassification.java deleted file mode 100644 index 4c7cf59..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/TheoreticalCourseClassification.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.*; - -import java.util.Date; - -import java.io.Serializable; - -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 理论课程分类信息 - *

- * - * @author lr - * @since 2022-09-14 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_theoretical_course_classification") -@ApiModel(value = "TheoreticalCourseClassification对象", description = "理论课程分类信息") -public class TheoreticalCourseClassification implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "理论课程分类主键") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "分类名称") - private String classificationName; - - @ApiModelProperty(value = "学校id") - private Integer schoolId; - - @ApiModelProperty(value = "创建人Id") - private Integer founderId; - - @ApiModelProperty(value = "平台来源(0中台,1职站)") - private Integer platformSource; - - @ApiModelProperty(value = "是否删除(0未删除 1已删除 默认0)") - @TableLogic - private Integer isDel; - - @ApiModelProperty(value = "创建时间") - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - @ApiModelProperty(value = "更新时间") - @TableField(fill = FieldFill.INSERT_UPDATE) - private Date updateTime; - - - @ApiModelProperty(value = "学校名称") - @TableField(exist = false) - private String schoolName; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/TheoreticalCourseCollect.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/TheoreticalCourseCollect.java deleted file mode 100644 index 817d524..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/TheoreticalCourseCollect.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.Date; - -/** - *

- * 理论课程收藏表 - *

- * - * @author lr - * @since 2023-04-18 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_theoretical_course_collect") -@ApiModel(value = "TheoreticalCourseCollect对象", description = "理论课程收藏表") -public class TheoreticalCourseCollect implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "理论课程收藏id") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "理论课程id") - private Integer courseId; - - @ApiModelProperty(value = "收藏时间") - private Date collectionTime; - - @ApiModelProperty(value = "账号id") - private Integer accountId; - - @ApiModelProperty(value = "学校id") - private Integer schoolId; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/TheoreticalCourseConfigure.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/TheoreticalCourseConfigure.java deleted file mode 100644 index 50f1b75..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/TheoreticalCourseConfigure.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.*; - -import java.util.Date; - -import java.io.Serializable; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 理论课程与理论课程分类配置表 - *

- * - * @author lr - * @since 2022-09-14 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_theoretical_course_configure") -@ApiModel(value = "TheoreticalCourseConfigure对象", description = "理论课程与理论课程分类配置表") -public class TheoreticalCourseConfigure implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "配置主键") - @TableId(value = "config_id", type = IdType.AUTO) - private Integer configId; - - @ApiModelProperty(value = "理论课程课程id") - private Integer courseId; - - @ApiModelProperty(value = "课程分类id") - private Integer classificationId; - - @ApiModelProperty(value = "分类类型") - private Integer classificationType; - - @ApiModelProperty(value = "创建时间") - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - @ApiModelProperty(value = "更新时间") - @TableField(fill = FieldFill.INSERT_UPDATE) - private Date updateTime; - - - @ApiModelProperty(value = "分类名称") - @TableField(exist = false) - private String classificationName; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/TheoreticalCourseRange.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/TheoreticalCourseRange.java deleted file mode 100644 index 9c7dcd5..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/TheoreticalCourseRange.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import java.io.Serializable; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 理论课程指定范围选择 - *

- * - * @author lr - * @since 2022-09-19 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_theoretical_course_range") -@ApiModel(value="TheoreticalCourseRange对象", description="理论课程指定范围选择") -public class TheoreticalCourseRange implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "主键") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "理论课程主键") - private Integer courseId; - - @ApiModelProperty(value = "省") - private String provinceId; - - @ApiModelProperty(value = "市") - private String cityId; - - @ApiModelProperty(value = "学校id") - private String schoolId; - - @ApiModelProperty(value = "范围类型(0为学校 1为地区)") - private Integer type; - - @ApiModelProperty(value = "是否删除(默认0 ,1为已删除)") - private Integer isDel; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/TheoreticalCourseSubsection.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/TheoreticalCourseSubsection.java deleted file mode 100644 index c0f0a1e..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/TheoreticalCourseSubsection.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.*; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.Date; - -/** - *

- * 课程小节 - *

- * - * @author lr - * @since 2022-09-22 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_theoretical_course_subsection") -@ApiModel(value="TheoreticalCourseSubsection对象", description="课程小节") -public class TheoreticalCourseSubsection implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "小节ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "小节名称") - private String name; - - @ApiModelProperty(value = "课程ID") - private Integer courseId; - - @ApiModelProperty(value = "章节ID") - private Integer chapterId; - - @ApiModelProperty(value = "资源文件ID") - private String fileId; - - @ApiModelProperty(value = "文件存储路径") - private String fileUrl; - - @ApiModelProperty(value = "资源文件类型") - private String fileType; - - @ApiModelProperty(value = "阿里云文件名称") - private String fileName; - - @ApiModelProperty(value = "原始文件名称") - private String originalFileName; - - @ApiModelProperty(value = "排序字段") - private Integer sort; - - @ApiModelProperty(value = "创建时间") - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - @ApiModelProperty(value = "更新时间") - @TableField(fill = FieldFill.INSERT_UPDATE) - private Date updateTime; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/UserManagement.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/UserManagement.java deleted file mode 100644 index ebf8291..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/UserManagement.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - *

- * 企业端用户管理 - *

- * - * @author lr - * @since 2021-08-10 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_user_management") -@ApiModel(value="UserManagement对象", description="企业端用户管理") -public class UserManagement implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "主键id") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "绑定客户id") - private Integer clientId; - - @ApiModelProperty(value = "用户姓名") - private String name; - - @ApiModelProperty(value = "账号") - private String account; - - @ApiModelProperty(value = "账号角色") - private Integer roleId; - - @ApiModelProperty(value = "登录次数") - private Integer loginNumber; - - @ApiModelProperty(value = "上次登录时间") - private String lastLoginTime; - - @ApiModelProperty(value = "客户名称") - private String clientName; - - @ApiModelProperty(value = "绑定用户id") - private Integer userId; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/UserScore.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/UserScore.java deleted file mode 100644 index 956267d..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/UserScore.java +++ /dev/null @@ -1,122 +0,0 @@ -package com.huoran.occupationlab.entity; - -import com.baomidou.mybatisplus.annotation.*; - -import java.util.Date; -import java.io.Serializable; -import java.util.List; - -import com.huoran.common.entity.LcRuleRecord; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 用户分数表 - *

- * - * @author Mr.JK - * @since 2021-09-14 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_user_score") -@ApiModel(value = "UserScore对象", description = "用户分数表") -public class UserScore implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "主键id") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "分数") - private Integer score; - - - @ApiModelProperty(value = "实验报告主键") - private Integer reportId; - - @ApiModelProperty(value = "账号id") - private Integer accountId; - - @ApiModelProperty(value = "系统id") - private Integer systemId; - - @ApiModelProperty(value = "判分点id(系统11为流程类)") - private Integer judgmentId; - - @ApiModelProperty(value = "用户答案") - private String answer; - - @ApiModelProperty(value = "参考答案") - @TableField(exist = false) - private String referenceAnswer; - - - @ApiModelProperty(value = "运行结果") - @TableField(exist = false) - private String runResult; - - - @ApiModelProperty(value = "题目分值") - @TableField(exist = false) - private Integer quesScore; - - @ApiModelProperty(value = "是否正确") - private Integer isCorrect; - - @ApiModelProperty(value = "是否删除") - @TableLogic(value = "0", delval = "1") - private Integer isDel; - - @ApiModelProperty(value = "判分点名称") - @TableField(exist = false) - private String judgmentName; - - @ApiModelProperty(value = "规则记录") - @TableField(exist = false) - private List lcRuleRecords; - - @ApiModelProperty(value = "创建时间") - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - @ApiModelProperty(value = "更新时间") - @TableField(fill = FieldFill.INSERT_UPDATE) - private Date updateTime; - - - @ApiModelProperty(value = "参考答案图片集合") - @TableField(exist = false) - private List runThePictureList; - - @ApiModelProperty(value = "实验学时") - @TableField(exist = false) - private String period; - - @ApiModelProperty(value = "运行图片(未截取分割前的)") - @TableField(exist = false) - private String runThePicture; - - @ApiModelProperty(value = "赛事id") - private Integer competitionId; - - @ApiModelProperty(value = "赛事阶段id") - private Integer stageId; - - @ApiModelProperty(value = "耗时(用于区分线下赛事的耗时)") - private Integer timeSum; - - @ApiModelProperty(value = "提交时间(用于区分线下赛事的提交时间)") - private Date submitTime; - - @ApiModelProperty(value = "团队id") - private Integer teamId; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/excel/ExcelData.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/excel/ExcelData.java deleted file mode 100644 index e226a3f..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/excel/ExcelData.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.huoran.occupationlab.entity.excel; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import com.alibaba.excel.annotation.ExcelProperty; -import com.huoran.occupationlab.utils.StatusConverter; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * @Author chen - * @DATE 2020/10/19 15:34 - * @Version 1.0 - */ -@Data -public class ExcelData { - - @ApiModelProperty(value = "序号") - @Excel(name = "序号", orderNum = "1", isImportField = "rownum", width = 30) - private Integer rownum; - - @ApiModelProperty(value = "学校") - @Excel(name = "学校", orderNum = "2", mergeVertical = true, isImportField = "school", width = 30) - private String school; - - @ApiModelProperty(value = "学生姓名") - @Excel(name = "学生姓名", orderNum = "3", mergeVertical = true, isImportField = "username", width = 30) - private String username; - - - @ApiModelProperty(value = "手机号") - @Excel(name = "手机号", orderNum = "4", mergeVertical = true, isImportField = "phone", width = 30) - private String phone; - - - @ApiModelProperty(value = "学号") - @Excel(name = "学号", orderNum = "5", mergeVertical = true, isImportField = "workNumber", width = 30) - private String workNumber; - - - @ApiModelProperty(value = "报名时间") - @Excel(name = "报名时间", orderNum = "6", mergeVertical = true, isImportField = "gmtCreate", width = 30) - private String gmtCreate; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/AchievementProductDimensionReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/AchievementProductDimensionReq.java deleted file mode 100644 index 8938eac..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/AchievementProductDimensionReq.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -public class AchievementProductDimensionReq extends PageReq { - - - @ApiModelProperty(value = "项目id") - Integer projectId; - - - @ApiModelProperty(value = "班级id") - Integer classId; - - @ApiModelProperty(value = "关键词") - String keyWord; - - @ApiModelProperty(value = "班级名称") - String className; - - @ApiModelProperty(value = "产品id") - Integer mallId; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/ActivityApplicantReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/ActivityApplicantReq.java deleted file mode 100644 index 412b532..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/ActivityApplicantReq.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 创业活动报名人员表 - *

- * - * @author lr - * @since 2023-04-27 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -public class ActivityApplicantReq extends PageReq { - - - @ApiModelProperty(value = "活动主键Id") - private Integer activityId; - - - @ApiModelProperty(value = "关键词") - private String keyWords; - - @ApiModelProperty(value = "报名人员状态(0未禁用,1禁用)") - private Integer isDisable; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/AddArchitectureReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/AddArchitectureReq.java deleted file mode 100644 index 7a9e463..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/AddArchitectureReq.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import java.io.Serializable; -import java.util.Date; -import java.util.List; - -/** - *

- * 学生组织架构 - *

- * - * @author lr - * @since 2021-08-24 - */ -@Data -@ApiModel(value = "新增组织架构请参数", description = "新增组织架构请参数") -public class AddArchitectureReq { - - - @ApiModelProperty(value = "组织名称") - @NotNull(message = "组织名称不能为空") - private String organizationName; - - @ApiModelProperty(value = "父id 一级为0") - @NotNull(message = "父id不能为空") - private Integer parentId; - - - @ApiModelProperty(value = "学校id") - private Integer schoolId; - - - @ApiModelProperty(value = "层级") - @NotNull(message = "层级不能为空") - private Integer level; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/AddStaffReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/AddStaffReq.java deleted file mode 100644 index c7b5f88..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/AddStaffReq.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotNull; -import java.util.List; - -/** - * @Author chen - * @DATE 2021/10/13 15:51 - * @Version 1.0 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_staff") -@ApiModel(value = "AddStaffReq对象", description = "新增员工") -public class AddStaffReq { - - @ApiModelProperty(value = "绑定账号id", hidden = true) - private Integer accountId; - - @ApiModelProperty(value = "绑定学校id", hidden = true) - private Integer schoolId; - - //----------------------------用户表相关字段Start---------------------------- - @ApiModelProperty(value = "用户姓名", example = "穆虎虎") - @NotNull(message = "用户姓名不能为空") - private String userName; - - @ApiModelProperty(value = "唯一标识账号", example = "sjjskisjisjsisj") - @NotNull(message = "唯一标识账号不能为空") - private String uniqueIdentification; - - @ApiModelProperty(value = "电话") - private String phone; - - @ApiModelProperty(value = "邮箱") - private String email; - - @ApiModelProperty(value = "账号角色及绑定的一级二级部门信息") - @NotNull(message = "账号角色及绑定的一级二级部门信息不能为空") - private List roleAndDeptList; - - @ApiModelProperty(value = "组织关系:1->有组织关系;2->无组织关系;", example = "1") - private Integer organizationalRelation; - - //----------------------------用户表相关字段End---------------------------- - - //----------------------------账户表相关字段Start---------------------------- - @ApiModelProperty(value = "账号") - private String account; - - @ApiModelProperty(value = "工号") - private String workNumber; - //----------------------------账户表相关字段End---------------------------- -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/AddStaffRoleReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/AddStaffRoleReq.java deleted file mode 100644 index c87ae0d..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/AddStaffRoleReq.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotNull; -import java.util.List; - -/** - * @Author chen - * @DATE 2021/10/13 15:51 - * @Version 1.0 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_staff") -@ApiModel(value = "绑定员工角色及部门参数", description = "绑定员工角色及部门参数") -public class AddStaffRoleReq { - - @ApiModelProperty(value = "一级部门绑定id", example = "1") - @NotNull(message = "绑定年级ID不能为空") - private Integer gradeId; - - @ApiModelProperty(value = "二级部门绑定id", example = "1") - @NotNull(message = "绑定专业ID不能为空") - private Integer staffArchitectureId; - - @ApiModelProperty(value = "角色id(一个角色绑定一个一级部门、二级部门)", example = "1") - @NotNull(message = "角色ID不能为空") - private Integer roleId; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/AddStudentCheckReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/AddStudentCheckReq.java deleted file mode 100644 index 49f8fcc..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/AddStudentCheckReq.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotNull; -import java.util.Date; - -/** - *

- * 学生表 - *

- * - * @author lr - * @since 2021-08-24 - */ -@Data -@ApiModel(value = "Student对象", description = "学生表") -public class AddStudentCheckReq { - - //Integer schoolId,String userName,String account,String workNumber,Integer platformId,Integer type - - @ApiModelProperty(value = "学号/工号") - private String workNumber; - - @ApiModelProperty(value = "学生姓名") - private String userName; - - @ApiModelProperty(value = "账号") - private String account; - - @ApiModelProperty(value = "班级id") - private String classId; - - @ApiModelProperty(value = "学校id", hidden = true) - private Integer schoolId; - - @ApiModelProperty(value = "所属平台id") - private Integer platformId; - - @ApiModelProperty(value = "平台端区分:0->教师端 1->学生端 2->无端") - private Integer type; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/AddStudentReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/AddStudentReq.java deleted file mode 100644 index 840f7a6..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/AddStudentReq.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotNull; -import java.io.Serializable; -import java.util.Date; - -/** - *

- * 学生表 - *

- * - * @author lr - * @since 2021-08-24 - */ -@Data -@ApiModel(value = "Student对象", description = "学生表") -public class AddStudentReq { - @ApiModelProperty(value = "学号/工号") - @NotNull(message = "学生学号不能为空!") - private String workNumber; - - @ApiModelProperty(value = "学生姓名") - @NotNull(message = "学生姓名不能为空!") - private String userName; - - @NotNull(message = "账号不能为空!") - @ApiModelProperty(value = "账号") - private String account; - - @ApiModelProperty(value = "班级id") - private String classId; - - @ApiModelProperty(value = "唯一标识账号") - @NotNull(message = "唯一标识不能为空!") - private String uniqueIdentification; - - @ApiModelProperty(value = "电话") - private String phone; - - @ApiModelProperty(value = "邮箱") - private String email; - - @ApiModelProperty(value = "学校id", hidden = true) - private Integer schoolId; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/AddTheoreticalCourseReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/AddTheoreticalCourseReq.java deleted file mode 100644 index 8c42342..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/AddTheoreticalCourseReq.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.huoran.occupationlab.entity.TheoreticalCourseRange; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.Date; -import java.util.List; - -/** - *

- * 理论课程基本信息 - *

- * - * @author lr - * @since 2022-09-14 - */ -@Data -@ApiModel(value = "新增/编辑理论课程所需参数", description = "新增/编辑理论课程所需参数") -public class AddTheoreticalCourseReq { - - @ApiModelProperty(value = "理论课程id(编辑才传)") - private Integer courseId; - - @ApiModelProperty(value = "课程名称") - private String courseName; - - @ApiModelProperty(value = "课程类型(0.免费 1.付费)") - private Integer courseType; - - @ApiModelProperty(value = "理论课程封面") - private String coverUrl; - - @ApiModelProperty(value = "理论课程介绍") - private String courseIntroduction; - - @ApiModelProperty(value = "平台来源(0中台,1职站)") - private Integer platformSource; - - @ApiModelProperty(value = "课程范围(0:本校内 1:全平台 2.指定区域、院校)") - private Integer visibleRange; - - @ApiModelProperty(value = "学校分类") - private List schoolClassificationsIds; - - @ApiModelProperty(value = "平台分类") - private List platformClassificationIds; - - - @ApiModelProperty(value = "指定区域、院校") - private List courseRangeList; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/AfterLoginPageContestListReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/AfterLoginPageContestListReq.java deleted file mode 100644 index 088741d..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/AfterLoginPageContestListReq.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * @描述:竞赛管理表 - * @作者: Rong - * @日期: 2022-06-16 - */ -@Data -@ApiModel(value = "登录后赛事列表分页") -public class AfterLoginPageContestListReq extends PageReq{ - - @ApiModelProperty(value = "关键词(竞赛名称/创建人)",example = "事") - private String keyWord; - - @ApiModelProperty(value = "大赛范围(0:本校内 1:全平台 2.指定区域、院校 3.不限)",example = "3") - private String competitionScope; - - @ApiModelProperty(value = "省") - private Integer provinceId; - - @ApiModelProperty(value = "市") - private Integer cityId; - - @ApiModelProperty(value = "排序(1:近期排名 2.最近更新)") - private Integer sequence; - - @ApiModelProperty(value = "账号id") - private Integer accountId; - - @ApiModelProperty(value = "赛事类型(1.本校赛事/2.赛事广场/3.已报名赛事)") - private Integer eventType; - -} \ No newline at end of file diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/AssessmentReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/AssessmentReq.java deleted file mode 100644 index 77194c4..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/AssessmentReq.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import com.baomidou.mybatisplus.annotation.*; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotNull; -import javax.validation.constraints.NotEmpty; -import java.io.Serializable; -import java.util.Date; -import java.util.List; - -/** - *

- * 考核管理 - *

- * - * @author lr - * @since 2021-08-18 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@ApiModel(value = "创建考核对象", description = "创建考核对象") -public class AssessmentReq { - - - @ApiModelProperty(value = "考核名称", name = "experimentalName", example = "K1", required = true) - @NotEmpty(message = "考核名称不能为空") - private String experimentalName; - - @ApiModelProperty(value = "班级id(可多个班级参加,逗号隔开) 指定范围才需要传值", name = "classId", example = "1,2,3", required = true) - //@NotEmpty(message = "班级id不能为空") - private String classId; - - @ApiModelProperty(value = "绑定项目id", name = "projectId", example = "1", required = true) - @NotNull(message = "项目id不能为空") - private Integer projectId; - - @ApiModelProperty(value = "实验时长", name = "experimentDuration", example = "1", required = true) - @NotEmpty(message = "实验时长不能为空") - private String experimentDuration; - - @ApiModelProperty(value = "发布类型(1、手动发布 2、定时发布)", name = "type", example = "1", required = true) - @NotNull(message = "发布类型不能为空") - private Integer type; - - @ApiModelProperty(value = "起始时间", name = "startTime", example = "2021-08-19 16:00:00", required = true) - private String startTime; - - @ApiModelProperty(value = "结束时间", name = "stopTime", example = "2021-08-20 16:00:00", required = true) - private String stopTime; - - @ApiModelProperty(value = "邀请码") - private Integer invitationCode; - - @ApiModelProperty(value = "是否启用邀请码(0、启用 1、未启用)", name = "isEnableCode", example = "1", required = true) - private Integer isEnableCode; - - @ApiModelProperty(value = "指定范围(0无指定范围 1指定范围)", name = "isSpecify", example = "1", required = true) - private Integer isSpecify; - - @ApiModelProperty(value = "创建人用户账号id", name = "accountId", example = "1", required = true) - private Integer accountId; - - @ApiModelProperty(value = "课程id", name = "curriculumId", example = "1", required = true) - private Integer curriculumId; - - @ApiModelProperty(value = "学校id", name = "schoolId", example = "1") - private Integer schoolId; - - @ApiModelProperty(value = "绑定学生信息") - private List stuInfo; - - @ApiModelProperty(value = "商品id", name = "mallId") - private Integer mallId; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/BankExperimentDataReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/BankExperimentDataReq.java deleted file mode 100644 index f563e43..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/BankExperimentDataReq.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import com.baomidou.mybatisplus.annotation.TableField; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -public class BankExperimentDataReq { - - @ApiModelProperty(value = "序号") - private Integer id; - - @ApiModelProperty(value = "判分点") - private String judgmentName; - - @ApiModelProperty(value = "考核点") - private String assessmentPoint; - - @ApiModelProperty(value = "参考答案") - private String referenceAnswer; - - @ApiModelProperty(value = "学生答案") - private String answer; - - @ApiModelProperty(value = "得分") - private Integer score; - - @ApiModelProperty(value = "题目分值") - private Integer quesScore; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/ClassReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/ClassReq.java deleted file mode 100644 index a3098c2..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/ClassReq.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import com.baomidou.mybatisplus.annotation.TableField; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.List; - -/** - * @ProjectName: huorantech - * @Package: com.huoran.occupationlab.entity.req - * @ClassName: ClassReq - * @Description: java类作用描述 - * @Author: Maureen.Rong - * @CreateDate: 2021/8/19 18:13 - * @UpdateDate: 2021/8/19 18:13 - * @Version: 1.0 - */ -@Data -public class ClassReq { - @ApiModelProperty(value = "绑定学生账号id", name = "stuAccountId", example = "1", required = true) - private Integer stuAccountId; - - @ApiModelProperty(value = "绑定班级id", name = "classId", example = "1", required = true) - private Integer classId; - - - @ApiModelProperty(value = "班级名称", name = "className") - private String className; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/ClassificationPageReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/ClassificationPageReq.java deleted file mode 100644 index 5f1eee2..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/ClassificationPageReq.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * @ProjectName: huorantech - * @Package: com.huoran.occupationlab.entity.req - * @ClassName: PageReq - * @Description: 分页 - * @Author: Maureen.Rong - * @CreateDate: 2021/8/12 15:10 - * @UpdateDate: 2021/8/12 15:10 - * @Version: 1.0 - */ -@Data -public class ClassificationPageReq { - - @ApiModelProperty(value = "当前页数", name = "pageNum", example = "1", required = true) - private Integer pageNum; - @ApiModelProperty(value = "当前页需要显示的数量", name = "pageSize", example = "10", required = true) - private Integer pageSize; - @ApiModelProperty(value = "平台来源(0中台,1职站)") - private Integer platformSource; - @ApiModelProperty(value = "学校id") - private Integer schoolId; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/ConfigurationReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/ConfigurationReq.java deleted file mode 100644 index 30664df..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/ConfigurationReq.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import io.swagger.annotations.ApiModelProperty; - -import java.util.List; - -/** - * @ProjectName: huorantech - * @Package: com.huoran.occupationlab.entity.req - * @ClassName: ConfigurationReq - * @Description: java类作用描述 - * @Author: Maureen.Rong - * @CreateDate: 2021/9/28 14:12 - * @UpdateDate: 2021/9/28 14:12 - * @Version: 1.0 - * @create: 2021-09-28 14:12 - */ -public class ConfigurationReq { - @ApiModelProperty(value = "系统id") - private List systemId; - - @ApiModelProperty(value = "排序") - private Integer sort; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/DisableEnableActivityReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/DisableEnableActivityReq.java deleted file mode 100644 index d35ed98..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/DisableEnableActivityReq.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - - -@Data -@ApiModel(value = "禁用启用活动所需参数") -public class DisableEnableActivityReq { - - @ApiModelProperty(value = "禁用平台来源(0中台,1职站教师端 2.职站学生端)",example = "1") - private Integer type; - - @ApiModelProperty(value = "禁用的活动id",example = "1") - private Integer activityId; - - @ApiModelProperty(value = "是否开启(默认0启用 1禁用)", example = "0") - private Integer isOpen; - - @ApiModelProperty(value = "是否是本校超管以及管理员(0为否 1为是)", hidden = true) - private Integer isAdmin; -} \ No newline at end of file diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/DisableEnableContestReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/DisableEnableContestReq.java deleted file mode 100644 index c4515ed..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/DisableEnableContestReq.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * @描述:竞赛管理表 - * @作者: Rong - * @日期: 2022-06-16 - */ -@Data -@ApiModel(value = "禁用启用赛事所需参数") -public class DisableEnableContestReq { - - @ApiModelProperty(value = "禁用平台来源(0中台,1职站)",example = "1") - private Integer type; - - @ApiModelProperty(value = "禁用的赛事id",example = "1") - private String contestId; - - - @ApiModelProperty(value = "是否开启(默认0启用 1禁用)", example = "0") - private Integer isOpen; - -} \ No newline at end of file diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/DisableEnableCourseReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/DisableEnableCourseReq.java deleted file mode 100644 index 8172902..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/DisableEnableCourseReq.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - - -@Data -@ApiModel(value = "禁用启用课程所需参数") -public class DisableEnableCourseReq { - - @ApiModelProperty(value = "禁用平台来源(0中台,1职站)", example = "1") - private Integer type; - - @ApiModelProperty(value = "课程id", example = "1") - private Integer courseId; - - - @ApiModelProperty(value = "是否开启(默认0启用 1禁用)", example = "0") - private Integer isOpen; - - -} \ No newline at end of file diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/EditExperimentalDataReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/EditExperimentalDataReq.java deleted file mode 100644 index 1a64aab..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/EditExperimentalDataReq.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * @描述: - * @作者: Rong - * @日期: 2022/5/19 17:29 - */ -@Data -public class EditExperimentalDataReq { - @ApiModelProperty(value = "实验报告主键") - private Integer reportId; - - @ApiModelProperty(value = "实验数据") - private String data; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/EditStudentsReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/EditStudentsReq.java deleted file mode 100644 index 98f3518..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/EditStudentsReq.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import com.baomidou.mybatisplus.annotation.*; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.io.Serializable; -import java.util.Date; - -/** - * @描述:用户信息表 - * @作者: Rong - * @日期: 2021-08-25 - */ -@Data -@ApiModel(value = "用户信息表") -@TableName("hr_user_info") -public class EditStudentsReq implements Serializable { - - private static final long serialVersionUID = 1L; - - @TableId(type = IdType.AUTO) - @ApiModelProperty(value = "用户id") - private Integer userId; - - @ApiModelProperty(value = "用户姓名") - private String userName; - - @ApiModelProperty(value = "唯一标识账号") - private String uniqueIdentification; - - @ApiModelProperty(value = "证件类型(1、身份证)") - private Integer documentType; - - @ApiModelProperty(value = "证件号码") - private String idNumber; - - @ApiModelProperty(value = "绑定省份id") - private Integer provinceId; - - @ApiModelProperty(value = "绑定城市id") - private Integer cityId; - - @ApiModelProperty(value = "国家归属地") - private String countries; - - @ApiModelProperty(value = "出生日期") - private Date dateBirth; - - @ApiModelProperty(value = "教育程度") - private Integer educationDegree; - - @ApiModelProperty(value = "绑定学校id") - private Integer schoolId; - - @ApiModelProperty(value = "电话") - private String phone; - - @ApiModelProperty(value = "邮箱") - private String email; - - @ApiModelProperty(value = "微信号") - private String wechatId; - - @ApiModelProperty(value = "登陆次数") - private Integer loginNumber; - - @ApiModelProperty(value = "性别(1、男 2、女)") - private Integer sex; - - @ApiModelProperty(value = "用户头像路径") - private String userAvatars; - - @ApiModelProperty(value = "是否删除(0->未删除;1->已删除)") - private Integer isDel; - - @ApiModelProperty(value = "最后登陆时间") - private String lastLoginTime; - - @ApiModelProperty(value = "绑定多个角色id") - private String roleId; - - @ApiModelProperty(value = "组织关系:1->有组织关系;2->无组织关系;") - private Integer organizationalRelation; - - @ApiModelProperty(value = "是否禁用(0->禁用,1->启用)") - private Boolean isEnable; - - @ApiModelProperty(value = "创建时间") - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - @ApiModelProperty(value = "更新时间") - @TableField(fill = FieldFill.INSERT_UPDATE) - private Date updateTime; - - @ApiModelProperty(value = "绑定时间") - private String phoneBindingTime; - -} \ No newline at end of file diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/EntrepreneurshipActivityListrReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/EntrepreneurshipActivityListrReq.java deleted file mode 100644 index 6113115..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/EntrepreneurshipActivityListrReq.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 创业活动列表所需参数 - */ -@Data -@Accessors(chain = true) -public class EntrepreneurshipActivityListrReq extends PageReq { - - @ApiModelProperty(value = "创建人角色(0、系统 1、老师 2、学生)", example = "1") - private Integer founder; - - @ApiModelProperty(value = "发布状态(默认0、草稿箱 1、已发布)", example = "1") - private Integer publishStatus; - - @ApiModelProperty(value = "关键词", example = "三") - private String keyWords; - - @ApiModelProperty(value = "当前所属平台(0:中台,1:职站教师 2职站学生)", example = "1") - private Integer platformSource; - - - @ApiModelProperty(value = "是否是本校超管以及管理员(0为否 1为是)", hidden = true) - private Integer isAdmin; - - - @ApiModelProperty(hidden = true) - private Integer accountId; - - - @ApiModelProperty(value = "是否报名(0为已报名 1为未报名)", example = "0") - private Integer whetherToSignUp; - - @ApiModelProperty(value = "开始时间") - private String startTime; - - @ApiModelProperty(value = "结束时间") - private String endTime; - - @ApiModelProperty(value = "筛选排序(0 最近更新 1:近期报名)") - private Integer filterSort; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/ExcelImpQuestionReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/ExcelImpQuestionReq.java deleted file mode 100644 index 3ba40a2..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/ExcelImpQuestionReq.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import com.huoran.occupationlab.entity.Questions; -import com.huoran.occupationlab.utils.poi.ExcelAttribute; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * @ProjectName: huorantech - * @Package: com.huoran.occupationlab.entity.req - * @ClassName: ExcelImpQuestionReq - * @Description: 题库批量导入所需 - * @Author: Maureen.Rong - * @CreateDate: 2021/8/16 16:49 - * @UpdateDate: 2021/8/16 16:49 - * @Version: 1.0 - */ -@Data -@ApiModel(value = "题库批量导入所需") -public class ExcelImpQuestionReq { - - @ApiModelProperty(value = "题干") - private String questionStem; - - @ApiModelProperty(value = "绑定院校id") - private Integer schoolId; - - @ApiModelProperty("题型") - private String questionType; - - @ApiModelProperty("选项A") - private String optionA; - - @ApiModelProperty("选项B") - private String optionB; - - @ApiModelProperty("选项C") - private String optionC; - - @ApiModelProperty("选项D") - private String optionD; - - @ApiModelProperty("选项E") - private String optionE; - - @ApiModelProperty("选项F") - private String optionF; - - @ApiModelProperty("正确答案") - private String answer; - - @ApiModelProperty("答案解析") - private String answerAnalysis; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/ExcelImpStaffReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/ExcelImpStaffReq.java deleted file mode 100644 index 1c0261a..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/ExcelImpStaffReq.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotNull; - -/** - * @ProjectName: huorantech - * @Package: com.huoran.occupationlab.entity.req - * @ClassName: ExcelImpStaffReq - * @Description: 批量导入员工所需 - * @Author: Maureen.Rong - * @CreateDate: 2021/10/15 09:49 - * @UpdateDate: 2021/10/15 09:49 - * @Version: 1.0 - */ -@Data -@ApiModel(value = "批量导入员工所需") -public class ExcelImpStaffReq { - - @ApiModelProperty(value = "姓名") - @NotNull(message = "姓名不能为空!") - private String userName; - - /*@NotNull(message = "账号不能为空!") - @ApiModelProperty(value = "账号") - private String account;*/ - - @ApiModelProperty(value = "角色") - @NotNull(message = "角色不能为空!") - private String roleName; - - @ApiModelProperty(value = "工号") - @NotNull(message = "工号不能为空!") - private String workNumber; - - @ApiModelProperty(value = "一级部门") - @NotNull(message = "一级部门为空!") - private String firstDept; - - @ApiModelProperty(value = "二级部门") - @NotNull(message = "二级部门不能为空!") - private String secondDept; - - @ApiModelProperty(value = "手机号码") - private String phone; - - @ApiModelProperty(value = "邮箱") - private String email; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/ExcelImpStudentReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/ExcelImpStudentReq.java deleted file mode 100644 index b3dad5b..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/ExcelImpStudentReq.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotNull; - -/** - * @ProjectName: huorantech - * @Package: com.huoran.occupationlab.entity.req - * @ClassName: ExcelImpQuestionReq - * @Description: 批量导入学生所需 - * @Author: Maureen.Rong - * @CreateDate: 2021/8/16 16:49 - * @UpdateDate: 2021/8/16 16:49 - * @Version: 1.0 - */ -@Data -@ApiModel(value = "批量导入学生所需") -public class ExcelImpStudentReq { - - @ApiModelProperty(value = "学生姓名") - @NotNull(message = "学生姓名不能为空!") - private String userName; - - /*@NotNull(message = "账号不能为空!") - @ApiModelProperty(value = "账号") - private String account;*/ - - @ApiModelProperty(value = "学号") - @NotNull(message = "学生学号不能为空!") - private String workNumber; - - @ApiModelProperty(value = "专业") - private String professional; - - @ApiModelProperty(value = "年级") - private String grade; - - @ApiModelProperty(value = "班级") - private String classes; - - @ApiModelProperty(value = "手机号码") - private String phone; - - @ApiModelProperty(value = "邮箱") - private String email; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/ExperimentaForBanklReportReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/ExperimentaForBanklReportReq.java deleted file mode 100644 index 17f2756..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/ExperimentaForBanklReportReq.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.util.List; - -/** - *

- * 存储各子系统的实验报告 - *

- * - * @author lr - * @since 2021-09-08 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@ApiModel(value = "银行实验导出word所需参数", description = "银行实验导出word所需参数") -public class ExperimentaForBanklReportReq { - - @ApiModelProperty(value = "用户名称 (学生姓名)") - private String userName; - - @ApiModelProperty(value = "学号") - private String workNumber; - - @ApiModelProperty(value = "实验总结") - private String summarize; - - @ApiModelProperty(value = "实验目的") - private String purpose; - - @ApiModelProperty(value = "老师名称") - private String teacherName; - - @ApiModelProperty(value = "学时") - private String period; - - @ApiModelProperty(value = "实验室名称") - private String laboratory; - - @ApiModelProperty(value = "指导老师:(考核的自动读取发布考核的老师名称,可修改)") - private String instructor; - - @ApiModelProperty(value = "实验项目名称:(自动读取,可修改)") - private String projectName; - - @ApiModelProperty(value = "学生班级:(自动读取学生班级,可修改)") - private String className; - - @ApiModelProperty(value = "得分") - private Integer score; - - @ApiModelProperty(value = "提交时间") - private String submitTime; - - @ApiModelProperty(value = "耗时") - private Integer timeSum; - - @ApiModelProperty(value = "实验数据") - List experimentalData; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/GetDetailByAccountReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/GetDetailByAccountReq.java deleted file mode 100644 index 233ba6d..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/GetDetailByAccountReq.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotNull; - -/** - * @ProjectName: huorantech - * @Package: com.huoran.occupationlab.entity.req - * @ClassName: GetDetailByAccountReq - * @Description: java类作用描述 - * @Author: Maureen.Rong - * @CreateDate: 2021/8/26 16:09 - * @UpdateDate: 2021/8/26 16:09 - * @Version: 1.0 - */ -@Data -public class GetDetailByAccountReq { - @ApiModelProperty("账号") - @NotNull(message = "账号不能为空") - private String account; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/ModifyStaffReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/ModifyStaffReq.java deleted file mode 100644 index efe0131..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/ModifyStaffReq.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotNull; -import java.util.List; - -/** - * @Author chen - * @DATE 2021/10/13 15:51 - * @Version 1.0 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@ApiModel(value = "ModifyStaffReq", description = "编辑员工") -public class ModifyStaffReq { - - @ApiModelProperty(value = "员工账号id", example = "503") - private Integer accountId; - - @ApiModelProperty(value = "账号", example = "90000") - private String account; - - @ApiModelProperty(value = "用户姓名", example = "遛遛") - private String userName; - - @ApiModelProperty(value = "工号", example = "90000") - private String workNumber; - - @ApiModelProperty(value = "电话", example = "17788771965") - private String phone; - - @ApiModelProperty(value = "邮箱", example = "17788771965@qq.com") - private String email; - - @ApiModelProperty(value = "账号角色及绑定的一级二级部门信息") - private List roleAndDeptList; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/ModifyStudentReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/ModifyStudentReq.java deleted file mode 100644 index fe6401c..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/ModifyStudentReq.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import com.baomidou.mybatisplus.annotation.FieldStrategy; -import com.baomidou.mybatisplus.annotation.TableField; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotNull; - -/** - *

- * 学生表 - *

- * - * @author lr - * @since 2021-08-24 - */ -@Data -@ApiModel(value = "Student对象", description = "学生表") -public class ModifyStudentReq { - @ApiModelProperty(value = "学号/工号") - private String workNumber; - - @ApiModelProperty(value = "学生姓名") - private String userName; - - @ApiModelProperty(value = "账号") - private String account; - - @ApiModelProperty(value = "班级id") - private String classId; - - @ApiModelProperty(value = "电话") - // @TableField(strategy = FieldStrategy.IGNORED) - private String phone; - - @ApiModelProperty(value = "邮箱") - @TableField(strategy = FieldStrategy.IGNORED) - private String email; - - @ApiModelProperty(value = "学校id", hidden = true) - private Integer schoolId; - - @ApiModelProperty(value = "用户id") - private Integer userId; - - @ApiModelProperty(value = "账号id") - private Integer accountId; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/OrganizationStudentReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/OrganizationStudentReq.java deleted file mode 100644 index 8d38084..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/OrganizationStudentReq.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import com.huoran.occupationlab.entity.Class; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotBlank; -import java.util.List; - -/** - * @ProjectName: huorantech - * @Package: com.huoran.occupationlab.entity.req - * @ClassName: PageStudentListReq - * @Description: java类作用描述 - * @Author: Maureen.Rong - * @CreateDate: 2021/8/30 14:29 - * @UpdateDate: 2021/8/30 14:29 - * @Version: 1.0 - */ -@Data -public class OrganizationStudentReq extends PageReq { - @ApiModelProperty(value = "筛选条件", example = "榕", name = "keyWord") - private String keyWord; - - @ApiModelProperty(value = "组织机构id", example = "2", name = "architectureId") - private Integer architectureId; - - @ApiModelProperty(value = "层级(1.专业 2.年级 3.班级)", example = "1", name = "level") - private Integer level; - - @ApiModelProperty(hidden = true) - private List classList; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageAchievementByStuReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageAchievementByStuReq.java deleted file mode 100644 index 9c796f4..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageAchievementByStuReq.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * @description 项目管理请求实体 - * @author: Mr.JK - * @create: 2021-08-27 14:48 - **/ -@Data -@Accessors(chain = true) -public class PageAchievementByStuReq extends PageReq { - - - @ApiModelProperty(value = "课程id", example = "1", required = true) - /*@NotNull(message = "课程id不能为空")*/ - private Integer curriculumId; - - @ApiModelProperty(value = "商品id", example = "1", required = true) - /*@NotNull(message = "课程id不能为空")*/ - private Integer mallId; - - - @ApiModelProperty(value = "账号id", example = "1", required = true, hidden = true) - private Integer accountId; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageAchievementByTeacherReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageAchievementByTeacherReq.java deleted file mode 100644 index 5195255..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageAchievementByTeacherReq.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotNull; -import java.util.List; - -/** - * @description 项目管理请求实体 - * @author: Mr.JK - * @create: 2021-08-27 14:48 - **/ -@Data -@Accessors(chain = true) -public class PageAchievementByTeacherReq extends PageReq { - - @ApiModelProperty(value = "项目权限(0、练习 1、考核 2、竞赛)", example = "0", required = true) - @NotNull(message = "项目权限不能为空!") - private Integer permissions; - - @ApiModelProperty(value = "课程id", example = "1", required = true) - private String curriculumId; - - @ApiModelProperty(value = "课程ids", example = "1,3,4", hidden = true) - private String curriculumIds; - - @ApiModelProperty(value = "月份", example = "1") - private Integer month; - - @ApiModelProperty(value = "开始日期", example = "2021-08-18") - private String startTime; - - @ApiModelProperty(value = "结束日期", example = "2021-08-20") - private String endTime; - - @ApiModelProperty(value = "搜索条件", example = "6") - private String keyWord; - - @ApiModelProperty(value = "账号id", example = "1", required = true, hidden = true) - private Integer accountId; - - @ApiModelProperty(value = "班级id") - private String classId; - - @ApiModelProperty(value = "系统id") - private String systemId; - - @ApiModelProperty(value = "是否为管理员") - private Integer isAdmin; - - @ApiModelProperty(value = "商品id") - private Integer mallId; - - @ApiModelProperty(value = "账号列表(用于区分角色展示数据)") - private List accountIdList; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageAssessmentForProjectReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageAssessmentForProjectReq.java deleted file mode 100644 index ac3e9f2..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageAssessmentForProjectReq.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotNull; - -/** - *

- * 考核管理 - *

- * - * @author lr - * @since 2021-08-18 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@ApiModel(value = "分页请求参数", description = "分页请求参数") -public class PageAssessmentForProjectReq extends PageReq { - - @ApiModelProperty(value = "项目名称") - private String projectName; - - @ApiModelProperty(value = "课程id") - @NotNull(message = "课程id不能为空") - private String cid; - - - @ApiModelProperty(value = "商品id") - @NotNull(message = "商品id不能为空") - private Integer mallId; - - @ApiModelProperty(value = "系统id") - @NotNull(message = "系统id不能为空") - private String systemId; - - @ApiModelProperty(value = "账号id", hidden = true) - private Integer accountId; - - @ApiModelProperty(value = "项目权限(0、练习 1、考核 2、竞赛)") - private Integer permissions; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageAssessmentReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageAssessmentReq.java deleted file mode 100644 index 2e4744b..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageAssessmentReq.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import com.baomidou.mybatisplus.annotation.*; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import java.io.Serializable; -import java.util.Date; - -/** - *

- * 考核管理 - *

- * - * @author lr - * @since 2021-08-18 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@ApiModel(value = "分页请求参数", description = "分页请求参数") -public class PageAssessmentReq extends PageReq { - - @ApiModelProperty(value = "搜索框筛选条件 默认不传") - private String keyWord; - - @ApiModelProperty(value = "发布类型(1、手动发布 2、定时发布) 默认不传") - private Integer type; - - @ApiModelProperty(value = "状态(0、待开始 1、进行中 2、已结束) 默认不传") - private Integer status; - - @ApiModelProperty(value = "课程id 默认不传") - private Integer curriculumId; - - @ApiModelProperty(value = "月份(传值 1 3 6) 默认不传") - private Integer month; - - @ApiModelProperty(value = "账号id", name = "accountId", example = "1", required = true) - @NotNull(message = "账号id不能为空") - private Integer accountId; - - @ApiModelProperty(value = "开始时间", name = "startTime", example = "2021-08-26") - private String startTime; - @ApiModelProperty(value = "结束时间", name = "startTime", example = "2021-08-30") - private String endTime; - - @ApiModelProperty(value = "商品id") - private Integer mallId; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageContestListReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageContestListReq.java deleted file mode 100644 index 7df6dd5..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageContestListReq.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import lombok.Data; - -import java.util.Date; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * @描述:竞赛管理表 - * @作者: Rong - * @日期: 2022-06-16 - */ -@Data -@ApiModel(value = "赛事列表分页") -public class PageContestListReq extends PageReq{ - - @ApiModelProperty(value = "关键词(竞赛名称/创建人)",example = "事") - private String keyWord; - - @ApiModelProperty(value = "发布状态(0未发布,1已发布)") - private Integer publishStatus; - - @ApiModelProperty(value = "大赛来源(0中台,1职站)",example = "1") - private String platformSource; - - @ApiModelProperty(value = "大赛范围(0:本校内 1:全平台 2.指定区域、院校)",example = "0") - private String competitionScope; - - @ApiModelProperty(value = "开始时间") - private String startTime; - - @ApiModelProperty(value = "结束时间") - private String endTime; - - @ApiModelProperty(value = "省") - private Integer provinceId; - - @ApiModelProperty(value = "市") - private Integer cityId; - - @ApiModelProperty(value = "排序(1:近期排名 2.最近更新)") - private Integer sequence; - - @ApiModelProperty(value = "账号id") - private Integer accountId; - - @ApiModelProperty(value = "是否登录:-1未登录/1已登录") - private Integer isLogin; -} \ No newline at end of file diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageRegistrationStaffReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageRegistrationStaffReq.java deleted file mode 100644 index d1dcc99..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageRegistrationStaffReq.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * @描述:竞赛管理表 - * @作者: Rong - * @日期: 2022-06-16 - */ -@Data -@ApiModel(value = "报名人员分页参数列表") -public class PageRegistrationStaffReq extends PageReq{ - - - - - @ApiModelProperty(value = "关键词(学生姓名/手机号)",example = "18818574533") - private String keyWord; - - @ApiModelProperty(value = "赛事ID",example = "1485860415656255489") - private String contestId; - - - -} \ No newline at end of file diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageReq.java deleted file mode 100644 index 6d14f2e..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageReq.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * @ProjectName: huorantech - * @Package: com.huoran.occupationlab.entity.req - * @ClassName: PageReq - * @Description: 分页 - * @Author: Maureen.Rong - * @CreateDate: 2021/8/12 15:10 - * @UpdateDate: 2021/8/12 15:10 - * @Version: 1.0 - */ -@Data -public class PageReq { - - @ApiModelProperty(value = "当前页数", name = "pageNum", example = "1", required = true) - private Integer pageNum; - - @ApiModelProperty(value = "当前页需要显示的数量", name = "pageSize", example = "10", required = true) - private Integer pageSize; - - @ApiModelProperty(hidden = true) - private Integer schoolId; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageStaffListReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageStaffListReq.java deleted file mode 100644 index 4241c5b..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageStaffListReq.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import cn.hutool.db.Page; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * @描述:员工管理列表请求参数 - * @作者: Rong - * @日期: 2021/10/14 14:25 - */ -@Data -public class PageStaffListReq extends PageReq { - - @ApiModelProperty(value = "搜索关键词", example = "1") - private String keyWord; - - @ApiModelProperty(value = "员工年级表主键ID", example = "1") - private String gradeId; - - @ApiModelProperty(value = "员工部门主键ID", example = "1") - private String staffArchitectureId; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageStuAssessmentReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageStuAssessmentReq.java deleted file mode 100644 index 1da52f5..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageStuAssessmentReq.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 考核管理 - *

- * - * @author lr - * @since 2021-08-18 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@ApiModel(value = "学生考核列表", description = "分页请求参数") -public class PageStuAssessmentReq extends PageReq { - - @ApiModelProperty(value = "搜索框筛选条件 默认不传", name = "keyWord", example = "K") - private String keyWord; - - @ApiModelProperty(value = "实验状态(0、待开始 1、进行中 2、已结束) 默认不传", name = "status", example = "0") - private Integer status; - - @ApiModelProperty(value = "系统名称(非id) 默认不传") - private String sysName; - - @ApiModelProperty(value = "月份(传值 1 3 6) 默认不传") - private Integer month; - - @ApiModelProperty(value = "学生账号id", name = "accountId", example = "2", required = true) - private Integer accountId; - - @ApiModelProperty(value = "班级id", name = "accountId", example = "103", required = true) - private Integer classId; - - @ApiModelProperty(value = "课程id", name = "curriculumId") - private Integer curriculumId; - - @ApiModelProperty(value = "商品id", name = "mallId") - private Integer mallId; - - @ApiModelProperty(value = "开始时间", name = "startTime", example = "2021-08-26") - private String startTime; - @ApiModelProperty(value = "结束时间", name = "startTime", example = "2021-08-30") - private String endTime; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageStudentListReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageStudentListReq.java deleted file mode 100644 index e2aa28b..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageStudentListReq.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotBlank; - -/** - * @ProjectName: huorantech - * @Package: com.huoran.occupationlab.entity.req - * @ClassName: PageStudentListReq - * @Description: java类作用描述 - * @Author: Maureen.Rong - * @CreateDate: 2021/8/30 14:29 - * @UpdateDate: 2021/8/30 14:29 - * @Version: 1.0 - */ -@Data -public class PageStudentListReq extends PageReq { - @ApiModelProperty(value = "筛选条件", example = "榕", name = "keyWord") - private String keyWord; - - @ApiModelProperty(value = "类型:必填一个(1.所有学生 2.未加入班级学生)", required = true, example = "1") - @NotBlank(message = "类型不能为空") - private Integer type; - - private Integer accountId; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageStudentTheoreticalCourseReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageStudentTheoreticalCourseReq.java deleted file mode 100644 index 6cffcaf..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageStudentTheoreticalCourseReq.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - - -@Data -@ApiModel(value = "学生端分页查询课程所需参数", description = "学生端分页查询课程所需参数") -public class PageStudentTheoreticalCourseReq extends PageReq { - - - @ApiModelProperty(value = "关键字") - private String keyWord; - - @ApiModelProperty(value = "课程类型(0.免费 1.付费)") - private Integer courseType; - - @ApiModelProperty(value = "课程分类id") - private Integer categoryId; - - @ApiModelProperty(value = "来源(0.共享课堂 1.本校课程)") - private Integer courseSource; - - @ApiModelProperty(hidden = true) - private Integer accountId; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageSysJobLogReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageSysJobLogReq.java deleted file mode 100644 index 615f315..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageSysJobLogReq.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.util.Date; - -/** - * 定时任务日志 - * - * @author cheney - * @version V1.0 - * @date 2022年7月28日 - */ -@EqualsAndHashCode(callSuper = false) -@Data -public class PageSysJobLogReq extends PageReq { - - /** - * 任务日志id - */ - @TableId("id") - private String id; - - /** - * 任务id - */ - @TableField("job_id") - private String jobId; - - /** - * spring bean名称 - */ - @TableField("bean_name") - private String beanName; - - /** - * 参数 - */ - @TableField("params") - private String params; - - /** - * 任务状态 0:成功 1:失败 - */ - @TableField("status") - private Integer status; - - /** - * 失败信息 - */ - @TableField("error") - private String error; - - /** - * 耗时(单位:毫秒) - */ - @TableField("times") - private Integer times; - - /** - * 创建时间 - */ - @TableField(value = "create_time", fill = FieldFill.INSERT) - private Date createTime; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageSysJobReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageSysJobReq.java deleted file mode 100644 index eccac3e..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageSysJobReq.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.util.Date; - -/** - * 定时任务 - * - * @author cheney - * @version V1.0 - * @date 2022年7月28日 - */ -@EqualsAndHashCode(callSuper = false) -@Data -@TableName("sys_job") -public class PageSysJobReq extends PageReq { - /** - * 任务调度参数key - */ - - /** - * 任务id - */ - @TableId("id") - private String id; - - /** - * spring bean名称 - */ - @TableField("bean_name") - private String beanName; - - /** - * 参数 - */ - @TableField("params") - private String params; - - /** - * cron表达式 - */ - @TableField("cron_expression") - private String cronExpression; - - /** - * 任务状态 0:正常 1:暂停 - */ - @TableField("status") - private Integer status; - - /** - * 备注 - */ - @TableField("remark") - private String remark; - - /** - * 创建时间 - */ - @TableField(value = "create_time", fill = FieldFill.INSERT) - private Date createTime; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageSysLogReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageSysLogReq.java deleted file mode 100644 index 21ae283..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageSysLogReq.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.util.Date; - -/** - * 操作日志 - * - * @author cheney - * @version V1.0 - * @date 2022年7月28日 - */ -@EqualsAndHashCode(callSuper = true) -@Data -public class PageSysLogReq extends PageReq { - @TableId - private String id; - - private String userId; - - private String userName; - - private String operation; - - private Integer time; - - private String method; - - private String params; - - private String ip; - - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - @TableField(exist = false) - private String startTime; - - @TableField(exist = false) - private String endTime; - -} \ No newline at end of file diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageTheoreticalCourseReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageTheoreticalCourseReq.java deleted file mode 100644 index d13ee9a..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PageTheoreticalCourseReq.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import com.baomidou.mybatisplus.annotation.*; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.Date; - - -@Data -@ApiModel(value = "分类查询课程所需参数", description = "分类查询课程所需参数") -public class PageTheoreticalCourseReq extends PageReq { - - - @ApiModelProperty(value = "关键字") - private String keyWord; - - @ApiModelProperty(value = "课程类型(0.免费 1.付费)") - private Integer courseType; - - @ApiModelProperty(value = "平台来源(0中台,1职站)") - private Integer platformSource; - - @ApiModelProperty(value = "可见范围(0:本校内 1:全平台 2.指定区域、院校)") - private Integer visibleRange; - - @ApiModelProperty(value = "课程分类id") - private Integer categoryId; - - @ApiModelProperty(value = "创建平台(0为平台自建,1为院校创建)") - private Integer createPlatform; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PerformanceUnderProductReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PerformanceUnderProductReq.java deleted file mode 100644 index 54f76c3..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/PerformanceUnderProductReq.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - * 产品下练习、考核成绩请求参数 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -public class PerformanceUnderProductReq extends PageReq { - - @ApiModelProperty(value = "产品id") - private Integer mallId; - - @ApiModelProperty(value = "筛选类型(0、练习 1、考核 2、竞赛)") - private Integer permissions; - - @ApiModelProperty(value = "关键字") - private String keyWord; - - - @ApiModelProperty(value = "学生账号id(查看学生全部成绩详情必传)") - private Integer studentAccountId; - - @ApiModelProperty(value = "班级id") - private Integer classId; - - @ApiModelProperty(value = "课程id") - private Integer cid; - - //课程 - /*@ApiModelProperty(value = "课程名称") - private String goodsName;*/ - - /* //班级 - @ApiModelProperty(value = "班级名称") - private String className;*/ - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/ProjectManageReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/ProjectManageReq.java deleted file mode 100644 index 859d855..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/ProjectManageReq.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import java.io.Serializable; -import java.util.List; - -/** - * @description 项目管理请求实体 - * @author: Mr.JK - * @create: 2021-08-27 14:48 - **/ -@Data -@Accessors(chain = true) -public class ProjectManageReq implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "项目名称") - private String projectName; - - @ApiModelProperty(value = "项目权限(0、练习 1、考核 2、竞赛)") - private Integer permissions; - - @ApiModelProperty(value = "系统id") - @NotNull(message = "系统id不能为空!") - private String systemId; - - @ApiModelProperty(value = "创建人角色(0、系统 1、老师 2、全部)") - @NotNull(message = "创建人不能为空!") - private Integer founder; - - @ApiModelProperty(value = "状态(0、草稿箱 1、已发布)") - private Integer state; - - @ApiModelProperty(value = "平台:职站->1 中台->3") - private Integer platformId; - - @ApiModelProperty(value = "学校id") - private Integer schoolId; - - @ApiModelProperty(value = "起始页") - private Integer pageNum; - - @ApiModelProperty(value = "页数") - private Integer pageSize; - - @ApiModelProperty(value = "账号id") - private Integer accountId; - - @ApiModelProperty(value = "是否是本校超管以及管理员(0为否 1为是)") - private Integer isAdmin; - - @ApiModelProperty(value = "课程id") - private String cid; - - @ApiModelProperty(value = "用于判断职站项目管理学校之间的启用禁用") - private Integer occupationlabDel; - - @ApiModelProperty(value = "职站当前登录用户角色") - private String occupationlabRole; - - - @ApiModelProperty(value = "账号ids") - private List accountIdList; - - @ApiModelProperty(value = "商品id") - private Integer mallId; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/QuestionsAddReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/QuestionsAddReq.java deleted file mode 100644 index 413888d..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/QuestionsAddReq.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * 试题的基本信息表 - * - * @author gongsj - */ -@Data -@ApiModel(value = "QuestionsAddRequest", description = "添加试题请求体对象") -public class QuestionsAddReq { - /** - * 题型:1、单选题,2、多选题,3、判断题 - */ - @ApiModelProperty(value = "题型:1、单选题,2、多选题,3、判断题", name = "questionType", example = "1", required = true) - private Integer questionType; - /** - * 题干信息 - */ - @ApiModelProperty(value = "题干信息", name = "questionStem", example = "世界上最大的哺乳动物是什么?", required = true) - private String questionStem; - /** - * A选项内容 - */ - @ApiModelProperty(value = "A选项内容", name = "optionA", example = "鲸鱼") - private String optionA; - /** - * B选项内容 - */ - @ApiModelProperty(value = "B选项内容", name = "optionB", example = "鲨鱼") - private String optionB; - /** - * C选项内容 - */ - @ApiModelProperty(value = "C选项内容", name = "optionC", example = "河马") - private String optionC; - /** - * D选项内容 - */ - @ApiModelProperty(value = "D选项内容", name = "optionD", example = "豹子") - private String optionD; - /** - * E选项内容 - */ - @ApiModelProperty(value = "E选项内容", name = "optionE", example = "大象") - private String optionE; - /** - * F选项内容 - */ - @ApiModelProperty(value = "F选项内容", name = "optionF", example = "老虎") - private String optionF; - /** - * 正确答案 - */ - @ApiModelProperty(value = "正确答案", name = "answer", example = "A", required = true) - private String answer; - /** - * 答案解析 - */ - @ApiModelProperty(value = "答案解析", name = "answerAnalysis", example = "鲸鱼是最大的哺乳动物") - private String answerAnalysis; - - @ApiModelProperty(value = "创建人用户账号id", name = "accountId", example = "1", required = true) - private Integer accountId; - - @ApiModelProperty(value = "学校id", name = "schoolId", example = "1") - private Integer schoolId; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/QuestionsImportReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/QuestionsImportReq.java deleted file mode 100644 index dd774cf..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/QuestionsImportReq.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import com.huoran.occupationlab.utils.poi.ExcelAttribute; -import lombok.Data; -import lombok.ToString; - -/** - * 试题的基本信息表 - * - * @author gongsj - */ -@Data -@ToString -public class QuestionsImportReq { - /** - * 第几行 - */ - private Integer index; - - /** - * 题干,问题描述 - */ - @ExcelAttribute(sort = 0) - private String questionStem; - /** - * 题型 - */ - @ExcelAttribute(sort = 1) - private String questionTypeName; - /** - * 选项A - */ - @ExcelAttribute(sort = 2) - private String optionA; - /** - * 选项B - */ - @ExcelAttribute(sort = 3) - private String optionB; - /** - * 选项C - */ - @ExcelAttribute(sort = 4) - private String optionC; - /** - * 选项D - */ - @ExcelAttribute(sort = 5) - private String optionD; - /** - * 选项E - */ - @ExcelAttribute(sort = 6) - private String optionE; - /** - * 选项F - */ - @ExcelAttribute(sort = 7) - private String optionF; - /** - * 正确答案 - */ - @ExcelAttribute(sort = 8) - private String answer; - /** - * 答案解析 - */ - @ExcelAttribute(sort = 9) - private String answerAnalysis; - - public String toStringForCompare() { - return questionStem + - questionTypeName + - optionA + - optionB + - optionC + - optionD + - optionE + - optionF; - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/QuestionsQueryReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/QuestionsQueryReq.java deleted file mode 100644 index 853f777..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/QuestionsQueryReq.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * 试题的基本信息表 - * - * @author gongsj - */ -@Data -@ApiModel(value = "QuestionsQueryRequest", description = "条件查询请求对象") -public class QuestionsQueryReq extends PageReq { - - /** - * 题干,问题描述 - */ - @ApiModelProperty(value = "题干,问题描述", name = "questionStem", example = "世界上最大的哺乳动物是什么?") - private String questionStem; - - /** - * 题型 - */ - @ApiModelProperty(value = "题型:1、单选题,2、多选题,3、判断题", name = "questionType", example = "1") - private Integer questionType; - - @ApiModelProperty(value = "创建人用户账号id", name = "accountId", example = "1", required = true) - private Integer accountId; - - @ApiModelProperty(value = "学校id", name = "schoolId", example = "1") - private Integer schoolId; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/QuestionsUpdateReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/QuestionsUpdateReq.java deleted file mode 100644 index 61ec60d..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/QuestionsUpdateReq.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * 试题的基本信息表 - * - * @author gongsj - */ -@Data -@ApiModel(value = "QuestionsUpdateRequest", description = "修改试题请求体对象") -public class QuestionsUpdateReq { - /** - * 主键 - */ - @ApiModelProperty(value = "主键", name = "id", example = "1", required = true) - private Integer id; - /** - * 题型:1、单选题,2、多选题,3、判断题 - */ - @ApiModelProperty(value = "题型:1、单选题,2、多选题,3、判断题", name = "questionType", example = "1", required = true) - private Integer questionType; - /** - * 题干信息 - */ - @ApiModelProperty(value = "题干信息", name = "questionStem", example = "世界上最大的哺乳动物是什么?", required = true) - private String questionStem; - /** - * A选项内容 - */ - @ApiModelProperty(value = "A选项内容", name = "optionA", example = "鲸鱼") - private String optionA; - /** - * B选项内容 - */ - @ApiModelProperty(value = "B选项内容", name = "optionB", example = "鲨鱼") - private String optionB; - /** - * C选项内容 - */ - @ApiModelProperty(value = "C选项内容", name = "optionC", example = "河马") - private String optionC; - /** - * D选项内容 - */ - @ApiModelProperty(value = "D选项内容", name = "optionD", example = "豹子") - private String optionD; - /** - * E选项内容 - */ - @ApiModelProperty(value = "E选项内容", name = "optionE", example = "大象") - private String optionE; - /** - * F选项内容 - */ - @ApiModelProperty(value = "F选项内容", name = "optionF", example = "老虎") - private String optionF; - /** - * 正确答案 - */ - @ApiModelProperty(value = "正确答案", name = "answer", example = "A", required = true) - private String answer; - /** - * 答案解析 - */ - @ApiModelProperty(value = "答案解析", name = "answerAnalysis", example = "鲸鱼是最大的哺乳动物") - private String answerAnalysis; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/StudentPerformanceAnalysisReq.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/StudentPerformanceAnalysisReq.java deleted file mode 100644 index 370fbad..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/req/StudentPerformanceAnalysisReq.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.huoran.occupationlab.entity.req; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.util.List; - -/** - * 学生成绩分布分析 - */ -@Data -@Accessors(chain = true) -public class StudentPerformanceAnalysisReq { - - - @ApiModelProperty(value = "开始时间") - private String startTime; - - @ApiModelProperty(value = "结束时间") - private String endTime; - - @ApiModelProperty(value = "课程id") - private List cids; - - - @ApiModelProperty(value = "商品id") - private List mallIds; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/AcademicLeadersRankingResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/AcademicLeadersRankingResp.java deleted file mode 100644 index 1c04b6a..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/AcademicLeadersRankingResp.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 学霸排行榜 - */ -@Data -@Accessors(chain = true) -public class AcademicLeadersRankingResp { - - @ApiModelProperty(value = "账号id") - private Integer accountId; - - - @ApiModelProperty(value = "平均分") - private double avgScore; - - @ApiModelProperty(value = "练习次数") - private Integer practiceNumber; - - @ApiModelProperty(value = "用户名称") - private String userName; - - @ApiModelProperty(value = "班级名称") - private String className; - - @ApiModelProperty(value = "学校名称") - private String schoolName; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/AchievementByPracticeResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/AchievementByPracticeResp.java deleted file mode 100644 index 410e877..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/AchievementByPracticeResp.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import cn.afterturn.easypoi.excel.annotation.ExcelTarget; -import com.baomidou.mybatisplus.annotation.TableField; -import com.huoran.occupationlab.entity.Class; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.util.Date; -import java.util.List; - -/** - *

- * 项目管理表 - *

- * - * @author Mr.JK - * @since 2021-08-26 - */ -@Data -@Accessors(chain = true) -@ExcelTarget("AchievementByPracticeResp") -public class AchievementByPracticeResp { - - @ApiModelProperty(value = "项目id") - private Integer projectId; - - @ApiModelProperty(value = "项目名称") - private String projectName; - - @ApiModelProperty(value = "创建时间") - private Date createTime; - - @ApiModelProperty(value = "成绩报告数量") - private Integer experimentalNumber; - - @ApiModelProperty(value = "是否为内置项目(1为内置项目 默认为0)") - private Integer isAdmin; - - @ApiModelProperty(value = "是否删除(1为已删除 默认为0)") - private Integer isDel; - - @ApiModelProperty(value = "课程引用项目是否移除(1为已删除 默认为0)") - private Integer courseDel; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/AchievementResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/AchievementResp.java deleted file mode 100644 index 733a53f..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/AchievementResp.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import cn.afterturn.easypoi.excel.annotation.ExcelTarget; -import com.baomidou.mybatisplus.annotation.*; -import com.huoran.occupationlab.entity.Class; -import com.huoran.occupationlab.entity.req.ClassReq; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import java.io.Serializable; -import java.util.Date; -import java.util.List; - -/** - *

- * 项目管理表 - *

- * - * @author Mr.JK - * @since 2021-08-26 - */ -@Data -@Accessors(chain = true) -@ExcelTarget("AchievementResp") -public class AchievementResp { - - @ApiModelProperty(value = "项目id") - private Integer projectId; - - @ApiModelProperty(value = "项目名称") - private String projectName; - - @ApiModelProperty(value = "课程名称") - private String curriculumName; - - @ApiModelProperty(value = "项目权限(0、练习 1、考核 2、竞赛)") - private Integer permissions; - - @ApiModelProperty(value = "系统id") - private Integer systemId; - - @ApiModelProperty(value = "创建时间") - private Date createTime; - - @ApiModelProperty(value = "成绩报告数量") - private Integer experimentalNumber; - - @ApiModelProperty(value = "考核id") - private Integer assessmentId; - - @ApiModelProperty(value = "班级") - private String className; - - @ApiModelProperty(value = "实验名称") - private String experimentalName; - - @ApiModelProperty(value = "班级id") - private String classId; - - @ApiModelProperty(value = "耗时") - private String timeSum; - - @ApiModelProperty(value = "成绩报告id") - private Integer reportId; - - @Excel(name = "学校名称", orderNum = "1", isImportField = "schoolName", width = 30) - @ApiModelProperty(value = "学校名称") - private String schoolName; - - @Excel(name = "学生姓名", orderNum = "2", isImportField = "userName", width = 30) - @ApiModelProperty(value = "学生姓名") - private String userName; - - @Excel(name = "学号", orderNum = "3", isImportField = "workNumber", width = 30) - @ApiModelProperty(value = "学号") - private String workNumber; - - @Excel(name = "分数", orderNum = "4", isImportField = "score", width = 30) - @ApiModelProperty(value = "分数") - private Integer score; - - @Excel(name = "提交时间", orderNum = "5", isImportField = "submitTime", width = 30) - @ApiModelProperty(value = "提交时间") - private String submitTime; - - @ApiModelProperty(value = "最高分") - private Integer hightScore; - - @ApiModelProperty(value = "最近实验时间") - private String lastTime; - - @ApiModelProperty(value = "练习次数") - private Integer practiceNum; - - @ApiModelProperty(value = "累计时长") - private String duration; - - @ApiModelProperty(value = "进入时间") - private String startTime; - - @ApiModelProperty(value = "结束时间") - private String endTime; - - @ApiModelProperty(value = "是否删除") - private Integer isDel; - - @ApiModelProperty(value = "班级信息列表") - @TableField(exist = false) - private List classList; - - @ApiModelProperty(value = "课程id") - private Integer curriculumId; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ActiveLeaderboardtResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ActiveLeaderboardtResp.java deleted file mode 100644 index 1482238..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ActiveLeaderboardtResp.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - - -@Data -@ApiModel(value = "活跃排行榜", description = "活跃排行榜") -public class ActiveLeaderboardtResp { - - - @ApiModelProperty(value = "班级id(String类型)") - private String classIds; - - @ApiModelProperty(value = "实验报告id") - private Integer reportId; - - @ApiModelProperty(value = "学生ID") - private Integer studentId; - - @ApiModelProperty(value = "学校名字") - private String schoolName; - - @ApiModelProperty(value = "活跃指数") - private String activityIndex ; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/AssessProjectsUnderTheProductResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/AssessProjectsUnderTheProductResp.java deleted file mode 100644 index 4d50930..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/AssessProjectsUnderTheProductResp.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * 产品下考核项目情况 - */ -@Data -public class AssessProjectsUnderTheProductResp { - - - @ApiModelProperty(value = "序号") - @Excel(name = "序号", orderNum = "1", isImportField = "rownum", width = 30) - private Integer rownum; - - //课程 - @ApiModelProperty(value = "课程名称") - @Excel(name = "课程名称", orderNum = "2", mergeVertical = true, isImportField = "goodsName", width = 30) - private String goodsName; - - //班级 - @ApiModelProperty(value = "班级名称") - @Excel(name = "班级名称", orderNum = "3", mergeVertical = true, isImportField = "className", width = 30) - private String className; - - - @ApiModelProperty(value = "姓名") - @Excel(name = "姓名", orderNum = "3", mergeVertical = true, isImportField = "username", width = 30) - private String userName; - - - @ApiModelProperty(value = "学号") - @Excel(name = "学号", orderNum = "4", mergeVertical = true, isImportField = "workNumber", width = 30) - private String workNumber; - - @ApiModelProperty(value = "当前学生已经考核次数") - @Excel(name = "参加考核次数", orderNum = "5", mergeVertical = false, isImportField = "totalNumberOfParticipants", width = 30) - private String totalNumberOfParticipants; - - - @ApiModelProperty(value = "平均用时") - @Excel(name = "平均用时", orderNum = "6", mergeVertical = false, isImportField = "averageTimeSpent", width = 30) - private Integer averageTimeSpent; - - @ApiModelProperty(value = "平均分") - @Excel(name = "平均分", orderNum = "7", mergeVertical = false, isImportField = "avgScore", width = 30) - private String averageScore; - - @ApiModelProperty(value = "最高分") - @Excel(name = "最高分", orderNum = "8", mergeVertical = false, isImportField = "maxScore", width = 30) - private Integer maxScore; - - @ApiModelProperty(value = "最低分") - @Excel(name = "最低分", orderNum = "9", mergeVertical = false, isImportField = "minScore", width = 30) - private Integer minScore; - - - @ApiModelProperty(value = "账号id") - private Integer accountId; - - @ApiModelProperty(value = "发布的考核总次数") - private Integer totalAssessment; - - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/AssessScoreDetailsUnderProductResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/AssessScoreDetailsUnderProductResp.java deleted file mode 100644 index 5f87220..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/AssessScoreDetailsUnderProductResp.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 产品下考核成绩详情 - */ -@Data -@Accessors(chain = true) -public class AssessScoreDetailsUnderProductResp { - - @ApiModelProperty(value = "序号") - @Excel(name = "序号", orderNum = "1", isImportField = "rownum", width = 30) - private Integer rownum; - - //课程 - @ApiModelProperty(value = "课程名称") - @Excel(name = "课程名称", orderNum = "2", mergeVertical = true, isImportField = "goodsName", width = 30) - private String goodsName; - - //班级 - @ApiModelProperty(value = "班级名称") - @Excel(name = "班级名称", orderNum = "3", mergeVertical = true, isImportField = "className", width = 30) - private String className; - - @ApiModelProperty(value = "姓名") - @Excel(name = "姓名", orderNum = "4", mergeVertical = true, isImportField = "username", width = 30) - private String userName; - - - @ApiModelProperty(value = "学号") - @Excel(name = "学号", orderNum = "5", mergeVertical = true, isImportField = "workNumber", width = 30) - private String workNumber; - - @ApiModelProperty(value = "考核名称") - @Excel(name = "考核名称", orderNum = "6", mergeVertical = false, isImportField = "experimentalName", width = 30) - private String experimentalName; - - - @ApiModelProperty(value = "用时") - @Excel(name = "用时", orderNum = "7", mergeVertical = false, isImportField = "timeSum", width = 30) - private Integer timeSum; - - - @ApiModelProperty(value = "分数") - @Excel(name = "分数", orderNum = "8", mergeVertical = false, isImportField = "score", width = 30) - private String score; - - @ApiModelProperty(value = "项目id") - private Integer projectId; - - @ApiModelProperty(value = "班级id") - private String classId; - - - @ApiModelProperty(value = "账号id") - private Integer accountId; - - @ApiModelProperty(value = "实验报告id") - private Integer reportId; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ClassStatisticsResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ClassStatisticsResp.java deleted file mode 100644 index 5fa23ee..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ClassStatisticsResp.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.List; - - -@Data -@ApiModel(value = "班级统计", description = "班级统计") -public class ClassStatisticsResp { - - - - @ApiModelProperty(value = "班级id(Integer类型)") - private Integer classId; - - @ApiModelProperty(value = "统计次数") - private Integer countNumber; - - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ContestRangeResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ContestRangeResp.java deleted file mode 100644 index 675d06c..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ContestRangeResp.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.io.Serializable; - -/** - *

- * - *

- * - * @author lr - * @since 2022-06-16 - */ -@Data -@ApiModel(value = "大赛范围选择") -public class ContestRangeResp { - - - - @ApiModelProperty(value = "竞赛主键") - private String contestId; - - @ApiModelProperty(value = "省") - private String provinceName; - - @ApiModelProperty(value = "市") - private String cityName; - - @ApiModelProperty(value = "学校id") - private String schoolName; - - @ApiModelProperty(value = "范围类型(0为学校 1为地区)") - private Integer type; - -} \ No newline at end of file diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/EnterExamResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/EnterExamResp.java deleted file mode 100644 index 23037bf..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/EnterExamResp.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * @描述: - * @作者: Rong - * @日期: 2021/11/17 11:18 - */ -@Data -@Accessors(chain = true) -public class EnterExamResp { - @ApiModelProperty(value = "项目id") - private Integer projectId; - - @ApiModelProperty(value = "跳转路径") - private String url; - - @ApiModelProperty(value = "系统id") - private Integer systemId; - - @ApiModelProperty(value = "系统id") - private Integer assessmentId; - - @ApiModelProperty(value = "课程id") - private Integer cid; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ErrorRateAnalysisResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ErrorRateAnalysisResp.java deleted file mode 100644 index 1b78076..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ErrorRateAnalysisResp.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.List; - -/** - * 错误率分析 - */ -@Data -public class ErrorRateAnalysisResp { - - - /*@ApiModelProperty(value = "最高错误率名称") - private ScorePointsUnderTheItemResp highestErrorRate; - - @ApiModelProperty(value = "最低错误率名称") - private ScorePointsUnderTheItemResp minimumErrorRate;*/ - - - @ApiModelProperty(value = "获取项目下的全部判分点以及错误率") - private List scoringPointList; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ExamStatisticsResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ExamStatisticsResp.java deleted file mode 100644 index a358a1b..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ExamStatisticsResp.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 平台考试数据统计 - */ -@Data -@Accessors(chain = true) -public class ExamStatisticsResp { - - @ApiModelProperty(value = "考试总场次") - private Integer totalNumberOfExams; - - - @ApiModelProperty(value = "参考人数") - private Integer referenceNumber; - - @ApiModelProperty(value = "考试通过率") - private String examPassRate; - - @ApiModelProperty(value = "通过人数") - private Integer numberOfPeoplePassed; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ExperimentOverviewResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ExperimentOverviewResp.java deleted file mode 100644 index 3d20ce2..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ExperimentOverviewResp.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotNull; - -/** - *

- * 学生组织架构 - *

- * - * @author lr - * @since 2021-08-24 - */ -@Data -@ApiModel(value = "实验概览", description = "实验概览") -public class ExperimentOverviewResp { - - - @ApiModelProperty(value = "姓名") - private String userName; - - @ApiModelProperty(value = "实验次数") - private Integer experimentalNum; - - - @ApiModelProperty(value = "时长") - private String duration; - - - @ApiModelProperty(value = "实验平均分") - private double avgScore; - - @ApiModelProperty(value = "实验总分") - private double sumScore; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ExperimentalReportDataBindingResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ExperimentalReportDataBindingResp.java deleted file mode 100644 index 12b3879..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ExperimentalReportDataBindingResp.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.Date; - -/** - * 实验报告数据绑定 - */ -@Data -public class ExperimentalReportDataBindingResp { - - - @ApiModelProperty(value = "实验报告主键") - private Integer reportId; - - - @ApiModelProperty(value = "商品id") - private Integer mallId; - - @ApiModelProperty(value = "原来实验报告绑定的产品id 有可能为0 有可能为空") - private Integer oldMallId; - - @ApiModelProperty(value = "考核id") - private Integer id; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ExperimentalReportResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ExperimentalReportResp.java deleted file mode 100644 index 11af127..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ExperimentalReportResp.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import com.baomidou.mybatisplus.annotation.*; -import com.huoran.occupationlab.entity.UserScore; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.Date; -import java.util.List; - -/** - *

- * 存储各子系统的实验报告 - *

- * - * @author lr - * @since 2021-09-08 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@ApiModel(value = "实验导出word所需参数", description = "实验导出word所需参数") -public class ExperimentalReportResp implements Serializable { - - @ApiModelProperty(value = "用户名称 (学生姓名)") - @TableField(exist = false) - private String userName; - - @ApiModelProperty(value = "学号") - private String workNumber; - - @ApiModelProperty(value = "实验原理") - private String principle; - - @ApiModelProperty(value = "实验内容") - private String content; - - @ApiModelProperty(value = "实验步骤") - private String step; - - @ApiModelProperty(value = "实验数据") - private String data; - - @ApiModelProperty(value = "实验分析") - private String analysis; - - @ApiModelProperty(value = "实验结论") - private String conclusion; - - @ApiModelProperty(value = "实验总结") - private String summarize; - - @ApiModelProperty(value = "实验器材") - private String equipment; - - @ApiModelProperty(value = "实验目的") - private String purpose; - - @ApiModelProperty(value = "对本实验过程方法及手段的改进建议") - private String improvement; - - @ApiModelProperty(value = "教师评语") - private String comment; - - @ApiModelProperty(value = "老师名称") - @TableField(exist = false) - private String teacherName; - - @ApiModelProperty(value = "学时") - private String period; - - @ApiModelProperty(value = "实验室名称") - private String laboratory; - - @ApiModelProperty(value = "是否启用教师签名(0不启用,1启用,默认0)") - private Integer isSignature; - - @ApiModelProperty(value = "指导老师:(考核的自动读取发布考核的老师名称,可修改)") - private String instructor; - - @ApiModelProperty(value = "实验项目名称:(自动读取,可修改)") - private String projectName; - - @ApiModelProperty(value = "学生班级:(自动读取学生班级,可修改)") - private String className; - - @ApiModelProperty(value = "得分") - private Integer score; - - @ApiModelProperty(value = "进入时间") - private String startTime; - - @ApiModelProperty(value = "结束时间") - private String endTime; - - @ApiModelProperty(value = "提交时间") - private String submitTime; - - @ApiModelProperty(value = "耗时") - private Integer timeSum; - - @ApiModelProperty(value = "实验数据") - List experimentalData; - - @ApiModelProperty(value = "运行图片集合") - @TableField(exist = false) - private List runThePictureList; - - - @ApiModelProperty(value = "运行图片(未截取分割前的)") - @TableField(exist = false) - private String runThePicture; - - @ApiModelProperty(value = "运行结果") - private String runResult; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ExportAssessmentByStuResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ExportAssessmentByStuResp.java deleted file mode 100644 index e636775..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ExportAssessmentByStuResp.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import cn.afterturn.easypoi.excel.annotation.ExcelTarget; -import com.baomidou.mybatisplus.annotation.TableField; -import com.huoran.occupationlab.entity.Class; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.util.Date; -import java.util.List; - -/** - *

- * 项目管理表 - *

- * - * @author Mr.JK - * @since 2021-08-26 - */ -@Data -@Accessors(chain = true) -@ExcelTarget("ExportAssessmentByStuResp") -public class ExportAssessmentByStuResp { - - @Excel(name = "课程名称", orderNum = "1", mergeVertical = true, isImportField = "curriculumName", width = 30) - @ApiModelProperty(value = "课程名称") - private String curriculumName; - - @Excel(name = "实验项目名称", orderNum = "2", mergeVertical = true, isImportField = "experimentalName", width = 30) - @ApiModelProperty(value = "实验项目名称") - private String experimentalName; - - @Excel(name = "项目名称", orderNum = "3", mergeVertical = true, isImportField = "projectName", width = 30) - @ApiModelProperty(value = "项目名称") - private String projectName; - - @Excel(name = "得分", orderNum = "4", mergeVertical = true, isImportField = "score", width = 30) - @ApiModelProperty(value = "得分") - private Integer score; - - @Excel(name = "实验班级", orderNum = "5", mergeVertical = true, isImportField = "className", width = 30) - @ApiModelProperty(value = "实验班级") - private String className; - - @Excel(name = "耗时", orderNum = "6", mergeVertical = true, isImportField = "timeSum", width = 30) - @ApiModelProperty(value = "耗时") - private String timeSum; - - @Excel(name = "起始时间", orderNum = "7", mergeVertical = true, isImportField = "startTime", width = 30) - @ApiModelProperty(value = "起始时间") - private String startTime; - - @Excel(name = "结束时间", orderNum = "8", mergeVertical = true, isImportField = "submitTime", width = 30) - @ApiModelProperty(value = "结束时间") - private String submitTime; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ExportAssessmentByTeacherResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ExportAssessmentByTeacherResp.java deleted file mode 100644 index 5468522..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ExportAssessmentByTeacherResp.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import cn.afterturn.easypoi.excel.annotation.ExcelTarget; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - *

- * 项目管理表 - *

- * - * @author Mr.JK - * @since 2021-08-26 - */ -@Data -@Accessors(chain = true) -@ExcelTarget("ExportAssessmentByTeacherResp") -public class ExportAssessmentByTeacherResp { - - @Excel(name = "序号", orderNum = "1", isImportField = "rownum", width = 30) - @ApiModelProperty(value = "序号") - private Integer rownum; - - @Excel(name = "班级", orderNum = "2", isImportField = "className", width = 30) - @ApiModelProperty(value = "班级") - private String className; - - @Excel(name = "考核名称", orderNum = "3", isImportField = "assessmentName", width = 30) - @ApiModelProperty(value = "考核名称") - private String assessmentName; - - @Excel(name = "学生姓名", orderNum = "4", isImportField = "userName", width = 30) - @ApiModelProperty(value = "学生姓名") - private String userName; - - @Excel(name = "学号", orderNum = "5", isImportField = "workNumber", width = 30) - @ApiModelProperty(value = "学号") - private String workNumber; - - @Excel(name = "分数", orderNum = "6", isImportField = "score", width = 30) - @ApiModelProperty(value = "分数") - private Integer score; - - @Excel(name = "耗时(min)", orderNum = "7", isImportField = "timeSum", width = 30) - @ApiModelProperty(value = "耗时(min)") - private Integer timeSum; - - @Excel(name = "提交时间", orderNum = "8", isImportField = "submitTime", width = 30) - @ApiModelProperty(value = "提交时间") - private String submitTime; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ExportByStudentResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ExportByStudentResp.java deleted file mode 100644 index 7adbfc3..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ExportByStudentResp.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import cn.afterturn.easypoi.excel.annotation.ExcelTarget; -import com.baomidou.mybatisplus.annotation.TableField; -import com.huoran.occupationlab.entity.Class; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.util.Date; -import java.util.List; - -/** - *

- * 项目管理表 - *

- * - * @author Mr.JK - * @since 2021-08-26 - */ -@Data -@Accessors(chain = true) -@ExcelTarget("ExportByStudentResp") -public class ExportByStudentResp { - - @Excel(name = "项目名称", orderNum = "1", isImportField = "projectName", width = 30) - @ApiModelProperty(value = "项目名称") - private String projectName; - - @Excel(name = "课程名称", orderNum = "2", isImportField = "curriculumName", width = 30) - @ApiModelProperty(value = "课程名称") - private String curriculumName; - - @Excel(name = "最高分", orderNum = "3", isImportField = "hightScore", width = 30) - @ApiModelProperty(value = "最高分") - private Integer hightScore; - - @Excel(name = "练习次数", orderNum = "4", isImportField = "practiceNum", width = 30) - @ApiModelProperty(value = "练习次数") - private Integer practiceNum; - - @Excel(name = "累计实验时长(小时)", orderNum = "5", isImportField = "duration", width = 30) - @ApiModelProperty(value = "累计实验时长(小时)") - private String duration; - - @Excel(name = "最近实验时间", orderNum = "6", isImportField = "lastTime", width = 30) - @ApiModelProperty(value = "最近实验时间") - private String lastTime; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ExportPracticeByTeacherResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ExportPracticeByTeacherResp.java deleted file mode 100644 index eef71ae..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ExportPracticeByTeacherResp.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import cn.afterturn.easypoi.excel.annotation.ExcelTarget; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - *

- * 项目管理表 - *

- * - * @author Mr.JK - * @since 2021-08-26 - */ -@Data -@Accessors(chain = true) -@ExcelTarget("ExportPracticeByTeacherResp") -public class ExportPracticeByTeacherResp { - - @Excel(name = "序号", orderNum = "1", isImportField = "rownum", width = 30) - @ApiModelProperty(value = "序号") - private Integer rownum; - - @Excel(name = "班级", orderNum = "2", isImportField = "className", width = 30) - @ApiModelProperty(value = "班级") - private String className; - - @Excel(name = "学生姓名", orderNum = "3", isImportField = "userName", width = 30) - @ApiModelProperty(value = "学生姓名") - private String userName; - - @Excel(name = "学号", orderNum = "4", isImportField = "workNumber", width = 30) - @ApiModelProperty(value = "学号") - private String workNumber; - - @Excel(name = "分数", orderNum = "5", isImportField = "score", width = 30) - @ApiModelProperty(value = "分数") - private Integer score; - - @Excel(name = "耗时(min)", orderNum = "6", isImportField = "timeSum", width = 30) - @ApiModelProperty(value = "耗时(min)") - private Integer timeSum; - - @Excel(name = "提交时间", orderNum = "7", isImportField = "submitTime", width = 30) - @ApiModelProperty(value = "提交时间") - private String submitTime; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/FractionalSegmentResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/FractionalSegmentResp.java deleted file mode 100644 index 0cdddb6..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/FractionalSegmentResp.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - - -/** - * @Description: 职站教师端实验分数返回 - * @auther: Rong - * @date: 2021/9/24 17:02 - */ -@Data -public class FractionalSegmentResp { - - - @ApiModelProperty(value = "0-10") - private Integer num1; - - @ApiModelProperty(value = "11-20") - private Integer num2; - - @ApiModelProperty(value = "21-30") - private Integer num3; - - @ApiModelProperty(value = "31-40") - private Integer num4; - - @ApiModelProperty(value = "41-50") - private Integer num5; - - @ApiModelProperty(value = "51-60") - private Integer num6; - - @ApiModelProperty(value = "61-70") - private Integer num7; - - @ApiModelProperty(value = "71-80") - private Integer num8; - - @ApiModelProperty(value = "81-90") - private Integer num9; - - @ApiModelProperty(value = "91-100") - private Integer num10; - - @ApiModelProperty(value = "人数") - private Integer peopleNum; - - @ApiModelProperty(value = "平均分") - private String avgScore; - - - @ApiModelProperty(value = "最低分") - private String minScore; - - @ApiModelProperty(value = "最高分") - private String maxScore; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ItemErrorRateUnderProductResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ItemErrorRateUnderProductResp.java deleted file mode 100644 index e68a31a..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ItemErrorRateUnderProductResp.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * 产品下错误率分析 - */ -@Data -public class ItemErrorRateUnderProductResp { - - - @ApiModelProperty(value = "项目id") - private Integer projectId; - - @ApiModelProperty(value = "项目名称") - private String projectName; - - @ApiModelProperty(value = "当前判分点的错误率") - private String errorRate; - - - @ApiModelProperty(value = "此项目的练习/考核总次数") - private Integer totalNumberOfExercises; - - @ApiModelProperty(value = "当前做错总人数") - private Integer itemErrorCount; - - @ApiModelProperty(value = "参与当前的总人数") - private Integer numberOfParticipants; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/MonthlyOnlineStudyHoursResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/MonthlyOnlineStudyHoursResp.java deleted file mode 100644 index 6d09c3f..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/MonthlyOnlineStudyHoursResp.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 本校学生实验数据概率 - */ -@Data -@Accessors(chain = true) -public class MonthlyOnlineStudyHoursResp { - - @ApiModelProperty(value = "平均时长") - private String averageDuration; - - @ApiModelProperty(value = "时间") - private String time; - - - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/MostLabCoursestResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/MostLabCoursestResp.java deleted file mode 100644 index 7e1a2e3..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/MostLabCoursestResp.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import cn.afterturn.easypoi.excel.annotation.ExcelTarget; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - *

- * 本月实验练习数(已提交的)最多的课程名称排名,前三 - *

- * - * @author Mr.JK - * @since 2021-08-26 - */ -@Data -@Accessors(chain = true) -@ExcelTarget("MostLabCoursestResp") -public class MostLabCoursestResp { - - @ApiModelProperty(value = "课程名称") - private String goodsName; - - - @ApiModelProperty(value = "总数") - private Integer total; - - @ApiModelProperty(value = "课程id") - private Integer curriculumId; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/OverviewOfStudentExperimentDataResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/OverviewOfStudentExperimentDataResp.java deleted file mode 100644 index 9aeda9f..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/OverviewOfStudentExperimentDataResp.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 本校学生实验数据概率 - */ -@Data -@Accessors(chain = true) -public class OverviewOfStudentExperimentDataResp { - - @ApiModelProperty(value = "本校学习总人数/院校学生账号数量") - private String numberOfPeopleStudy; - - @ApiModelProperty(value = "累计实验次数(即所有人练习和考核(已提交的)的次数之和(即实验报告数量))") - private String numberOfExperiments; - - @ApiModelProperty(value = "当前活跃人数(90分钟内登陆的账号总数量)") - private String currentActivePeople; - - - @ApiModelProperty(value = "累计实验时长(即院校所有学生每次实验报告上练习时长之和)") - private String cumulativeExperimentTime; - - - @ApiModelProperty(value = "累计课程学习次数(即学生课前预习和课程学习模块的资源点击数的累计)") - private String courseStudyFrequency; - - - @ApiModelProperty(value = "累计课程学习时长(即学校每个学生每次停留在课程预习页面和课程学习页面的时间之和)") - private String courseStudyTime; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/PageTheoreticalCourseByNakadaiResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/PageTheoreticalCourseByNakadaiResp.java deleted file mode 100644 index 784ddf3..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/PageTheoreticalCourseByNakadaiResp.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.Date; - - -@Data -public class PageTheoreticalCourseByNakadaiResp { - - - @ApiModelProperty(value = "理论课程主键") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "课程名称") - private String courseName; - - @ApiModelProperty(value = "课程类型(0.免费 1.付费)") - private String courseType; - - @ApiModelProperty(value = "创建时间") - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - @ApiModelProperty(value = "更新时间") - @TableField(fill = FieldFill.INSERT_UPDATE) - private Date updateTime; - - @ApiModelProperty(value = "学校id") - private Integer schoolId; - - - @ApiModelProperty(value = "学校名称") - private String schoolName; - - @ApiModelProperty(value = "创建人") - private String founder; - - @ApiModelProperty(value = "创建人Id") - private Integer founderId; - - @ApiModelProperty(value = "理论课程封面") - private String coverUrl; - - @ApiModelProperty(value = "理论课程介绍") - private String courseIntroduction; - - @ApiModelProperty(value = "课程分类") - private String courseClassification; - - @ApiModelProperty(value = "平台来源(0中台,1职站)") - private Integer platformSource; - - @ApiModelProperty(value = "课程范围(0:本校内 1:全平台 2.指定区域、院校)") - private Integer visibleRange; - - @ApiModelProperty(value = "中台是否开启(0开启 1未开启 默认0)") - private Integer ztOpen; - - @ApiModelProperty(value = "是否开启(0开启 1未开启 默认0)") - private Integer isOpen; - - @ApiModelProperty(value = "是否删除(0未删除 1已删除 默认0)") - private Integer isDel; - - @ApiModelProperty(value = "浏览量") - private Integer pageviews; - - @ApiModelProperty(value = "是否收藏:(state = 1收藏,0:未收藏)") - private Integer collectionStatus; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/PerformanceUnderProductResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/PerformanceUnderProductResp.java deleted file mode 100644 index 4956b48..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/PerformanceUnderProductResp.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import cn.afterturn.easypoi.excel.annotation.ExcelTarget; -import com.baomidou.mybatisplus.annotation.TableField; -import com.huoran.occupationlab.entity.Class; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.util.Date; -import java.util.List; - - -@Data -@Accessors(chain = true) -public class PerformanceUnderProductResp { - - - @ApiModelProperty(value = "实验总人数") - private Integer experimentalPopulation; - - @ApiModelProperty(value = "总实验次数") - private Integer experimentNum; - - - @ApiModelProperty(value = "实验总分") - private Integer totalExperimentalScore; - - @ApiModelProperty(value = "最高分") - private Integer maxScore; - - @ApiModelProperty(value = "最低分") - private Integer minScore; - - @ApiModelProperty(value = "平均分") - private String averageScore; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/PracticeProjectsUnderTheProductResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/PracticeProjectsUnderTheProductResp.java deleted file mode 100644 index 9bd90c0..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/PracticeProjectsUnderTheProductResp.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * 产品下练习项目情况 - */ -@Data -public class PracticeProjectsUnderTheProductResp { - - - - - @ApiModelProperty(value = "序号") - @Excel(name = "序号", orderNum = "1", isImportField = "rownum", width = 30) - private Integer rownum; - - //课程 - @ApiModelProperty(value = "课程名称") - @Excel(name = "课程名称", orderNum = "2", mergeVertical = true, isImportField = "goodsName", width = 30) - private String goodsName; - - //班级 - @ApiModelProperty(value = "班级名称") - @Excel(name = "班级名称", orderNum = "3", mergeVertical = true, isImportField = "className", width = 30) - private String className; - - - - @ApiModelProperty(value = "姓名") - @Excel(name = "姓名", orderNum = "4", mergeVertical = true, isImportField = "username", width = 30) - private String userName; - - - @ApiModelProperty(value = "学号") - @Excel(name = "学号", orderNum = "5", mergeVertical = true, isImportField = "workNumber", width = 30) - private String workNumber; - - @ApiModelProperty(value = "当前学生已经练习的项目数(已练习总数)") - @Excel(name = "练习项目数", orderNum = "6", mergeVertical = false, isImportField = "totalNumberOfPractices", width = 30) - private String totalNumberOfPractices; - - @ApiModelProperty(value = "练习次数") - @Excel(name = "练习次数", orderNum = "7", mergeVertical = false, isImportField = "numberOfExercises", width = 30) - private Integer numberOfExercises; - - @ApiModelProperty(value = "所有项目练习成绩之和") - private Integer totalScore; - - - - @ApiModelProperty(value = "累计练习时长") - @Excel(name = "累计练习时长", orderNum = "8", mergeVertical = false, isImportField = "cumulativePracticeTime", width = 30) - private Integer cumulativePracticeTime; - - @ApiModelProperty(value = "平均分") - @Excel(name = "平均分", orderNum = "9", mergeVertical = false, isImportField = "avgScore", width = 30) - private String avgScore; - - @ApiModelProperty(value = "最高分") - @Excel(name = "最低分", orderNum = "10", mergeVertical = false, isImportField = "maxScore", width = 30) - private Integer maxScore; - - @ApiModelProperty(value = "最低分") - @Excel(name = "最低分", orderNum = "11", mergeVertical = false, isImportField = "minScore", width = 30) - private Integer minScore; - - - @ApiModelProperty(value = "账号id") - private Integer accountId; - - - @ApiModelProperty(value = "班级id") - private String classId; - - - - @ApiModelProperty(value = "练习项目总数") - private Integer totalNumberOfExercises; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/PracticeResultDerivationResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/PracticeResultDerivationResp.java deleted file mode 100644 index baf457e..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/PracticeResultDerivationResp.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import com.baomidou.mybatisplus.annotation.TableField; -import com.huoran.occupationlab.entity.UserScore; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.List; - -/** - *

- * 存储各子系统的实验报告 - *

- * - * @author lr - * @since 2021-09-08 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@ApiModel(value = "练习成绩导出word所需参数", description = "练习成绩导出word所需参数") -public class PracticeResultDerivationResp { - - @ApiModelProperty(value = "课程名称") - private String goodsName; - - @ApiModelProperty(value = "班级名称") - private String className; - - @ApiModelProperty(value = "导出时间") - private String derivationTime; - - @ApiModelProperty(value = "练习成绩数据") - List practicePerformanceData; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/PracticeScoreDetailsUnderProductResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/PracticeScoreDetailsUnderProductResp.java deleted file mode 100644 index a72a0f9..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/PracticeScoreDetailsUnderProductResp.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 产品下练习成绩详情 - */ -@Data -@Accessors(chain = true) -public class PracticeScoreDetailsUnderProductResp { - - @ApiModelProperty(value = "序号") - @Excel(name = "序号", orderNum = "1", isImportField = "rownum", width = 30) - private Integer rownum; - - //课程 - @ApiModelProperty(value = "课程名称") - @Excel(name = "课程名称", orderNum = "2", mergeVertical = true, isImportField = "goodsName", width = 30) - private String goodsName; - - //班级 - @ApiModelProperty(value = "班级名称") - @Excel(name = "班级名称", orderNum = "3", mergeVertical = true, isImportField = "className", width = 30) - private String className; - - @ApiModelProperty(value = "姓名") - @Excel(name = "姓名", orderNum = "4", mergeVertical = true, isImportField = "username", width = 30) - private String userName; - - - @ApiModelProperty(value = "学号") - @Excel(name = "学号", orderNum = "5", mergeVertical = true, isImportField = "workNumber", width = 30) - private String workNumber; - - @ApiModelProperty(value = "项目名称") - @Excel(name = "项目名称", orderNum = "6", mergeVertical = false, isImportField = "projectName", width = 30) - private String projectName; - - - @ApiModelProperty(value = "平均练习时长") - @Excel(name = "平均练习时长", orderNum = "7", mergeVertical = false, isImportField = "averageDuration", width = 30) - private String averageDuration; - - - @ApiModelProperty(value = "平均分") - @Excel(name = "平均分", orderNum = "8", mergeVertical = false, isImportField = "averageScore", width = 30) - private String averageScore; - - @ApiModelProperty(value = "项目id") - private Integer projectId; - - - @ApiModelProperty(value = "账号id") - private Integer accountId; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ReturnActiveRankingResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ReturnActiveRankingResp.java deleted file mode 100644 index 3848191..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ReturnActiveRankingResp.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.math.BigDecimal; - - -@Data -@ApiModel(value = "活跃排行榜", description = "活跃排行榜") -public class ReturnActiveRankingResp { - - - @ApiModelProperty(value = "班级id(Integer类型)") - private Integer classId; - - - @ApiModelProperty(value = "班级统计") - private String classPracticeTimes; - - - @ApiModelProperty(value = "班级总人数") - private String totalClassSize ; - - - @ApiModelProperty(value = "学校id",hidden = true) - private Integer schoolId; - - - @ApiModelProperty(value = "活跃指数") - private BigDecimal activityIndex ; - - - @ApiModelProperty(value = "班级名称") - private String className; - - @ApiModelProperty(value = "学校名字") - private String schoolName; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ScorePointsUnderTheItemResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ScorePointsUnderTheItemResp.java deleted file mode 100644 index 4155376..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/ScorePointsUnderTheItemResp.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * 获取项目下的判分点 - */ -@Data -public class ScorePointsUnderTheItemResp { - - - @ApiModelProperty(value = "判分点Id") - private Integer judgmentId; - - @ApiModelProperty(value = "判分点名称") - private String judgmentName; - - @ApiModelProperty(value = "当前判分点的错误率") - private String errorRate; - - @ApiModelProperty(value = "当前判分点做错的人数总数") - private Integer errorTotal; - - @ApiModelProperty(value = "当前参与人数") - private Integer peopleNum; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/StaffResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/StaffResp.java deleted file mode 100644 index 6c1b26f..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/StaffResp.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.util.List; - -/** - * @Author chen - * @DATE 2021/10/13 15:51 - * @Version 1.0 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@ApiModel(value = "StaffResp", description = "员工列表") -public class StaffResp { - - @ApiModelProperty(value = "绑定年级ID") - private Integer gradeId; - - @ApiModelProperty(value = "专业ID") - private Integer staffArchitectureId; - - @ApiModelProperty(value = "绑定账号id", hidden = true) - private Integer accountId; - - @ApiModelProperty(value = "绑定学校id", hidden = true) - private Integer schoolId; - - @ApiModelProperty(value = "职工姓名") - private String userName; - - @ApiModelProperty(value = "职工工号") - private String workNumber; - - @ApiModelProperty(value = "唯一标识账号") - private String uniqueIdentification; - - @ApiModelProperty(value = "电话") - private String phone; - - @ApiModelProperty(value = "邮箱") - private String email; - - //用于列表逗号隔开展示 - @ApiModelProperty(value = "角色") - private String roleName; - - //用于查看详情是否角色选中 - /*@ApiModelProperty(value = "角色列表") - private List roleList;*/ - - @ApiModelProperty(value = "账号") - private String account; - - @ApiModelProperty(value = "登陆次数") - private Integer logInNumber; - - @ApiModelProperty(value = "最后登陆时间") - private String lastLoginTime; - - @ApiModelProperty(value = "学校名称") - private String schoolName; - - @ApiModelProperty(value = "部门") - private String dept; - - @ApiModelProperty(value = "账号角色及绑定的一级二级部门信息") - private List roleAndDeptList; - - @ApiModelProperty(value = "用户id") - private Integer userId; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/StaffRoleResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/StaffRoleResp.java deleted file mode 100644 index 5ce0830..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/StaffRoleResp.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotNull; - -/** - * @Author chen - * @DATE 2021/10/13 15:51 - * @Version 1.0 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@ApiModel(value = "绑定员工角色及部门参数", description = "绑定员工角色及部门参数") -public class StaffRoleResp { - - @ApiModelProperty(value = "一级部门绑定id") - private Integer gradeId; - - @ApiModelProperty(value = "二级部门绑定id") - private Integer staffArchitectureId; - - @ApiModelProperty(value = "角色id(一个角色绑定一个一级部门、二级部门)") - private Integer roleId; - - @ApiModelProperty(value = "一级部门名称") - private String staffArchitectureName; - - @ApiModelProperty(value = "二级部门名称") - private String gradeName; - - @ApiModelProperty(value = "角色名称") - private String roleName; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/StuAchievementResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/StuAchievementResp.java deleted file mode 100644 index 8a0c217..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/StuAchievementResp.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import cn.afterturn.easypoi.excel.annotation.ExcelTarget; -import com.baomidou.mybatisplus.annotation.TableField; -import com.huoran.occupationlab.entity.Class; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.util.Date; -import java.util.List; - -/** - *

- * 项目管理表 - *

- * - * @author Mr.JK - * @since 2021-08-26 - */ -@Data -@Accessors(chain = true) -@ExcelTarget("StuAchievementResp") -public class StuAchievementResp { - - - @Excel(name = "课程名称", orderNum = "1", mergeVertical = true, isImportField = "curriculumName", width = 30) - @ApiModelProperty(value = "课程名称") - private String curriculumName; - - @Excel(name = "实验项目名称", orderNum = "2", mergeVertical = true, isImportField = "projectName", width = 30) - @ApiModelProperty(value = "实验项目名称") - private String projectName; - - @Excel(name = "实验最高分", orderNum = "3", mergeVertical = true, isImportField = "hightScore", width = 30) - @ApiModelProperty(value = "实验最高分") - private Integer hightScore; - - @Excel(name = "练习次数", orderNum = "4", mergeVertical = true, isImportField = "practiceNum", width = 30) - @ApiModelProperty(value = "练习次数") - private Integer practiceNum; - - - @ApiModelProperty(value = "最近实验时间") - private String lastTime; - - - @Excel(name = "练习次数", orderNum = "4", mergeVertical = true, isImportField = "practiceNum", width = 30) - @ApiModelProperty(value = "结束时间") - private String endTime; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/StuAssessmentListResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/StuAssessmentListResp.java deleted file mode 100644 index 532e9f0..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/StuAssessmentListResp.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.Date; - -/** - *

- * 考核管理 - *

- * - * @author lr - * @since 2021-08-18 - */ -@Data -@ApiModel(value = "学生考核列表", description = "学生考核列表") -public class StuAssessmentListResp { - - - @ApiModelProperty(value = "考核id") - private Integer assessmentId; - - @ApiModelProperty(value = "考核名称") - private String experimentalName; - - @ApiModelProperty(value = "课程名称") - private String sysName; - - @ApiModelProperty(value = "班级名称(0表示展示无指定范围)") - private String className; - - @ApiModelProperty(value = "用户账号id") - private Integer accountId; - - @ApiModelProperty(value = "考试时长") - private String experimentDuration; - - @ApiModelProperty(value = "创建时间") - private Date createTime; - - @ApiModelProperty(value = "起始时间") - private String startTime; - - @ApiModelProperty(value = "结束时间") - private String stopTime; - - @ApiModelProperty(value = "考核状态(0、待开始 1、进行中 2、已结束)") - private Integer status; - - @ApiModelProperty(value = "学生考试状态(0、未考 1、在考 2、已考)") - private Integer stuState; - - @ApiModelProperty(value = "实验人数") - private Integer experimentalNum; - - @ApiModelProperty(value = "是否启用邀请码(0、未启用 1、启用)") - private Integer isEnableCode; - - @ApiModelProperty(value = "发布类型(1、手动发布 2、定时发布)") - private Integer type; - - @ApiModelProperty(value = "班级id") - private String classId; - - @ApiModelProperty(value = "邀请码") - private Integer invitationCode; - - @ApiModelProperty(value = "实验报告id") - private Integer reportId; - - @ApiModelProperty(value = "课程id") - private Integer curriculumId; - - - @ApiModelProperty(value = "商品名称") - private String goodsName; - - @ApiModelProperty(value = "商品id") - private Integer mallId; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/StuAssessmentScoreResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/StuAssessmentScoreResp.java deleted file mode 100644 index 5fab90b..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/StuAssessmentScoreResp.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.util.List; - -/** - * 学生实验课程考核成绩趋势 - */ -@Data -@Accessors(chain = true) -public class StuAssessmentScoreResp { - - @ApiModelProperty(value = "平均分/课程") - private List assesScoreRespList; - - - @ApiModelProperty(value = "时间") - private String time; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/StuExportAchievementResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/StuExportAchievementResp.java deleted file mode 100644 index 79f0aac..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/StuExportAchievementResp.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import cn.afterturn.easypoi.excel.annotation.ExcelTarget; -import com.baomidou.mybatisplus.annotation.TableField; -import com.huoran.occupationlab.entity.Class; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.util.Date; -import java.util.List; - -/** - *

- * 项目管理表 - *

- * - * @author Mr.JK - * @since 2021-08-26 - */ -@Data -@Accessors(chain = true) -@ExcelTarget("StuExportAchievementResp") -public class StuExportAchievementResp { - - @Excel(name = "项目名称", orderNum = "1", isImportField = "projectName", width = 30) - @ApiModelProperty(value = "项目名称") - private String projectName; - - - @Excel(name = "得分", orderNum = "2", isImportField = "score", width = 30) - @ApiModelProperty(value = "得分") - private Integer score; - - - @Excel(name = "耗时", orderNum = "3", isImportField = "timeSum", width = 30) - @ApiModelProperty(value = "耗时") - private String timeSum; - - @Excel(name = "起始时间", orderNum = "4", isImportField = "startTime", width = 30) - @ApiModelProperty(value = "起始时间") - private String startTime; - - - @Excel(name = "结束时间", orderNum = "5", isImportField = "submitTime", width = 30) - @ApiModelProperty(value = "结束时间") - private String submitTime; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/StudentAssesScoreResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/StudentAssesScoreResp.java deleted file mode 100644 index d405794..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/StudentAssesScoreResp.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 学生实验课程考核成绩趋势 - */ -@Data -@Accessors(chain = true) -public class StudentAssesScoreResp { - - @ApiModelProperty(value = "课程名称") - private String curriculumName; - - - @ApiModelProperty(value = "平均分") - private String avgScore; - - - @ApiModelProperty(value = "时间") - private String time; - - - @ApiModelProperty(value = "课程id") - private Integer curriculumId; - - - @ApiModelProperty(value = "商品id") - private Integer mallId; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/StudentInfoResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/StudentInfoResp.java deleted file mode 100644 index 85da85d..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/StudentInfoResp.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import com.huoran.occupationlab.entity.Class; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.List; - -/** - * @ProjectName: huorantech - * @Package: com.huoran.occupationlab.entity.resp - * @ClassName: StudentInfoResp - * @Description: java类作用描述 - * @Author: Maureen.Rong - * @CreateDate: 2021/8/25 17:29 - * @UpdateDate: 2021/8/25 17:29 - * @Version: 1.0 - */ -@Data -public class StudentInfoResp { - @ApiModelProperty(value = "学号/工号") - private String workNumber; - - @ApiModelProperty(value = "用户名称") - private String userName; - - @ApiModelProperty(value = "班级id") - private String classId; - - - @ApiModelProperty(value = "唯一标识") - private String uniqueIdentification; - - @ApiModelProperty(value = "手机号") - private String phone; - - @ApiModelProperty(value = "邮箱") - private String email; - - @ApiModelProperty(value = "用户id") - private Integer userId; - - @ApiModelProperty(value = "账号id") - private Integer accountId; - - @ApiModelProperty(value = "登录次数") - private Integer loginNumber; - - @ApiModelProperty(value = "最近登录时间") - private String lastLoginTime; - - @ApiModelProperty(value = "班级名称") - private String className; - - @ApiModelProperty(value = "账号") - private String account; - - @ApiModelProperty(value = "学生账号id") - private Integer stuAccountId; - - - @ApiModelProperty(value = "是否禁用:0->禁用,1->启用") - private Integer isEnable; - - private Integer schoolId; - - private List classList; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/StudentPerformanceAnalysisResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/StudentPerformanceAnalysisResp.java deleted file mode 100644 index 306f68c..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/StudentPerformanceAnalysisResp.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 学生成绩分布分析 - */ -@Data -@Accessors(chain = true) -public class StudentPerformanceAnalysisResp { - - @ApiModelProperty(value = "黄色") - private String yellow; - - - @ApiModelProperty(value = "绿色") - private String green; - - @ApiModelProperty(value = "蓝色") - private String blue; - - @ApiModelProperty(value = "粉色") - private String pink; - - - @ApiModelProperty(value = "时间") - private String time; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/TheoreticalCourseDetailResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/TheoreticalCourseDetailResp.java deleted file mode 100644 index c167e3c..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/TheoreticalCourseDetailResp.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import com.baomidou.mybatisplus.annotation.*; -import com.huoran.occupationlab.entity.TheoreticalCourseClassification; -import com.huoran.occupationlab.entity.TheoreticalCourseConfigure; -import com.huoran.occupationlab.entity.TheoreticalCourseRange; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.Date; -import java.util.List; - -/** - *

- * 理论课程基本信息 - *

- * - * @author lr - * @since 2022-09-14 - */ -@Data - -public class TheoreticalCourseDetailResp { - - - @ApiModelProperty(value = "理论课程主键") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "课程名称") - private String courseName; - - @ApiModelProperty(value = "课程类型(0.免费 1.付费)") - private Integer courseType; - - - @ApiModelProperty(value = "学校分类") - private List schoolClassificationsList; - - @ApiModelProperty(value = "平台分类") - private List platformClassificationList; - - - @ApiModelProperty(value = "指定区域、院校") - private List courseRangeList; - - @ApiModelProperty(value = "理论课程封面") - private String coverUrl; - - @ApiModelProperty(value = "理论课程介绍") - private String courseIntroduction; - - @ApiModelProperty(value = "课程范围(0:本校内 1:全平台 2.指定区域、院校)") - private Integer visibleRange; - - @ApiModelProperty(value = "平台来源(0中台,1职站)") - private Integer platformSource; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/TheoreticalCoursetRangeResp.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/TheoreticalCoursetRangeResp.java deleted file mode 100644 index f9f6baf..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/resp/TheoreticalCoursetRangeResp.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.huoran.occupationlab.entity.resp; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - *

- * - *

- * - * @author lr - * @since 2022-06-16 - */ -@Data -@ApiModel(value = "课程范围选择") -public class TheoreticalCoursetRangeResp { - - - @ApiModelProperty(value = "课程主键") - private Integer courseId; - - @ApiModelProperty(value = "省") - private String provinceName; - - @ApiModelProperty(value = "市") - private String cityName; - - @ApiModelProperty(value = "学校id") - private String schoolName; - - @ApiModelProperty(value = "范围类型(0为学校 1为地区)") - private Integer type; - - @ApiModelProperty(value = "学校id") - private Integer schoolId; - - - @ApiModelProperty(value = "省id") - private Integer provinceId; - - - @ApiModelProperty(value = "城市id") - private Integer cityId; - - -} \ No newline at end of file diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ActivityDerivationVO.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ActivityDerivationVO.java deleted file mode 100644 index 8faa29f..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ActivityDerivationVO.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * @描述:成绩管理——练习活跃度 - * @作者: Rong - * @日期: 2023-04-27 - */ -@Data -@ApiModel(value = "练习活跃度导出") -public class ActivityDerivationVO { - - - - - @ApiModelProperty(value = "序号") - @Excel(name = "序号", orderNum = "1", isImportField = "rownum", width = 30) - private Integer rownum; - - - @ApiModelProperty(value = "班级") - @Excel(name = "班级", orderNum = "2", isImportField = "className", width = 30) - private String className; - - @ApiModelProperty(value = "学生姓名") - @Excel(name = "学生姓名", orderNum = "3", isImportField = "userName", width = 30) - private String userName; - - @ApiModelProperty(value = "学号/工号") - @Excel(name = "学号", orderNum = "4", isImportField = "workNumber", width = 30) - private String workNumber; - - @ApiModelProperty(value = "练习次数") - @Excel(name = "练习次数", orderNum = "5", isImportField = "practiceNum", width = 30) - private Integer practiceNum; - - @ApiModelProperty(value = "实验平均分") - @Excel(name = "实验平均分", orderNum = "6", isImportField = "avgScore", width = 30) - private String avgScore; - - @ApiModelProperty(value = "实验最高分") - @Excel(name = "实验最高分", orderNum = "7", isImportField = "highestScore", width = 30) - private String highestScore; - - @ApiModelProperty(value = "实验最低分") - @Excel(name = "实验最低分", orderNum = "8", isImportField = "lowestMark", width = 30) - private String lowestMark; - - @ApiModelProperty(value = "耗时最长") - @Excel(name = "耗时最多", orderNum = "9", isImportField = "theLongestTime", width = 30) - private String theLongestTime; - - @ApiModelProperty(value = "耗时最少") - @Excel(name = "耗时最少", orderNum = "10", isImportField = "shortestTime", width = 30) - private String shortestTime; - - @ApiModelProperty(value = "最近提交时间") - @Excel(name = "最近提交时间", orderNum = "11", isImportField = "lastSubmissionTime", width = 30) - private String lastSubmissionTime; - - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ApplicantVO.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ApplicantVO.java deleted file mode 100644 index c909532..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ApplicantVO.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * @Author chen - * @DATE 2020/10/19 14:08 - * @Version 1.0 - */ -@Data -public class ApplicantVO { - - /* @ApiModelProperty(value = "主键") - private String id; - - @ApiModelProperty(value = "用户名称") - private String username; - - @ApiModelProperty(value = "手机号") - private String phone; - - @ApiModelProperty(value = "账户号") - private String workNumber; - - @ApiModelProperty(value = "学校名称") - private String school; - - @ApiModelProperty(value = "是否禁用(0启用,1禁用)") - private String isDisable;*/ - - - /* @ApiModelProperty(value = "序号") - @Excel(name = "序号", orderNum = "1", isImportField = "id", width = 30) - private String id;*/ - - - @ApiModelProperty(value = "序号") - @Excel(name = "序号", orderNum = "1", isImportField = "id", width = 30) - private Integer rownum; - - - @ApiModelProperty(value = "学校") - @Excel(name = "学校", orderNum = "2", mergeVertical = true, isImportField = "school", width = 30) - private String school; - - @ApiModelProperty(value = "学生姓名") - @Excel(name = "学生姓名", orderNum = "3", mergeVertical = true, isImportField = "username", width = 30) - private String username; - - - @ApiModelProperty(value = "手机号") - @Excel(name = "手机号", orderNum = "4", mergeVertical = true, isImportField = "phone", width = 30) - private String phone; - - - @ApiModelProperty(value = "学号") - @Excel(name = "学号", orderNum = "5", mergeVertical = true, isImportField = "workNumber", width = 30) - private String workNumber; - - - - @ApiModelProperty(value = "报名时间") - @Excel(name = "报名时间", orderNum = "6", mergeVertical = true, isImportField = "gmtCreate", width = 30) - private String gmtCreate; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ArchitectureVO.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ArchitectureVO.java deleted file mode 100644 index 4b8094a..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ArchitectureVO.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import com.baomidou.mybatisplus.annotation.*; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotNull; -import java.io.Serializable; -import java.util.Date; -import java.util.List; - -/** - *

- * 学生组织架构 - *

- * - * @author lr - * @since 2021-08-24 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ol_architecture") -@ApiModel(value = "Architecture对象", description = "学生组织架构") -public class ArchitectureVO implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "主键") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "组织名称") - @NotNull(message = "组织名称不能为空") - private String organizationName; - - @ApiModelProperty(value = "既为父id又是学校id 第一级为学校id") - private Integer parentId; - - @ApiModelProperty(value = "层级 0为学校,1为专业,2为年级") - private Integer level; - - @ApiModelProperty(value = "创建时间") - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - @ApiModelProperty(value = "更新时间") - @TableField(fill = FieldFill.INSERT_UPDATE) - private Date updateTime; - - @ApiModelProperty(value = "逻辑删除 默认为0 1为已删除") - private Integer isDel; - - @ApiModelProperty(value = "子级") - @TableField(exist = false) - private List children; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ArticleSort.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ArticleSort.java deleted file mode 100644 index d4e5e77..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ArticleSort.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import com.huoran.occupationlab.entity.Article; -import lombok.Data; - -import java.util.ArrayList; -import java.util.List; - -/** - * @Author chen - * @DATE 2020/10/21 9:21 - * @Version 1.0 - * 文章排序 - */ -@Data -public class ArticleSort { - List
articleList = new ArrayList<>(); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/AssessmentVO.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/AssessmentVO.java deleted file mode 100644 index 0e5006a..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/AssessmentVO.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import com.baomidou.mybatisplus.annotation.*; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.Date; -import java.util.List; - -/** - *

- * 考核管理 - *

- * - * @author lr - * @since 2021-08-18 - */ -@Data -@ApiModel(value = "AssessmentVO", description = "考核管理") -public class AssessmentVO { - - - @ApiModelProperty(value = "主键id") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @ApiModelProperty(value = "考核名称") - private String experimentalName; - - @ApiModelProperty(value = "班级id(可多个班级参加,逗号隔开)") - private String classId; - - @ApiModelProperty(value = "绑定项目id") - private Integer projectId; - - @ApiModelProperty(value = "实验时长") - private String experimentDuration; - - @ApiModelProperty(value = "发布类型(1、手动发布 2、定时发布)") - private Integer type; - - @ApiModelProperty(value = "起始时间") - private String startTime; - - @ApiModelProperty(value = "结束时间") - private String stopTime; - - @ApiModelProperty(value = "状态(0、待开始 1、进行中 2、已结束)") - private Integer status; - - @ApiModelProperty(value = "邀请码") - private Integer invitationCode; - - @ApiModelProperty(value = "指定范围(0无指定范围 1指定范围)") - private Integer isSpecify; - - @ApiModelProperty(value = "创建人用户账号id") - private Integer accountId; - - @ApiModelProperty(value = "系统id(ol_system表)") - private Integer systemId; - - @ApiModelProperty(value = "是否启用邀请码(0、启用 1、未启用)") - private Integer isEnableCode; - - @ApiModelProperty(value = "是否删除(0、未删除 1、已删除)") - @TableLogic - private Integer isDel; - - @ApiModelProperty(value = "创建时间") - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - - @ApiModelProperty(value = "班级名称") - private String className; - - @ApiModelProperty(value = "项目名称") - private String projectName; - - @ApiModelProperty(value = "绑定学生账号id") - private List stuAccountId; - - @ApiModelProperty(value = "课程名称") - private String sysName; - - @ApiModelProperty(value = "课程id") - private String sysId; - - @ApiModelProperty(value = "商品名称") - private String goodsName; - - @ApiModelProperty(value = "商品id") - private Integer mallId; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ChapterVO.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ChapterVO.java deleted file mode 100644 index 7a7a776..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ChapterVO.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -/** - * @Author chen - * @DATE 2020/10/10 9:37 - * @Version 1.0 - * 章节封装对象 - */ -@Data -public class ChapterVO implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "章节ID") - private String id; - - @ApiModelProperty(value = "章节名称") - private String name; - - @ApiModelProperty(value = "排序号") - private Integer sort; - - @ApiModelProperty(value = "小节集合") - private List subsectionList = new ArrayList<>(); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ColumnSort.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ColumnSort.java deleted file mode 100644 index 438896f..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ColumnSort.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import lombok.Data; - -import java.util.List; - -/** - * @Author chen - * @DATE 2020/10/16 14:56 - * @Version 1.0 - * 栏目排序 - */ -@Data -public class ColumnSort { - private List columnTree; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ColumnTree.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ColumnTree.java deleted file mode 100644 index 0b2e12c..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ColumnTree.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import lombok.Data; - -import java.util.List; - -/** - * @Author chen - * @DATE 2020/10/16 9:11 - * @Version 1.0 - * 栏目树 - */ -@Data -public class ColumnTree { - - private Integer id; - private String name; - private Integer parentId; - private Integer sort; - private Integer level; - List children; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ContestVO.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ContestVO.java deleted file mode 100644 index 454f48f..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ContestVO.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.TableField; -import com.huoran.occupationlab.entity.resp.ContestRangeResp; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.io.Serializable; -import java.util.Date; -import java.util.List; - -/** - * @Author chen - * @DATE 2020/10/16 17:13 - * @Version 1.0 - */ -@Data -public class ContestVO implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "主键") - private String id; - - @ApiModelProperty(value = "竞赛名称") - private String competitionName; - - @ApiModelProperty(value = "创建人") - private String founderName; - - - @ApiModelProperty(value = "大赛范围(0:本校内 1:全平台 2:指定区域、院校)", example = "0") - private Integer competitionScope; - - @ApiModelProperty(value = "平台来源(0:中台,1:职站)", example = "0") - private Integer platformSource; - - - @ApiModelProperty(value = "发布状态(0未发布,1已发布)") - private Integer publishStatus; - - @ApiModelProperty(value = "中台是否开启(0开启 1未开启 默认0)", example = "0") - private Integer ztOpen; - - @ApiModelProperty(value = "是否开启(0开启 1未开启 默认0)", example = "0") - private Integer isOpen; - - @ApiModelProperty(value = "报名人数") - private String applicantNum; - - @ApiModelProperty(value = "竞赛开始时间") - private Date playStartTime; - - @ApiModelProperty(value = "竞赛结束时间") - private Date playEndTime; - - @ApiModelProperty(value = "创建时间") - private Date createTime; - - @ApiModelProperty(value = "比赛范围") - private String range; - - @ApiModelProperty(value = "比赛范围(省市学校集合)") - private List contestRangeRespList; - - - @ApiModelProperty(value = "主办方", example = "或然科技") - private String sponsor; - - @ApiModelProperty(value = "承办方", example = "或然科技") - private String undertaker; - - @ApiModelProperty(value = "竞赛描述", example = "或然科技赛事") - private String description; - - @ApiModelProperty(value = "报名开始时间", example = "2021-09-10 16:24:24") - private Date signUpStartTime; - - @ApiModelProperty(value = "报名结束时间", example = "2021-09-20 16:24:24") - private Date signUpEndTime; - - - @ApiModelProperty(value = "创建人Id", example = "1") - private String founderId; - - - @ApiModelProperty(value = "竞赛名称", example = "数据库数据库色即是空") - private String name; - - @ApiModelProperty(value = "竞赛封面图", example = "http://localhost:9400/occupationlab/doc.html") - private String coverUrl; - - @ApiModelProperty(value = "竞赛轮播图", example = "http://localhost:9400/occupationlab/doc.html") - private String carouselUrl; - - @ApiModelProperty(value = "更新时间") - @TableField(fill = FieldFill.INSERT_UPDATE) - private Date updateTime; - - @ApiModelProperty(value = "学校id", example = "0") - private Integer schoolId; - - - @ApiModelProperty(value = "是否报名(0为已报名 1为未报名)", example = "0") - private Integer whetherToSignUp; - - - @ApiModelProperty(value = "报名时间") - private Date registrationTime; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/CourseVO.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/CourseVO.java deleted file mode 100644 index 97eee0c..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/CourseVO.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.io.Serializable; -import java.util.Date; - -/** - * @Author chen - * @DATE 2020/10/4 12:20 - * @Version 1.0 - */ -@ApiModel(value = "课程vo", description = "课程vo封装") -@Data -public class CourseVO implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "课程ID") - private String id; - - @ApiModelProperty(value = "课程名称") - private String name; - - @ApiModelProperty(value = "创建时间") - private Date gmtCreate; - - @ApiModelProperty(value = "创建人") - private String founder; - - @ApiModelProperty(value = "章节数") - private Integer chapterNum; - - @ApiModelProperty(value = "课程封面图片路径") - private String coverUrl; - - @ApiModelProperty(value = "课程描述") - private String description; - - @ApiModelProperty(value = "区分标识:1为企业端课程,0为管理端课程") - private Integer distinguish; - - @ApiModelProperty(value = "课程分类id") - private String classificationId; - - @ApiModelProperty(value = "小节数") - private Integer subsectionNum; - - @ApiModelProperty(value = "分类名称") - private String classification; - - @ApiModelProperty(value = "是否开启") - private Integer isEnable; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/EntrepreneurialActivityVO.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/EntrepreneurialActivityVO.java deleted file mode 100644 index 1b66399..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/EntrepreneurialActivityVO.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import com.baomidou.mybatisplus.annotation.*; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.Date; - -/** - * @描述:创业活动管理表 - * @作者: Rong - * @日期: 2023-04-27 - */ -@Data -@ApiModel(value = "创业活动管理表") -public class EntrepreneurialActivityVO { - - @TableId(type = IdType.AUTO) - @ApiModelProperty(value = "主键") - private Integer id; - - @ApiModelProperty(value = "创建人") - private String founderName; - - @ApiModelProperty(value = "报名人数") - private String applicantNum; - - @ApiModelProperty(value = "创建人id") - private Integer accountId; - - @ApiModelProperty(value = "学校id") - private Integer schoolId; - - @ApiModelProperty(value = "创建人角色(0、系统 1、老师 2、学生)") - private Integer founder; - - @ApiModelProperty(value = "发布状态(默认0、草稿箱 1、已发布)") - private Integer publishStatus; - - @ApiModelProperty(value = "项目名称") - private String projectName; - - @ApiModelProperty(value = "发起人(可多选,用逗号隔开)") - private String initiator; - - @ApiModelProperty(value = "项目封面图") - private String coverUrl; - - @ApiModelProperty(value = "项目轮播图") - private String carouselUrl; - - @ApiModelProperty(value = "项目开始时间") - private Date playStartTime; - - @ApiModelProperty(value = "项目结束时间") - private Date playEndTime; - - @ApiModelProperty(value = "报名开始时间") - private Date signUpStartTime; - - @ApiModelProperty(value = "报名结束时间") - private Date signUpEndTime; - - @ApiModelProperty(value = "创建时间") - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - @ApiModelProperty(value = "更新时间") - @TableField(fill = FieldFill.INSERT_UPDATE) - private Date updateTime; - - @ApiModelProperty(value = "是否开启(0开启 1未开启 默认0)") - private Integer isOpen; - - @ApiModelProperty(value = "用于教师端控制学生端是否开启(0开启 1未开启 默认0)") - private Integer schoolOpen; - - @ApiModelProperty(value = "项目描述") - private String projectDescribe; - - @ApiModelProperty(value = "邀请码") - private String invitationCode; - - @ApiModelProperty(value = "是否需要邀请码(0不需要,1需要)默认为0") - private Integer isNeedCode; - - @ApiModelProperty(value = "报名人数限制(0表示不限制)默认为0") - private Integer maximumNumber; - - @ApiModelProperty(value = "是否报名(0为已报名 1为未报名)", example = "0") - private Integer whetherToSignUp; - - @ApiModelProperty(value = "取消报名传的id", example = "0") - private Integer cancelId; - - @ApiModelProperty(value = "是否收藏:(state = 1收藏,0:未收藏)") - private Integer collectionStatus; - - - @ApiModelProperty(value = "收藏人数") - private Integer collectorsNum; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/EvaluationDetailVO.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/EvaluationDetailVO.java deleted file mode 100644 index f7ca150..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/EvaluationDetailVO.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import lombok.Data; - -import java.io.Serializable; - -/** - * 测评试题表,记录每次测评的试题,与测评记录表相关联 - * - * @author gongsj - * @email gongsj@gmail.com - * @date 2020-08-28 10:15:49 - */ -@Data -public class EvaluationDetailVO implements Serializable { - /** - * 序号 - */ - private Integer questionSortNo; - /** - * 是否正确 - */ - private Integer isTrue; - /** - * 试题得分 - */ - private Integer questionScore; - /** - * 用户填写的答案 - */ - private String userAnswer; - /** - * 正确答案 - */ - private String answer; - /** - * 解析 - */ - private String answerAnalysis; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/EvaluationQuestionVO.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/EvaluationQuestionVO.java deleted file mode 100644 index 50b1b18..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/EvaluationQuestionVO.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import lombok.Data; - -import java.io.Serializable; - -/** - * 测评试题表,记录每次测评的试题,与测评记录表相关联 - * - * @author gongsj - * @email gongsj@gmail.com - * @date 2020-08-28 10:15:49 - */ -@Data -public class EvaluationQuestionVO implements Serializable { - - /** - * 主键 - */ - private Integer id; - /** - * 试题id - */ - private Integer questionId; - /** - * 试题分值 - */ - private Integer questionPoints; - /** - * 用户填写的答案 - */ - private String userAnswer; - /** - * 正确答案 - */ - private String answer; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/EvaluationRecordDetailVO.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/EvaluationRecordDetailVO.java deleted file mode 100644 index db05882..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/EvaluationRecordDetailVO.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import lombok.Data; - -import java.io.Serializable; -import java.util.List; - -/** - * 记录用户测评信息 - * - * @author gongsj - * @email gongsj@gmail.com - * @date 2020-08-28 10:15:48 - */ -@Data -public class EvaluationRecordDetailVO implements Serializable { - /** - * 总得分 - */ - private Integer totalScore; - /** - * 详情列表 - */ - private List evaluationDetailVOS; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/EvaluationRecordSubmitVO.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/EvaluationRecordSubmitVO.java deleted file mode 100644 index 1f9a6ab..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/EvaluationRecordSubmitVO.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import lombok.Data; - -import java.io.Serializable; - -/** - * 记录用户测评信息 - * - * @author gongsj - * @email gongsj@gmail.com - * @date 2020-08-28 10:15:48 - */ -@Data -public class EvaluationRecordSubmitVO implements Serializable { - /** - * 主键 - */ - private Integer id; - /** - * 当前测评的用户的id - */ - private Integer userId; - /** - * 总题目数量 - */ - private Integer totalQuestionNum; - /** - * 是否通过 - */ - private String isPassed; - /** - * 总得分 - */ - private Integer totalScore; - /** - * 答对几题 - */ - private Integer correctQuestionNum; - /** - * 正确率 - */ - private String correctRate; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/EvaluationRulesVO.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/EvaluationRulesVO.java deleted file mode 100644 index 6a3e19c..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/EvaluationRulesVO.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import lombok.Data; - -import java.io.Serializable; - -/** - * 测评规则信息记录,只记录一条信息 - * - * @author gongsj - */ -@Data -public class EvaluationRulesVO implements Serializable { - - /** - * 主键 - */ - private Integer id; - /** - * 测评类型:1:随机类型,0:自定义类型 - */ - private Integer evaluationType; - /** - * 测评时长,单位:分钟 - */ - private Integer duration; - /** - * 测评总题数 - */ - private Integer questionNum; - /** - * 题库总题数 - */ - private Integer totalQuestionNum; - /** - * 单选题数 - */ - private Integer singleNum; - /** - * 题库单选题总数 - */ - private Integer totalSingleNum; - /** - * 只在类型为自定义类型时才启用:1:启用,0:不启用,默认1启用 - */ - private Integer isSingleEnable; - /** - * 多选题数 - */ - private Integer multipleNum; - /** - * 题库多选题总数 - */ - private Integer totalMultipleNum; - /** - * 只在类型为自定义类型时才启用:1:启用,0:不启用,默认1启用 - */ - private Integer isMultipleEnable; - /** - * 判断题数 - */ - private Integer judgmentNum; - /** - * 题库判断题总数 - */ - private Integer totalJudgmentNum; - /** - * 只在类型为自定义类型时才启用:1:启用,0:不启用,默认1启用 - */ - private Integer isJudgmentEnable; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/EvaluationVO.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/EvaluationVO.java deleted file mode 100644 index 876ed14..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/EvaluationVO.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; - -import java.io.Serializable; -import java.util.Set; - -/** - * 测评规则信息记录,只记录一条信息 - * - * @author gongsj - */ -@Data -@TableName("tms_evaluation_rules") -public class EvaluationVO implements Serializable { - - /** - * 主键 - */ - private Integer id; - /** - * 测评类型:1:随机类型,0:自定义类型 - */ - private Integer evaluationType; - /** - * 测评时长,单位:分钟 - */ - private Integer duration; - /** - * 测评总题数 - */ - private Integer questionNum; - /** - * 单选题数 - */ - private Integer singleNum; - /** - * 只在类型为自定义类型时才启用:1:启用,0:不启用,默认1启用 - */ - private Integer isSingleEnable; - /** - * 多选题数 - */ - private Integer multipleNum; - /** - * 只在类型为自定义类型时才启用:1:启用,0:不启用,默认1启用 - */ - private Integer isMultipleEnable; - /** - * 判断题数 - */ - private Integer judgmentNum; - /** - * 只在类型为自定义类型时才启用:1:启用,0:不启用,默认1启用 - */ - private Integer isJudgmentEnable; - /** - *试题列表 - */ - private Set Questions; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ImportStaffFailureVo.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ImportStaffFailureVo.java deleted file mode 100644 index 4687f0c..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ImportStaffFailureVo.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import cn.afterturn.easypoi.excel.annotation.ExcelTarget; -import com.huoran.occupationlab.utils.poi.ExcelAttribute; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.ToString; -import lombok.experimental.Accessors; - -@Data -@ToString -@Accessors(chain = true) -@ExcelTarget("ImportStaffFailureVo") -public class ImportStaffFailureVo { - - //第几行 - private Long index; - - @Excel(name = "姓名", orderNum = "1", isImportField = "id", width = 30) - @ApiModelProperty(value = "姓名") - private String userName; - - /*@ApiModelProperty(value = "账号") - @Excel(name = "账号", orderNum = "2", mergeVertical = false, isImportField = "account", width = 30) - private String account;*/ - - @ApiModelProperty(value = "角色") - @Excel(name = "角色", orderNum = "2", isImportField = "roleName", width = 30) - private String roleName; - - @ApiModelProperty(value = "工号") - @Excel(name = "工号", orderNum = "3", isImportField = "workNumber", width = 30) - private String workNumber; - - @ApiModelProperty(value = "一级部门") - @Excel(name = "一级部门", orderNum = "4", isImportField = "firstDept", width = 30) - private String firstDept; - - @ApiModelProperty(value = "二级部门") - @Excel(name = "二级部门", orderNum = "5", isImportField = "secondDept", width = 20) - private String secondDept; - - @ApiModelProperty(value = "手机号码") - @Excel(name = "手机号码", orderNum = "6", isImportField = "phone", width = 20) - private String phone; - - @ApiModelProperty(value = "邮箱") - @Excel(name = "邮箱", orderNum = "7", isImportField = "email", width = 20) - private String email; - - @ExcelAttribute(sort = 8) - @Excel(name = "失败原因", orderNum = "8", isImportField = "failureMsg", width = 50) - private String failureMsg; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ImportStudentFailureVo.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ImportStudentFailureVo.java deleted file mode 100644 index b66745c..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ImportStudentFailureVo.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import cn.afterturn.easypoi.excel.annotation.ExcelTarget; -import com.huoran.occupationlab.utils.poi.ExcelAttribute; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.ToString; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotNull; - -@Data -@ToString -@Accessors(chain = true) -@ExcelTarget("ImportStudentFailureVo") -public class ImportStudentFailureVo { - - //第几行 - private Long index; - - @Excel(name = "学生姓名", orderNum = "1", isImportField = "id", width = 30) - @ApiModelProperty(value = "学生姓名") - private String userName; - - @ApiModelProperty(value = "学号") - @Excel(name = "学号", orderNum = "2", isImportField = "workNumber", width = 30) - private String workNumber; - - @ApiModelProperty(value = "专业") - @Excel(name = "专业", orderNum = "3", isImportField = "professional", width = 20) - private String professional; - - @ApiModelProperty(value = "年级") - @Excel(name = "年级", orderNum = "4", isImportField = "grade", width = 20) - private String grade; - - @ApiModelProperty(value = "班级") - @Excel(name = "班级", orderNum = "5", isImportField = "classes", width = 20) - private String classes; - - @ApiModelProperty(value = "手机号码") - @Excel(name = "手机号码", orderNum = "6", isImportField = "phone", width = 20) - private String phone; - - @ApiModelProperty(value = "邮箱") - @Excel(name = "邮箱", orderNum = "7", isImportField = "email", width = 20) - private String email; - - @ExcelAttribute(sort = 8) - @Excel(name = "失败原因", orderNum = "8", isImportField = "failureMsg", width = 50) - private String failureMsg; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/PerformanceManagementPracticeActivityVO.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/PerformanceManagementPracticeActivityVO.java deleted file mode 100644 index 45e35d8..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/PerformanceManagementPracticeActivityVO.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.Date; - -/** - * @描述:成绩管理——练习活跃度 - * @作者: Rong - * @日期: 2023-04-27 - */ -@Data -@ApiModel(value = "练习活跃度") -public class PerformanceManagementPracticeActivityVO { - - @ApiModelProperty(value = "项目id") - private Integer projectId; - - @ApiModelProperty(value = "创建人id") - private Integer accountId; - - @ApiModelProperty(value = "学校id") - private Integer schoolId; - - @ApiModelProperty(value = "班级") - private String className; - - @ApiModelProperty(value = "学校名称") - private String schoolName; - - @ApiModelProperty(value = "学生姓名") - private String userName; - - @ApiModelProperty(value = "学号/工号") - private String workNumber; - - @ApiModelProperty(value = "总耗时") - private String totalTimeConsuming; - - @ApiModelProperty(value = "总分") - private String totalScore; - - @ApiModelProperty(value = "练习次数") - private Integer practiceNum; - - @ApiModelProperty(value = "最高分") - private String highestScore; - - @ApiModelProperty(value = "最低分") - private String lowestMark; - - @ApiModelProperty(value = "耗时最长") - private String theLongestTime; - - @ApiModelProperty(value = "耗时最短") - private String shortestTime; - - @ApiModelProperty(value = "最近提交时间") - private String lastSubmissionTime; - - @ApiModelProperty(value = "平均分") - private String avgScore; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/PermissionVO.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/PermissionVO.java deleted file mode 100644 index f0799c0..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/PermissionVO.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.List; - -/** - * @Author chen - * @DATE 2020/11/9 16:44 - * @Version 1.0 - */ -@Data -public class PermissionVO { - - @ApiModelProperty(value = "角色ID") - String roleId; - - @ApiModelProperty(value = "菜单ID") - List permissionId; - - @ApiModelProperty(value = "端口") - Integer isPort; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/PersonalExcelDataVO.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/PersonalExcelDataVO.java deleted file mode 100644 index c7947a6..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/PersonalExcelDataVO.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -@Data -public class PersonalExcelDataVO { - - @ApiModelProperty(value = "序号") - @Excel(name = "序号", orderNum = "1", isImportField = "rownum", width = 30) - private Integer rownum; - - @ApiModelProperty(value = "学校") - @Excel(name = "学校", orderNum = "2", mergeVertical = true, isImportField = "school", width = 30) - private String school; - - @ApiModelProperty(value = "学生姓名") - @Excel(name = "学生姓名", orderNum = "3", mergeVertical = true, isImportField = "username", width = 30) - private String username; - - - @ApiModelProperty(value = "学号") - @Excel(name = "学号", orderNum = "4", mergeVertical = true, isImportField = "workNumber", width = 30) - private String workNumber; - - @ApiModelProperty(value = "手机号") - @Excel(name = "手机号", orderNum = "5", mergeVertical = true, isImportField = "phone", width = 30) - private String phone; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/PracticeTheHighestScoreListVO.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/PracticeTheHighestScoreListVO.java deleted file mode 100644 index 971ed23..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/PracticeTheHighestScoreListVO.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * @描述:成绩管理——练习最高分列表 - * @作者: Rong - * @日期: 2023-04-27 - */ -@Data -@ApiModel(value = "练习最高分列表") -public class PracticeTheHighestScoreListVO { - - @ApiModelProperty(value = "项目id") - private Integer projectId; - - @ApiModelProperty(value = "账号id") - private Integer accountId; - - @ApiModelProperty(value = "学生姓名") - private String userName; - - @ApiModelProperty(value = "最高分") - private String highestScore; - - @ApiModelProperty(value = "学生头像") - private String userAvatars; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ProductClassInformationVO.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ProductClassInformationVO.java deleted file mode 100644 index 7710d6e..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ProductClassInformationVO.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.Date; - - -@Data -@ApiModel(value = "产品维度下获取班级列表") -public class ProductClassInformationVO { - - - @ApiModelProperty(value = "产品名称") - private String curriculumName; - - @ApiModelProperty(value = "商品id") - private Integer mallId; - - @ApiModelProperty(value = "班级id") - private Integer classId; - - @ApiModelProperty(value = "课程id") - private Integer cid; - - @ApiModelProperty(value = "班级名称") - private String className; - - - @ApiModelProperty(value = "班级人总数") - private Integer classSize; - - @ApiModelProperty(value = "练习项目数") - private Integer numberOfPracticeItems; - - @ApiModelProperty(value = "考核项目数") - private Integer numberOfAssessmentItems; - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ProjectVo.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ProjectVo.java deleted file mode 100644 index ea051ac..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ProjectVo.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import com.huoran.common.entity.ProjectManage; -import com.huoran.occupationlab.entity.ProjectJudgment; -import io.swagger.annotations.ApiModel; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import javax.validation.Valid; -import java.util.List; - -/** - * @description - * @author: Mr.JK - * @create: 2021-08-30 14:37 - **/ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@ApiModel(value="ProjectVo对象") -public class ProjectVo { - - @Valid - private ProjectManage projectManage; - - @Valid - private List projectJudgmentList; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/QuestionImportFailureVo.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/QuestionImportFailureVo.java deleted file mode 100644 index fd2ac64..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/QuestionImportFailureVo.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import com.huoran.occupationlab.utils.poi.ExcelAttribute; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.ToString; -import lombok.experimental.Accessors; - -@Data -@ToString -@Accessors(chain = true) -public class QuestionImportFailureVo { - - //第几行 - private Long index; - - @ExcelAttribute(sort = 0) - @ApiModelProperty("题干") - private String questionStem; - - @ApiModelProperty("题型") - @ExcelAttribute(sort = 1) - private String questionTypeName; - - @ApiModelProperty("选项A") - @ExcelAttribute(sort = 2) - private String optionA; - - @ApiModelProperty("选项B") - @ExcelAttribute(sort = 3) - private String optionB; - - @ApiModelProperty("选项C") - @ExcelAttribute(sort = 4) - private String optionC; - - @ApiModelProperty("选项D") - @ExcelAttribute(sort = 5) - private String optionD; - - @ApiModelProperty("选项E") - @ExcelAttribute(sort = 6) - private String optionE; - - @ApiModelProperty("选项F") - @ExcelAttribute(sort = 7) - private String optionF; - - @ApiModelProperty("正确答案") - @ExcelAttribute(sort = 8) - private String answer; - - @ApiModelProperty("答案解析") - @ExcelAttribute(sort = 9) - private String answerAnalysis; - - @ApiModelProperty("失败原因") - @ExcelAttribute(sort = 10) - private String failureMsg; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/QuestionsDetailVO.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/QuestionsDetailVO.java deleted file mode 100644 index fa3d3ca..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/QuestionsDetailVO.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import lombok.Data; - -import java.io.Serializable; - -/** - * 记录试题信息 - * - * @author gongsj - */ -@Data -public class QuestionsDetailVO implements Serializable { - - /** - * 主键 - */ - private Integer id; - /** - * 题型:用于区分是什么题型,1:单选,2:多选,3:判断 - */ - private Integer questionType; - /** - * 题型名称 - */ - private String questionTypeName; - /** - * 题干信息 - */ - private String questionStem; - /** - * A选项内容 - */ - private String optionA; - /** - * A选项是否为正确答案 - */ - private boolean AIsTrue = false; - /** - * B选项内容 - */ - private String optionB; - /** - * B选项是否为正确答案 - */ - private boolean BIsTrue = false; - /** - * C选项内容 - */ - private String optionC; - /** - * C选项是否为正确答案 - */ - private boolean CIsTrue = false; - /** - * D选项内容 - */ - private String optionD; - /** - * D选项是否为正确答案 - */ - private boolean DIsTrue = false; - /** - * E选项内容 - */ - private String optionE; - /** - * E选项是否为正确答案 - */ - private boolean EIsTrue = false; - /** - * F选项内容 - */ - private String optionF; - /** - * F选项是否为正确答案 - */ - private boolean FIsTrue = false; - /** - * 正确答案 - */ - private String answer; - /** - * 答案解析 - */ - private String answerAnalysis; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/QuestionsImportFailureVO.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/QuestionsImportFailureVO.java deleted file mode 100644 index 4effedd..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/QuestionsImportFailureVO.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import com.huoran.occupationlab.utils.poi.ExcelAttribute; -import lombok.Data; -import lombok.ToString; - -/** - * 试题的基本信息表 - * - * @author gongsj - */ -@Data -@ToString -public class QuestionsImportFailureVO { - /** - * 第几行 - */ - private Integer index; - - /** - * 题干,问题描述 - */ - @ExcelAttribute(sort = 0) - private String questionStem; - /** - * 题型 - */ - @ExcelAttribute(sort = 1) - private String questionTypeName; - /** - * 选项A - */ - @ExcelAttribute(sort = 2) - private String optionA; - /** - * 选项B - */ - @ExcelAttribute(sort = 3) - private String optionB; - /** - * 选项C - */ - @ExcelAttribute(sort = 4) - private String optionC; - /** - * 选项D - */ - @ExcelAttribute(sort = 5) - private String optionD; - /** - * 选项E - */ - @ExcelAttribute(sort = 6) - private String optionE; - /** - * 选项F - */ - @ExcelAttribute(sort = 7) - private String optionF; - /** - * 正确答案 - */ - @ExcelAttribute(sort = 8) - private String answer; - /** - * 答案解析 - */ - @ExcelAttribute(sort = 9) - private String answerAnalysis; - - /** - * 失败原因 - */ - @ExcelAttribute(sort = 10) - private String failureMsg; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/RegistrationVO.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/RegistrationVO.java deleted file mode 100644 index 421d549..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/RegistrationVO.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -@Data -public class RegistrationVO { - - @ApiModelProperty(value = "序号") - @Excel(name = "序号", orderNum = "1", isImportField = "id", width = 30) - private Integer rownum; - - - @ApiModelProperty(value = "学校") - @Excel(name = "学校", orderNum = "2", mergeVertical = true, isImportField = "schoolName", width = 30) - private String schoolName; - - @ApiModelProperty(value = "姓名") - @Excel(name = "姓名", orderNum = "3", mergeVertical = true, isImportField = "username", width = 30) - private String username; - - - @ApiModelProperty(value = "学号/工号") - @Excel(name = "学号/工号", orderNum = "4", mergeVertical = true, isImportField = "workNumber", width = 30) - private String workNumber; - - - @ApiModelProperty(value = "手机号") - @Excel(name = "手机号", orderNum = "5", mergeVertical = true, isImportField = "phone", width = 30) - private String phone; - - - @ApiModelProperty(value = "是否禁用(0未禁用,1禁用)") - private Integer isDisable; - - @ApiModelProperty(value = "报名表主键id") - private Integer id; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ReorderVO.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ReorderVO.java deleted file mode 100644 index 247cdf3..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/ReorderVO.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import lombok.Data; - -import java.io.Serializable; -import java.util.List; - -/** - * @Author chen - * @DATE 2022/9/23 14:53 - * @Version 1.0 - */ -@Data -public class ReorderVO implements Serializable { - - private static final long serialVersionUID = 1L; - - private List chapterVOList; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/SortVO.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/SortVO.java deleted file mode 100644 index 577ef66..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/SortVO.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import lombok.Data; - -import java.io.Serializable; -import java.util.List; - -/** - * @Author chen - * @DATE 2020/10/15 9:01 - * @Version 1.0 - */ -@Data -public class SortVO implements Serializable { - - private static final long serialVersionUID = 1L; - - private List chapterVOList; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/StudentImportFailureVo.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/StudentImportFailureVo.java deleted file mode 100644 index 30386a4..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/StudentImportFailureVo.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import com.huoran.occupationlab.utils.poi.ExcelAttribute; -import lombok.Data; -import lombok.ToString; -import lombok.experimental.Accessors; - -@Data -@ToString -@Accessors(chain = true) -public class StudentImportFailureVo { - - //第几行 - private Long index; - //用户账号 - @ExcelAttribute(sort = 0) - private String account; - //用户姓名 - @ExcelAttribute(sort = 1) - private String userName; - //学生学号 - @ExcelAttribute(sort = 2) - private String workNumber; - //手机号 - @ExcelAttribute(sort = 3) - private String phone; - //绑定邮箱 - @ExcelAttribute(sort = 4) - private String email; - //客户名称 - @ExcelAttribute(sort = 5) - private String clientName; - //失败原因 - @ExcelAttribute(sort = 6) - private String failureMsg; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/SubsectionVO.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/SubsectionVO.java deleted file mode 100644 index 76b5081..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/SubsectionVO.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.io.Serializable; - -/** - * @Author chen - * @DATE 2020/10/10 9:37 - * @Version 1.0 - * 小节封装对象 - */ -@Data -public class SubsectionVO implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "小节ID") - private String id; - - @ApiModelProperty(value = "小节名称") - private String name; - - @ApiModelProperty(value = "原始文件名称") - private String originalFileName; - - @ApiModelProperty(value = "阿里云文件名称") - private String fileName; - - @ApiModelProperty(value = "资源文件ID") - private String fileId; - - @ApiModelProperty(value = "文件存储路径") - private String fileUrl; - - @ApiModelProperty(value = "资源文件类型") - private String fileType; - - @ApiModelProperty(value = "排序字段") - private Integer sort; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/TMSEvaluationRecordVO.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/TMSEvaluationRecordVO.java deleted file mode 100644 index 28cc5d1..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/TMSEvaluationRecordVO.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import lombok.Data; - -/** - * 用户测评信息 - */ -@Data -public class TMSEvaluationRecordVO { - /** - * 主键 - */ - private Integer id; - /** - * 当前测评的用户的id - */ - private Integer accountId; - /** - * 记录当前做到第几题,用于刷新页面以后保持在当前题目,默认开始时是第一题 - */ - private Integer currentQuestionSortNo; - /** - * 总题目数量 - */ - private Integer totalQuestionNum; - /** - * 题型 - */ - private String questionType; - /** - * 题型名称 - */ - private String questionTypeName; - /** - * 题干信息 - */ - private String questionStem; - /** - * A选项内容 - */ - private String optionA; - /** - * B选项内容 - */ - private String optionB; - /** - * C选项内容 - */ - private String optionC; - /** - * D选项内容 - */ - private String optionD; - /** - * E选项内容 - */ - private String optionE; - /** - * F选项内容 - */ - private String optionF; - /** - * 用户答案 - */ - private String userAnswer; - /** - * 测试类型 - */ - private Integer types; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/TheoreticalChapterVO.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/TheoreticalChapterVO.java deleted file mode 100644 index eb7cbcd..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/TheoreticalChapterVO.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.ArrayList; -import java.util.List; - -/** - * @Author chen - * @DATE 2022/9/23 14:42 - * @Version 1.0 - */ -@Data -public class TheoreticalChapterVO { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "章节ID") - private Integer id; - - @ApiModelProperty(value = "章节名称") - private String name; - - @ApiModelProperty(value = "排序号") - private Integer sort; - - @ApiModelProperty(value = "小节集合") - private List subsectionList = new ArrayList<>(); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/TheoreticalSubsectionVO.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/TheoreticalSubsectionVO.java deleted file mode 100644 index 96387f1..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/TheoreticalSubsectionVO.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * @Author chen - * @DATE 2022/9/23 14:43 - * @Version 1.0 - */ -@Data -public class TheoreticalSubsectionVO { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "小节ID") - private Integer id; - - @ApiModelProperty(value = "小节名称") - private String name; - - @ApiModelProperty(value = "原始文件名称") - private String originalFileName; - - @ApiModelProperty(value = "阿里云文件名称") - private String fileName; - - @ApiModelProperty(value = "资源文件ID") - private String fileId; - - @ApiModelProperty(value = "文件存储路径") - private String fileUrl; - - @ApiModelProperty(value = "资源文件类型") - private String fileType; - - @ApiModelProperty(value = "排序字段") - private Integer sort; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/UserInfo.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/UserInfo.java deleted file mode 100644 index 374cf4b..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/UserInfo.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - *

- * 用户信息表 - *

- * - * @author Ning - * @since 2020-10-21 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@ApiModel(value = "UserInfo对象", description = "用户信息表") -@TableName("hr_user_info") -public class UserInfo implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "用户id") - @TableId(value = "userId", type = IdType.AUTO) - private Integer userId; - - @ApiModelProperty(value = "用户姓名") - @TableField("userName") - private String userName; - - @ApiModelProperty(value = "唯一标识账号") - @TableField("uniqueIdentificationAccount") - private String uniqueIdentificationAccount; - - @ApiModelProperty(value = "证件类型(1、身份证)") - @TableField("documentType") - private Integer documentType; - - @ApiModelProperty(value = "证件号码") - @TableField("IDNumber") - private String IDNumber; - - @ApiModelProperty(value = "绑定省份id") - @TableField("provinceId") - private Integer provinceId; - - @ApiModelProperty(value = "绑定城市id") - @TableField("cityId") - private Integer cityId; - - @ApiModelProperty(value = "国家归属地") - private String countries; - - @ApiModelProperty(value = "出生日期") - @TableField("dateBirth") - private String dateBirth; - - @ApiModelProperty(value = "教育程度") - @TableField("educationDegree") - private Integer educationDegree; - - @ApiModelProperty(value = "绑定客户id") - @TableField("clientId") - private Integer clientId; - - @ApiModelProperty(value = "绑定客户名称") - @TableField("clientName") - private String clientName; - - @ApiModelProperty(value = "电话") - private String phone; - - @ApiModelProperty(value = "微信号") - @TableField("weChatID") - private String weChatID; - - @ApiModelProperty(value = "邮箱") - private String email; - - @ApiModelProperty(value = "账号") - private String account; - - @ApiModelProperty(value = "密码") - private String password; - - @ApiModelProperty(value = "创建时间") - @TableField("creationTime") - private String creationTime; - - @ApiModelProperty(value = "登陆次数") - @TableField("logInNumber") - private Integer logInNumber; - - @ApiModelProperty(value = "性别(1、男 2、女)") - private Integer sex; - - @ApiModelProperty(value = "用户头像路径") - @TableField("userAvatars") - private String userAvatars; - - @ApiModelProperty(value = "最后登陆时间") - @TableField("lastLoginTime") - private String lastLoginTime; - - @ApiModelProperty(value = "绑定多个角色id") - @TableField("roleId") - private String roleId; - - @ApiModelProperty(value = "是什么端口(1、企业端 2、管理端)") - @TableField("isPort") - private Integer isPort; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/UserManagementImportFailureVo.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/UserManagementImportFailureVo.java deleted file mode 100644 index 76c5769..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/UserManagementImportFailureVo.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import com.huoran.occupationlab.utils.poi.ExcelAttribute; -import lombok.Data; -import lombok.ToString; -import lombok.experimental.Accessors; - -@Data -@ToString -@Accessors(chain = true) -public class UserManagementImportFailureVo { - - //第几行 - private Long index; - //账号 - @ExcelAttribute(sort = 0) - private String account; - //用户姓名 - @ExcelAttribute(sort = 1) - private String name; - //客户名称 - @ExcelAttribute(sort = 2) - private String clientName; - //失败原因 - @ExcelAttribute(sort = 3) - private String failureMsg; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/UserVO.java b/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/UserVO.java deleted file mode 100644 index 28238e7..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/entity/vo/UserVO.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.huoran.occupationlab.entity.vo; - -import com.huoran.occupationlab.entity.UserManagement; -import com.huoran.occupationlab.entity.vo.UserInfo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - *

- * 企业端用户管理 - *

- * - * @author Ning - * @since 2020-10-27 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@ApiModel(value="UserVO", description="用户管理") -public class UserVO implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "用户信息") - private UserInfo userInfo; - - @ApiModelProperty(value = "用户管理信息") - private UserManagement userManagement; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/helper/MemuHelper.java b/occupationlab/src/main/java/com/huoran/occupationlab/helper/MemuHelper.java deleted file mode 100644 index 07e5987..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/helper/MemuHelper.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.huoran.occupationlab.helper; - -import com.alibaba.fastjson.JSONObject; -import com.huoran.occupationlab.entity.AclPermission; -import org.springframework.util.StringUtils; - -import java.util.ArrayList; -import java.util.List; - -/** - * 根据权限数据构建登录用户左侧菜单数据 - */ -public class MemuHelper { - - /** - * 构建菜单 - */ - public static List bulid(List treeNodes) { - List meuns = new ArrayList<>(); - if (treeNodes.size() == 1) { - AclPermission topNode = treeNodes.get(0); - //左侧一级菜单 - List oneMeunList = topNode.getChildren(); - for (AclPermission one : oneMeunList) { - JSONObject oneMeun = new JSONObject(); - oneMeun.put("path", one.getPath()); - oneMeun.put("component", one.getComponent()); - oneMeun.put("redirect", "noredirect"); - oneMeun.put("name", "name_" + one.getId()); - oneMeun.put("hidden", false); - - JSONObject oneMeta = new JSONObject(); - oneMeta.put("title", one.getName()); - oneMeta.put("icon", one.getIcon()); - oneMeun.put("meta", oneMeta); - - List children = new ArrayList<>(); - List twoMeunList = one.getChildren(); - for (AclPermission two : twoMeunList) { - JSONObject twoMeun = new JSONObject(); - twoMeun.put("path", two.getPath()); - twoMeun.put("component", two.getComponent()); - twoMeun.put("name", "name_" + two.getId()); - twoMeun.put("hidden", false); - - JSONObject twoMeta = new JSONObject(); - twoMeta.put("title", two.getName()); - twoMeun.put("meta", twoMeta); - - children.add(twoMeun); - - List threeMeunList = two.getChildren(); - for (AclPermission three : threeMeunList) { - if (StringUtils.isEmpty(three.getPath())) continue; - - JSONObject threeMeun = new JSONObject(); - threeMeun.put("path", three.getPath()); - threeMeun.put("component", three.getComponent()); - threeMeun.put("name", "name_" + three.getId()); - threeMeun.put("hidden", true); - - JSONObject threeMeta = new JSONObject(); - threeMeta.put("title", three.getName()); - threeMeun.put("meta", threeMeta); - - children.add(threeMeun); - } - } - oneMeun.put("children", children); - meuns.add(oneMeun); - } - } - return meuns; - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/helper/PermissionHelper.java b/occupationlab/src/main/java/com/huoran/occupationlab/helper/PermissionHelper.java deleted file mode 100644 index 85f7f24..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/helper/PermissionHelper.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.huoran.occupationlab.helper; - - -import com.huoran.occupationlab.entity.AclPermission; - -import java.util.ArrayList; -import java.util.List; - -/** - * 根据权限数据构建菜单数据 - */ -public class PermissionHelper { - - /** - * 使用递归方法建菜单 - */ - public static List bulid(List treeNodes) { - List trees = new ArrayList<>(); - for (AclPermission treeNode : treeNodes) { - if ("0".equals(treeNode.getPid())) { - treeNode.setLevel(1); - trees.add(findChildren(treeNode, treeNodes)); - } - } - return trees; - } - - /** - * 递归查找子节点 - */ - public static AclPermission findChildren(AclPermission treeNode, List treeNodes) { - treeNode.setChildren(new ArrayList()); - - for (AclPermission it : treeNodes) { - if (treeNode.getId().equals(it.getPid())) { - int level = treeNode.getLevel() + 1; - it.setLevel(level); - if (treeNode.getChildren() == null) { - treeNode.setChildren(new ArrayList<>()); - } - treeNode.getChildren().add(findChildren(it, treeNodes)); - } - } - return treeNode; - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/job/task/AssessmentTimedStart.java b/occupationlab/src/main/java/com/huoran/occupationlab/job/task/AssessmentTimedStart.java deleted file mode 100644 index f988296..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/job/task/AssessmentTimedStart.java +++ /dev/null @@ -1,34 +0,0 @@ -//package com.huoran.occupationlab.job.task; -// -//import com.huoran.occupationlab.entity.Assessment; -//import com.huoran.occupationlab.service.AssessmentService; -//import com.huoran.occupationlab.utils.CronUtils; -//import org.springframework.beans.factory.annotation.Autowired; -//import org.springframework.stereotype.Component; -// -//import java.util.Date; -// -//@Component("assessmentJobStart") -//public class AssessmentTimedStart { -// -// @Autowired -// public AssessmentService service; -// -// //params传考核id -// public void run(String params){ -// //启动考核 -// Assessment assessment = new Assessment(); -// assessment.setStatus(1); -// assessment.setId(Integer.valueOf(params)); -// service.updateById(assessment); -// } -// -// public static void main(String[] args) { -// System.out.println(CronUtils.getCron(new Date())); -// } -//} -// -// -// -// -// diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/job/task/AssessmentTimedStop.java b/occupationlab/src/main/java/com/huoran/occupationlab/job/task/AssessmentTimedStop.java deleted file mode 100644 index e869474..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/job/task/AssessmentTimedStop.java +++ /dev/null @@ -1,21 +0,0 @@ -//package com.huoran.occupationlab.job.task; -// -//import com.huoran.occupationlab.entity.Assessment; -//import com.huoran.occupationlab.service.AssessmentService; -//import org.springframework.beans.factory.annotation.Autowired; -//import org.springframework.stereotype.Component; -// -//@Component("assessmentJobStop") -//public class AssessmentTimedStop { -// -// @Autowired -// public AssessmentService service; -// -// public void run(String params){ -// //停止考核 -// Assessment assessment = new Assessment(); -// assessment.setStatus(2); -// assessment.setId(Integer.valueOf(params)); -// service.updateById(assessment); -// } -//} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/job/task/TestTask.java b/occupationlab/src/main/java/com/huoran/occupationlab/job/task/TestTask.java deleted file mode 100644 index 31c4bda..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/job/task/TestTask.java +++ /dev/null @@ -1,67 +0,0 @@ -//package com.huoran.occupationlab.job.task; -// -//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -//import com.huoran.occupationlab.entity.Assessment; -//import com.huoran.occupationlab.service.AssessmentService; -//import com.huoran.occupationlab.service.StudentService; -//import org.slf4j.Logger; -//import org.slf4j.LoggerFactory; -//import org.springframework.beans.factory.annotation.Autowired; -//import org.springframework.stereotype.Component; -// -//import java.util.List; -// -///** -// * 测试定时任务(演示Demo,可删除) -// * testTask为spring bean的名称, 方法名称必须是run -// * -// * @author cheney -// * @version V1.0 -// * @date 2022年7月28日 -// */ -//@Component("testTask") -//public class TestTask { -// private Logger logger = LoggerFactory.getLogger(getClass()); -// @Autowired -// public StudentService studentService; -// -// @Autowired -// public AssessmentService service; -// -// public void run(String params) { -// System.out.println("TestTask:监控考核定时任务正在执行,参数为:{}"+ params); -// //查询考核类型为定时发布且考核状态为待开始状态以及开始时间为当前时间时候 则启动考核 -// QueryWrapper queryWrapper = new QueryWrapper<>(); -// queryWrapper.eq("type", 2);//发布类型(1、手动发布 2、定时发布) -// queryWrapper.eq("is_del", 0); -// queryWrapper.eq("status", 0);//状态(0、待开始 1、进行中 2、已结束) -// queryWrapper.last(" AND start_time = now() "); -// List list = service.list(queryWrapper); -// if (list.size() > 0) { -// for (Assessment experimentalTeaching : list) { -// //启动考核 -// Assessment update = new Assessment(); -// update.setStatus(1); -// update.setId(experimentalTeaching.getId()); -// service.updateById(update); -// } -// } -// -// //当结束时间为当前时间 且发布类型为定时发布的以及考核状态为进行中的 则停止考核 -// QueryWrapper queryWrapper1 = new QueryWrapper<>(); -// //queryWrapper1.eq("type", 2); -// queryWrapper1.eq("is_del", 0); -// queryWrapper1.eq("status", 1); -// queryWrapper1.last(" AND stop_time = now() "); -// List list1 = service.list(queryWrapper1); -// if (list1.size() > 0) { -// for (Assessment experimentalTeaching : list1) { -// //停止考核 -// Assessment update = new Assessment(); -// update.setStatus(2); -// update.setId(experimentalTeaching.getId()); -// service.updateById(update); -// } -// } -// } -//} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/job/utils/ScheduleJob.java b/occupationlab/src/main/java/com/huoran/occupationlab/job/utils/ScheduleJob.java deleted file mode 100644 index ab82a62..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/job/utils/ScheduleJob.java +++ /dev/null @@ -1,113 +0,0 @@ -//package com.huoran.occupationlab.job.utils; -// -//import com.huoran.common.response.R; -//import com.huoran.occupationlab.entity.SysJob; -//import com.huoran.occupationlab.entity.SysJobLog; -//import com.huoran.occupationlab.service.SysJobLogService; -//import com.huoran.occupationlab.utils.SpringContextUtils; -//import org.apache.commons.lang.StringUtils; -//import org.quartz.JobExecutionContext; -//import org.slf4j.Logger; -//import org.slf4j.LoggerFactory; -//import org.springframework.scheduling.quartz.QuartzJobBean; -// -//import java.lang.reflect.Method; -// -// -///** -// * 定时任务 -// * -// * @author cheney -// * @version V1.0 -// * @date 2022年7月28日 -// */ -// -//public class ScheduleJob extends QuartzJobBean { -// private Logger logger = LoggerFactory.getLogger(getClass()); -// -// final SysJobLogService sysJobLogService; -// -// public ScheduleJob(SysJobLogService sysJobLogService) { -// this.sysJobLogService = sysJobLogService; -// } -// -// -// @Override -// protected void executeInternal(JobExecutionContext context) { -// SysJob scheduleJob = (SysJob) context.getMergedJobDataMap() -// .get(SysJob.JOB_PARAM_KEY); -// -// //获取spring bean -// SysJobLogService scheduleJobLogService = (SysJobLogService) SpringContextUtils.getBean("sysJobLogService"); -// -// //数据库保存执行记录 -// SysJobLog log = new SysJobLog(); -// log.setJobId(scheduleJob.getId()); -// log.setBeanName(scheduleJob.getBeanName()); -// log.setParams(scheduleJob.getParams()); -// -// //任务开始时间 -// long startTime = System.currentTimeMillis(); -// -// try { -// //执行任务 -// logger.debug("任务准备执行,任务ID:" + scheduleJob.getId()); -// -// Object target = SpringContextUtils.getBean(scheduleJob.getBeanName()); -// assert target != null; -// Method method = target.getClass().getDeclaredMethod("run", String.class); -// method.invoke(target, scheduleJob.getParams()); -// -// //任务执行总时长 -// long times = System.currentTimeMillis() - startTime; -// log.setTimes((int) times); -// //任务状态 0:成功 1:失败 -// log.setStatus(0); -// -// logger.debug("任务执行完毕,任务ID:" + scheduleJob.getId() + " 总共耗时:" + times + "毫秒"); -// } catch (Exception e) { -// logger.error("任务执行失败,任务ID:" + scheduleJob.getId(), e); -// -// //任务执行总时长 -// long times = System.currentTimeMillis() - startTime; -// log.setTimes((int) times); -// -// //任务状态 0:成功 1:失败 -// log.setStatus(1); -// log.setError(StringUtils.substring(e.toString(), 0, 2000)); -// } finally { -// assert scheduleJobLogService != null; -// scheduleJobLogService.save(log); -// } -// } -// -///** -// * 判断bean是否有效 -// * -// * @param beanName beanName -// * @return 返回信息 -// */ -// -// public static R judgeBean(String beanName) { -// -// if (org.springframework.util.StringUtils.isEmpty(beanName)) { -// return R.error("spring bean名称不能为空"); -// } -// -// Object target = SpringContextUtils.getBean(beanName); -// if (target == null) { -// return R.error("spring bean不存在,请检查"); -// } -// Method method; -// try { -// method = target.getClass().getDeclaredMethod("run", String.class); -// } catch (Exception e) { -// return R.error("spring bean中的run方法不存在,请检查"); -// } -// if (method == null) { -// return R.error("spring bean中的run方法不存在,请检查"); -// } -// -// return R.ok(); -// } -//} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/job/utils/ScheduleUtils.java b/occupationlab/src/main/java/com/huoran/occupationlab/job/utils/ScheduleUtils.java deleted file mode 100644 index c41df42..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/job/utils/ScheduleUtils.java +++ /dev/null @@ -1,159 +0,0 @@ -//package com.huoran.occupationlab.job.utils; -// -// -//import com.huoran.common.exception.BusinessException; -//import com.huoran.occupationlab.entity.SysJob; -//import com.huoran.occupationlab.utils.job.Constant; -//import org.quartz.*; -// -///** -// * 定时任务工具类 -// * -// * @author cheney -// * @version V1.0 -// * @date 2022年7月28日 -// */ -// -//public class ScheduleUtils { -// private final static String JOB_NAME = "TASK_"; -// -// /** -// * 获取触发器key -// */ -// -// public static TriggerKey getTriggerKey(Integer jobId) { -// return TriggerKey.triggerKey(JOB_NAME + jobId); -// } -// -// /** -// * 获取jobKey -// */ -// -// public static JobKey getJobKey(Integer jobId) { -// return JobKey.jobKey(JOB_NAME + jobId); -// } -// -// /** -// * 获取表达式触发器 -// */ -// -// public static CronTrigger getCronTrigger(Scheduler scheduler, Integer jobId) { -// try { -// return (CronTrigger) scheduler.getTrigger(getTriggerKey(jobId)); -// } catch (SchedulerException e) { -// throw new BusinessException("获取定时任务CronTrigger出现异常"); -// } -// } -// -// /** -// * 创建定时任务 -// */ -// -// public static void createScheduleJob(Scheduler scheduler, SysJob scheduleJob) { -// try { -// //构建job信息 -// JobDetail jobDetail = JobBuilder.newJob(ScheduleJob.class).withIdentity(getJobKey(scheduleJob.getId())).build(); -// -// //表达式调度构建器 -// CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(scheduleJob.getCronExpression()).withMisfireHandlingInstructionDoNothing(); -// -// //按新的cronExpression表达式构建一个新的trigger -// CronTrigger trigger = TriggerBuilder.newTrigger().withIdentity(getTriggerKey(scheduleJob.getId())).withSchedule(scheduleBuilder).build(); -// -// //放入参数,运行时的方法可以获取 -// jobDetail.getJobDataMap().put(SysJob.JOB_PARAM_KEY, scheduleJob); -// -// scheduler.scheduleJob(jobDetail, trigger); -// -// //暂停任务 -// if (Constant.SCHEDULER_STATUS_PAUSE.equals(scheduleJob.getStatus())) { -// pauseJob(scheduler, scheduleJob.getId()); -// } -// } catch (SchedulerException e) { -// throw new BusinessException("创建定时任务失败"); -// } -// } -// -// /** -// * 更新定时任务 -// */ -// -// public static void updateScheduleJob(Scheduler scheduler, SysJob scheduleJob) { -// try { -// TriggerKey triggerKey = getTriggerKey(scheduleJob.getId()); -// -// //表达式调度构建器 -// CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(scheduleJob.getCronExpression()).withMisfireHandlingInstructionDoNothing(); -// -// CronTrigger trigger = getCronTrigger(scheduler, scheduleJob.getId()); -// -// //按新的cronExpression表达式重新构建trigger -// trigger = trigger.getTriggerBuilder().withIdentity(triggerKey).withSchedule(scheduleBuilder).build(); -// -// //参数 -// trigger.getJobDataMap().put(SysJob.JOB_PARAM_KEY, scheduleJob); -// -// scheduler.rescheduleJob(triggerKey, trigger); -// -// //暂停任务 -// if (Constant.SCHEDULER_STATUS_PAUSE.equals(scheduleJob.getStatus())) { -// pauseJob(scheduler, scheduleJob.getId()); -// } -// -// } catch (SchedulerException e) { -// throw new BusinessException("更新定时任务失败"); -// } -// } -// -// /** -// * 立即执行任务 -// */ -// -// public static void run(Scheduler scheduler, SysJob scheduleJob) { -// try { -// //参数 -// JobDataMap dataMap = new JobDataMap(); -// dataMap.put(SysJob.JOB_PARAM_KEY, scheduleJob); -// -// scheduler.triggerJob(getJobKey(scheduleJob.getId()), dataMap); -// } catch (SchedulerException e) { -// throw new BusinessException("立即执行定时任务失败"); -// } -// } -// -// /** -// * 暂停任务 -// */ -// -// public static void pauseJob(Scheduler scheduler, Integer jobId) { -// try { -// scheduler.pauseJob(getJobKey(jobId)); -// } catch (SchedulerException e) { -// throw new BusinessException("暂停定时任务失败"); -// } -// } -// -// /** -// * 恢复任务 -// */ -// -// public static void resumeJob(Scheduler scheduler, Integer jobId) { -// try { -// scheduler.resumeJob(getJobKey(jobId)); -// } catch (SchedulerException e) { -// throw new BusinessException("暂停定时任务失败"); -// } -// } -// -// /** -// * 删除定时任务 -// */ -// -// public static void deleteScheduleJob(Scheduler scheduler, Integer jobId) { -// try { -// scheduler.deleteJob(getJobKey(jobId)); -// } catch (SchedulerException e) { -// throw new BusinessException("删除定时任务失败"); -// } -// } -//} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ApplicantMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ApplicantMapper.java deleted file mode 100644 index 45c6769..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ApplicantMapper.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.huoran.occupationlab.mapper; - - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.huoran.occupationlab.entity.Applicant; -import com.huoran.common.entity.School; -import com.huoran.occupationlab.entity.excel.ExcelData; -import com.huoran.occupationlab.entity.req.PageRegistrationStaffReq; -import com.huoran.occupationlab.entity.vo.ApplicantVO; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.HashMap; -import java.util.List; - -/** - *

- * 报名人员表 Mapper 接口 - *

- * - * @author chen - * @since 2020-10-15 - */ -@Mapper -public interface ApplicantMapper extends BaseMapper { - - IPage selectApplicantByCondition(Page page, @Param("req") PageRegistrationStaffReq req); - - int selectApplicantCountByCondition(HashMap map); - - /** - * 批量禁用数据 - * - * @param ids ids - * @return 返回禁用条数 - */ - int disableByIds(List ids); - - /** - * 批量查询数据 - * - * @param ids ids - * @return 返回生成的数据 - */ - List selectBatchData(List ids); - - School getSchool( @Param("schoolId") Integer schoolId); - - - boolean cancelRegistration( @Param("contestId")String contestId, @Param("accountId")Integer accountId); - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ArchitectureMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ArchitectureMapper.java deleted file mode 100644 index 229d37d..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ArchitectureMapper.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.huoran.occupationlab.entity.Architecture; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; - -import java.util.List; - -/** - *

- * 学生组织架构 Mapper 接口 - *

- * - * @author lr - * @since 2021-08-24 - */ -@Mapper -public interface ArchitectureMapper extends BaseMapper { //新增专业年级班级 - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ArticleMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ArticleMapper.java deleted file mode 100644 index f711033..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ArticleMapper.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.huoran.occupationlab.entity.Article; -import org.apache.ibatis.annotations.Mapper; - -/** - * 文章表 Mapper 接口 - * - * @author chen - * @since 2020-10-15 - */ -@Mapper -public interface ArticleMapper extends BaseMapper
{ - - Integer selectMaxSort(); - - void updateViewNum(String articleId); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/AssessmentExamMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/AssessmentExamMapper.java deleted file mode 100644 index adbe5e5..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/AssessmentExamMapper.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.huoran.occupationlab.entity.AssessmentExam; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; - -/** - *

- * 学生考试表(考核) Mapper 接口 - *

- * - * @author lr - * @since 2021-08-19 - */ -@Mapper -public interface AssessmentExamMapper extends BaseMapper { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/AssessmentMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/AssessmentMapper.java deleted file mode 100644 index a67f0a3..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/AssessmentMapper.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.huoran.occupationlab.entity.Assessment; -import com.huoran.occupationlab.entity.resp.EnterExamResp; -import com.huoran.occupationlab.entity.resp.StuAssessmentListResp; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; -import java.util.Map; - -/** - *

- * 考核管理 Mapper 接口 - *

- * - * @author lr - * @since 2021-08-18 - */ -@Mapper -public interface AssessmentMapper extends BaseMapper { - - List pageByCondition(@Param("params") Map params); - - List pageByConditionNum(@Param("params") Map params); - - List pageStuAssessment(@Param("params") Map params); - - List pageStuAssessmentNum(@Param("params") Map params); - - String getMineClass(Integer accountId); - - List myClassByStudent(@Param("accountId") Integer accountId,@Param("schoolId") Integer schoolId); - - //进入考核获取跳转路径 - EnterExamResp getUrl(Integer id); - - - String spliceClass(Integer assessmentId); - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/CityMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/CityMapper.java deleted file mode 100644 index 9025460..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/CityMapper.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.huoran.occupationlab.entity.City; -import org.apache.ibatis.annotations.Mapper; - -/** - *

- * 城市 Mapper 接口 - *

- * - * @author Ning - * @since 2020-10-27 - */ -@Mapper -public interface CityMapper extends BaseMapper { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ClassMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ClassMapper.java deleted file mode 100644 index a0e40a5..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ClassMapper.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.huoran.occupationlab.entity.Class; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - *

- * 班级表 Mapper 接口 - *

- * - * @author lr - * @since 2021-08-18 - */ -@Mapper -public interface ClassMapper extends BaseMapper { - List getClassesUnderTheSchool(@Param("schoolId") Integer schoolId); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ClientManagementMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ClientManagementMapper.java deleted file mode 100644 index 0a7e76b..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ClientManagementMapper.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.huoran.occupationlab.entity.ClientManagement; -import org.apache.ibatis.annotations.Mapper; - -import java.util.HashMap; -import java.util.List; - -/** - *

- * 企业端客户管理 Mapper 接口 - *

- * - * @author Ning - * @since 2020-10-27 - */ -@Mapper -public interface ClientManagementMapper extends BaseMapper { - - List queryList(HashMap map); - - int deleteUser(Integer clientId); - - int deleteStaff(Integer clientId); - - int deleteStudent(Integer clientId); - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ColumnMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ColumnMapper.java deleted file mode 100644 index 2c9d2ca..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ColumnMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.huoran.occupationlab.entity.Column; -import org.apache.ibatis.annotations.Mapper; - -import java.util.List; - -/** - * 栏目表 Mapper 接口 - * - * @author chen - * @since 2020-10-15 - */ -@Mapper -public interface ColumnMapper extends BaseMapper { - //查询一级最大排序号 - Integer selectFirstMaxSort(); - - //查询二级最大排序号 - Integer selectSecondMaxSort(Integer firstColumn,Integer schoolId); - - List selectIdByPid(String columnId); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ContestAnnexMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ContestAnnexMapper.java deleted file mode 100644 index ed66eaf..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ContestAnnexMapper.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.huoran.occupationlab.entity.ContestAnnex; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -/** - *

- * 赛事附件 Mapper 接口 - *

- * - * @author lr - * @since 2022-06-16 - */ -public interface ContestAnnexMapper extends BaseMapper { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ContestAnnouncementAnnexMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ContestAnnouncementAnnexMapper.java deleted file mode 100644 index 53180fc..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ContestAnnouncementAnnexMapper.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.huoran.occupationlab.entity.ContestAnnouncementAnnex; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -/** - *

- * 大赛公告附件存储 Mapper 接口 - *

- * - * @author lr - * @since 2022-06-17 - */ -public interface ContestAnnouncementAnnexMapper extends BaseMapper { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ContestAnnouncementMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ContestAnnouncementMapper.java deleted file mode 100644 index 0d670c9..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ContestAnnouncementMapper.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.huoran.occupationlab.entity.ContestAnnouncement; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.huoran.occupationlab.entity.req.PageContestListReq; -import com.huoran.occupationlab.entity.vo.ContestVO; -import org.apache.ibatis.annotations.Param; - -/** - *

- * 赛事公告 Mapper 接口 - *

- * - * @author lr - * @since 2022-06-17 - */ -public interface ContestAnnouncementMapper extends BaseMapper { - //根据大赛查询大赛公告 - IPage queryAnnouncementByContestId(Page page,@Param("contestId") String contestId); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ContestMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ContestMapper.java deleted file mode 100644 index 73a75e4..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ContestMapper.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.huoran.occupationlab.mapper; - - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.huoran.occupationlab.entity.Contest; -import com.huoran.occupationlab.entity.req.AfterLoginPageContestListReq; -import com.huoran.occupationlab.entity.req.PageContestListReq; -import com.huoran.occupationlab.entity.vo.ContestVO; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.HashMap; -import java.util.List; - -/** - *

- * 竞赛管理表 Mapper 接口 - *

- * - * @author chen - * @since 2020-10-15 - */ -@Mapper -public interface ContestMapper extends BaseMapper { - - List selectContestByCondition(HashMap map); - - int selectContestCountByCondition(HashMap map); - - IPage contestPageConditionQueryByNakadai(Page page, @Param("req") PageContestListReq req); - - - IPage contestPageConditionQueryByOccupationlab(Page page, @Param("req") PageContestListReq req); - -// IPage onlineCompetitionByStudent(Page page, @Param("req") PageContestListReq req); - - - - - IPage registeredBySchoolAndAllPlatforms(Page page, @Param("req") AfterLoginPageContestListReq req); - - - IPage registeredBySpecifiedRange(Page page, @Param("req") AfterLoginPageContestListReq req); - - IPage allContestsByStu(Page page, @Param("req") PageContestListReq req); - - IPage designatedRangeCompetitionByStu(Page page, @Param("req") PageContestListReq req); - - //本校赛事 - IPage schoolCompetition(Page page, @Param("req") AfterLoginPageContestListReq req); - - //赛事广场 - IPage tournamentSquare(Page page, @Param("req") AfterLoginPageContestListReq req); - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ContestProgressMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ContestProgressMapper.java deleted file mode 100644 index 874a1fe..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ContestProgressMapper.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.huoran.occupationlab.entity.ContestProgress; -import org.apache.ibatis.annotations.Mapper; - -/** - *

- * 竞赛进展表 Mapper 接口 - *

- * - * @author chen - * @since 2020-10-15 - */ -@Mapper -public interface ContestProgressMapper extends BaseMapper { - String getSchoolNameById(Integer schoolId); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ContestRangeMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ContestRangeMapper.java deleted file mode 100644 index 23f5d07..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ContestRangeMapper.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.huoran.occupationlab.entity.ContestRange; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.huoran.occupationlab.entity.resp.ContestRangeResp; -import io.swagger.models.auth.In; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - *

- * Mapper 接口 - *

- * - * @author lr - * @since 2022-06-16 - */ -public interface ContestRangeMapper extends BaseMapper { - List getRangeByContestId(@Param("contestId")String contestId); - - /* List getRangeDetailByContestId(@Param("contestId")String contestId, - @Param("type") Integer type, - @Param("provinceId")Integer provinceId, - @Param("cityId") Integer cityId, - @Param("schoolId") Integer schoolId);*/ -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/CourseChapterMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/CourseChapterMapper.java deleted file mode 100644 index 9b3f59f..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/CourseChapterMapper.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.huoran.occupationlab.entity.CourseChapter; - -/** - * 课程章节 Mapper 接口 - * @author chen - * @since 2020-09-30 - */ -public interface CourseChapterMapper extends BaseMapper { - - Integer selectMaxSort(); - - Integer selectMinSort(); - - /** - * 查询上一章节 - * @param currentChapterId 当前章节id - * @return 上一章节id - */ - String selectPreviousChapter(String currentChapterId); - - /** - * 查询下一章节 - * @param currentChapterId 当前章节id - * @return 下一章节id - */ - String selectNextChapter(String currentChapterId); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/CourseClassificationMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/CourseClassificationMapper.java deleted file mode 100644 index d7bbf87..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/CourseClassificationMapper.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.huoran.occupationlab.entity.EduCourseClassification; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 课程类别 Mapper 接口 - * - * @author chen - * @since 2020-09-30 - */ -public interface CourseClassificationMapper extends BaseMapper { - - List selectGlClassification(String schoolId); - - List checkReapt(EduCourseClassification classification); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/CourseMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/CourseMapper.java deleted file mode 100644 index afc87e6..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/CourseMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.huoran.occupationlab.mapper; - - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.huoran.occupationlab.entity.Course; -import com.huoran.occupationlab.entity.EduCourse; -import com.huoran.occupationlab.entity.vo.CourseVO; - -import java.util.HashMap; -import java.util.List; - -/** - * 课程基本信息 Mapper 接口 - * - * @author chen - * @since 2020-09-30 - */ -public interface CourseMapper extends BaseMapper { - - List selectCourseByCondition(HashMap map); - - int selectCourseCountByCondition(HashMap map); - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/CourseSubsectionMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/CourseSubsectionMapper.java deleted file mode 100644 index c49ab88..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/CourseSubsectionMapper.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.huoran.occupationlab.entity.CourseSubsection; - -/** - * 课程小节 Mapper 接口 - * - * @author chen - * @since 2020-09-30 - */ -public interface CourseSubsectionMapper extends BaseMapper { - - Integer selectMaxSort(); - - Integer selectMinSort(); - - /** - * 查询上一小节 - * - * @param currentSubsectionId 当前小节id - * @return 上一小节id - */ - String selectPreviousSubsection(String currentSubsectionId); - - /** - * 查询下一小节 - * - * @param currentSubsectionId 当前小节id - * @return 下一小节id - */ - String selectNextSubsection(String currentSubsectionId); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/EntrepreneurialActivityAnnouncementAnnexMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/EntrepreneurialActivityAnnouncementAnnexMapper.java deleted file mode 100644 index 606d2d5..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/EntrepreneurialActivityAnnouncementAnnexMapper.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.huoran.occupationlab.entity.EntrepreneurialActivityAnnouncementAnnex; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -/** - *

- * 活动公告附件表 Mapper 接口 - *

- * - * @author lr - * @since 2023-05-12 - */ -public interface EntrepreneurialActivityAnnouncementAnnexMapper extends BaseMapper { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/EntrepreneurialActivityAnnouncementMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/EntrepreneurialActivityAnnouncementMapper.java deleted file mode 100644 index 8387204..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/EntrepreneurialActivityAnnouncementMapper.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.huoran.occupationlab.entity.EntrepreneurialActivityAnnouncement; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; - -/** - *

- * 活动公告表 Mapper 接口 - *

- * - * @author lr - * @since 2023-05-12 - */ -public interface EntrepreneurialActivityAnnouncementMapper extends BaseMapper { - IPage queryAnnouncementByActivityId(Page page, @Param("activityId") String activityId); - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/EntrepreneurialActivityApplicantMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/EntrepreneurialActivityApplicantMapper.java deleted file mode 100644 index bcec554..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/EntrepreneurialActivityApplicantMapper.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.huoran.occupationlab.entity.EntrepreneurialActivityApplicant; -import com.huoran.occupationlab.entity.req.ActivityApplicantReq; -import com.huoran.occupationlab.entity.vo.RegistrationVO; -import org.apache.ibatis.annotations.Param; - -/** - *

- * 创业活动报名人员表 Mapper 接口 - *

- * - * @author lr - * @since 2023-04-27 - */ -public interface EntrepreneurialActivityApplicantMapper extends BaseMapper { - IPage selectRegistration(Page page, @Param("req") ActivityApplicantReq req); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/EntrepreneurialActivityCollectMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/EntrepreneurialActivityCollectMapper.java deleted file mode 100644 index 9141b8e..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/EntrepreneurialActivityCollectMapper.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.huoran.occupationlab.entity.EntrepreneurialActivityCollect; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; - -/** - *

- * 理论课程收藏表 Mapper 接口 - *

- * - * @author lr - * @since 2023-06-01 - */ -public interface EntrepreneurialActivityCollectMapper extends BaseMapper { - Integer countTheNumberOfCollectors(@Param("activityId") Integer activityId); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/EntrepreneurialActivityFileMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/EntrepreneurialActivityFileMapper.java deleted file mode 100644 index df70b4f..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/EntrepreneurialActivityFileMapper.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.huoran.occupationlab.entity.EntrepreneurialActivityFile; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -/** - *

- * 创业活动附件存储 Mapper 接口 - *

- * - * @author lr - * @since 2023-04-26 - */ -public interface EntrepreneurialActivityFileMapper extends BaseMapper { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/EntrepreneurialActivityMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/EntrepreneurialActivityMapper.java deleted file mode 100644 index 067ff5b..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/EntrepreneurialActivityMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.huoran.occupationlab.entity.EntrepreneurialActivity; -import com.huoran.occupationlab.entity.req.EntrepreneurshipActivityListrReq; -import com.huoran.occupationlab.entity.vo.EntrepreneurialActivityVO; -import org.apache.ibatis.annotations.Param; - -/** - *

- * 创业活动管理表 Mapper 接口 - *

- * - * @author lr - * @since 2023-04-26 - */ -public interface EntrepreneurialActivityMapper extends BaseMapper { - - - //给超管看的活动列表 能看到全校发布的 - IPage theOverpipeOfTheActivityList(Page page, @Param("req") EntrepreneurshipActivityListrReq req); - - //教师端发布的 - IPage activityListForTeachers(Page page, @Param("req") EntrepreneurshipActivityListrReq req); - - IPage activityListForStudents(Page page, @Param("req") EntrepreneurshipActivityListrReq req); - - - IPage schoolActivities(Page page, @Param("req") EntrepreneurshipActivityListrReq req); - - IPage myActivities(Page page, @Param("req") EntrepreneurshipActivityListrReq req); - - IPage concernedActivity(Page page, @Param("req") EntrepreneurshipActivityListrReq req); - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/EntrepreneurialActivityProgressMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/EntrepreneurialActivityProgressMapper.java deleted file mode 100644 index 67e3cb1..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/EntrepreneurialActivityProgressMapper.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.huoran.occupationlab.entity.EntrepreneurialActivityProgress; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -/** - *

- * 活动进展表 Mapper 接口 - *

- * - * @author lr - * @since 2023-05-12 - */ -public interface EntrepreneurialActivityProgressMapper extends BaseMapper { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/EvaluationFractionMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/EvaluationFractionMapper.java deleted file mode 100644 index ecaf278..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/EvaluationFractionMapper.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.huoran.occupationlab.entity.EvaluationFraction; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -/** - *

- * 记录用户能力测评的总分数 Mapper 接口 - *

- * - * @author lr - * @since 2021-09-26 - */ -public interface EvaluationFractionMapper extends BaseMapper { - Integer queryExerciseRecord(@Param("accountId") Integer accountId); - - Integer queryTeachingRecord(@Param("accountId") Integer accountId); - - Integer queryScore(@Param("accountId") Integer accountId, @Param("type") Integer type); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/EvaluationQuestionMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/EvaluationQuestionMapper.java deleted file mode 100644 index feaa0d7..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/EvaluationQuestionMapper.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.huoran.occupationlab.entity.EvaluationQuestion; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.huoran.occupationlab.entity.vo.EvaluationDetailVO; -import com.huoran.occupationlab.entity.vo.EvaluationQuestionVO; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - *

- * 测评试题表,记录每次测评的试题,与测评记录表相关联 Mapper 接口 - *

- * - * @author lr - * @since 2021-09-26 - */ -public interface EvaluationQuestionMapper extends BaseMapper { - EvaluationQuestionVO selectByInfo(@Param("evaluationRecordId") Integer evaluationRecordId, - @Param("questionSortNo") Integer questionSortNo); - - int sumScore(@Param("evaluationRecordId") Integer evaluationRecordId); - - List sumScoreListByUserId(@Param("userId") Integer accountId); - - List selectDetailByInfo(@Param("evaluationRecordId") Integer evaluationRecordId); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/EvaluationRecordMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/EvaluationRecordMapper.java deleted file mode 100644 index 788bf96..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/EvaluationRecordMapper.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.huoran.occupationlab.entity.EvaluationRecord; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.huoran.occupationlab.entity.vo.TMSEvaluationRecordVO; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -/** - *

- * 记录用户测评信息 Mapper 接口 - *

- * - * @author lr - * @since 2021-09-26 - */ -public interface EvaluationRecordMapper extends BaseMapper { - - TMSEvaluationRecordVO selectVOByInfo(@Param("evaluationRecordId") Integer evaluationRecordId, - @Param("questionSortNo") Integer questionSortNo); - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/EvaluationRulesMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/EvaluationRulesMapper.java deleted file mode 100644 index b8b9e2e..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/EvaluationRulesMapper.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.huoran.occupationlab.entity.EvaluationRules; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; - -/** - *

- * 测评规则信息记录,只记录一条信息 Mapper 接口 - *

- * - * @author lr - * @since 2021-08-12 - */ -public interface EvaluationRulesMapper extends BaseMapper { -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ExperimentalReportMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ExperimentalReportMapper.java deleted file mode 100644 index 41fbc30..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ExperimentalReportMapper.java +++ /dev/null @@ -1,182 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.huoran.common.entity.ExperimentalReport; -import com.huoran.common.entity.LcRuleRecord; -import com.huoran.occupationlab.entity.req.PageAchievementByStuReq; -import com.huoran.occupationlab.entity.req.PageAchievementByTeacherReq; -import com.huoran.occupationlab.entity.req.PerformanceUnderProductReq; -import com.huoran.occupationlab.entity.resp.*; -import com.huoran.occupationlab.entity.vo.ActivityDerivationVO; -import com.huoran.occupationlab.entity.vo.PerformanceManagementPracticeActivityVO; -import com.huoran.occupationlab.entity.vo.PracticeTheHighestScoreListVO; -import com.huoran.occupationlab.entity.vo.ProductClassInformationVO; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.HashMap; -import java.util.List; - -/** - *

- * 存储各子系统的实验报告 Mapper 接口 - *

- * - * @author lr - * @since 2021-09-08 - */ -@Mapper -public interface ExperimentalReportMapper extends BaseMapper { - - ExperimentOverviewResp getExperimentOverview(Integer accountId); - - IPage queryAssessmentByStudent(Page page, @Param("pageReq") PageAchievementByStuReq pageReq); - - IPage queryPracticeByStudent(Page page, @Param("pageReq") PageAchievementByStuReq pageReq); - - List getPracticeForTeacher(@Param("req") PageAchievementByTeacherReq req); - - List getPracticeForTeacherNum(@Param("req") PageAchievementByTeacherReq req); - - IPage getAssessmentForTeacher(Page page, @Param("req") PageAchievementByTeacherReq req); - - IPage getPracticeDetail(Page page, @Param("projectId") Integer projectId, - @Param("schoolId") Integer schoolId, @Param("classId") Integer classId, @Param("keyWord") String keyWord,@Param("mallId")Integer mallId); - - List exportPracticeInfo(@Param("ids") String ids, @Param("schoolId") Integer schoolId, @Param("projectId") Integer projectId,@Param("mallId")Integer mallId); - - List exportAssessmentInfo(@Param("ids") String ids, @Param("schoolId") Integer schoolId, @Param("assessmentId") Integer assessmentId, @Param("classId") Integer classId); - - IPage getAssessmentDetail(Page page, @Param("assessmentId") Integer assessmentId, @Param("classId") Integer classId,@Param("keyword")String keyword); - - FractionalSegmentResp getFractionalSegmentByPractice(@Param("projectId") Integer projectId, @Param("schoolId") Integer schoolId, @Param("classId") Integer classId,@Param("mallId")Integer mallId); - - FractionalSegmentResp getFractionalSegmentByAssessment(@Param("assessmentId") Integer assessmentId, @Param("classId") Integer classId); - - FractionalSegmentResp getAvgScoreAndPeopleByPractice(@Param("projectId") Integer projectId, @Param("schoolId") Integer schoolId, @Param("classId") Integer classId,@Param("mallId")Integer mallId); - - Integer countTheTotalNumberOfExercisers(@Param("projectId") Integer projectId, @Param("schoolId") Integer schoolId, @Param("classId") Integer classId,@Param("mallId")Integer mallId); - - FractionalSegmentResp getAvgScoreAndPeopleByAssessment(@Param("assessmentId") Integer assessmentId, @Param("classId") Integer classId); - - List exportAssessmentByStudent(@Param("ids") String ids, @Param("accountId") Integer accountId, @Param("curriculumId") Integer curriculumId); - - List exportPracticeByStudent(@Param("curriculumId") Integer curriculumId, @Param("accountId") Integer accountId); - - IPage practiceByStudentDetail(Page page, @Param("curriculumId") Integer curriculumId, @Param("projectId") Integer projectId, @Param("accountId") Integer accountId); - - List exportPracticeByStudentDetail(@Param("reportIds") String reportIds, @Param("projectId") Integer projectId, @Param("accountId") Integer accountId); - - HashMap queryUserInfo(Integer accountId); - - String selectTeacherName(Integer assessmentId); - - List getTheMostUsedCoursesInOurSchool(@Param("schoolId") Integer schoolId); - - IPage academicLeadersRanking(Page page, Integer schoolId); - - - ExamStatisticsResp examStatistics(@Param("schoolId") Integer schoolId, @Param("choose") Integer choose);//平台考试数据统计 - - - StudentPerformanceAnalysisResp studentGradeDistribution(@Param("schoolId") Integer schoolId, @Param("startTime") String startTime, @Param("endTime") String endTime); - - List studentAssessSchievement(@Param("schoolId") Integer schoolId, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("idlist") List idlist); - - OverviewOfStudentExperimentDataResp overviewOfOurSchoolData(@Param("schoolId") Integer schoolId); - - List getLcRuleRecord(@Param("answer") String answer); - - List getStRuleRecord(@Param("answer") String answer); - - List activityRanking(@Param("schoolId") Integer schoolId); - - List schoolActivityRanking(); - - ReturnActiveRankingResp classPracticeTimes(@Param("schoolId") Integer schoolId, @Param("classId") Integer classId); - - - //成绩管理——获取项目下的判分点信息 - List getPointInformationForProject(@Param("projectId") Integer projectId, @Param("schoolId") Integer schoolId); - - - Integer countError(@Param("projectId") Integer projectId, @Param("schoolId") Integer schoolId, @Param("pointId") Integer pointId); - - List errorRateAnalysis(@Param("projectId") Integer projectId, @Param("schoolId") Integer schoolId, @Param("classId") Integer classId, @Param("mallId") Integer mallId); - - List errorRateAnalysisForAssessment(@Param("projectId") Integer projectId, @Param("schoolId") Integer schoolId - , @Param("assessmentId") Integer assessmentId, @Param("classId") Integer classId); - - List errorRateAnalysisForAssessmentByLc(@Param("projectId") Integer projectId, @Param("schoolId") Integer schoolId - , @Param("assessmentId") Integer assessmentId); - - - IPage practiceActivity(Page page, - @Param("projectId") Integer projectId, @Param("schoolId") Integer schoolId, - @Param("classId") Integer classId, @Param("keyWord") String keyWord, @Param("mallId")Integer mallId); - - - IPage exportAllData(Page page, @Param("projectId") Integer projectId, @Param("schoolId") Integer schoolId, @Param("mallId")Integer mallId); - - - IPage maximumPracticeScoreList(Page page, @Param("projectId") Integer projectId, - @Param("schoolId") Integer schoolId, - @Param("mallId")Integer mallId); - - - Integer selectSystemType(@Param("systemId") Integer systemId); - - List errorRateAnalysisByLc(@Param("projectId") Integer projectId, - @Param("schoolId") Integer schoolId, - @Param("classId") Integer classId, - @Param("mallId") Integer mallId); - - - List getProduct(@Param("schoolId") Integer schoolId); - - - //产品下练习板块数据 - PerformanceUnderProductResp practicePlateDataUnderProduct(@Param("req") PerformanceUnderProductReq req); - - //产品下考核板块数据 - PerformanceUnderProductResp assessPlateDataUnderProduct(@Param("req") PerformanceUnderProductReq req); - - - - //产品下练习阶段分数数据 - FractionalSegmentResp productPracticeStageScoreData(@Param("req") PerformanceUnderProductReq req); - - - //产品下项目错误率分析 - List projectErrorRateAnalysisUnderProduct(@Param("req") PerformanceUnderProductReq req); - - - //产品下项目成绩列表 - IPage listOfProjectResultsUnderTheProduct(Page page,@Param("req") PerformanceUnderProductReq req); - - - //用户练习成绩详情 - IPage userPracticeScoreDetails(Page page,@Param("req") PerformanceUnderProductReq req); - - //用户考核成绩详情 - IPage userAssessScoreDetails(Page page,@Param("req") PerformanceUnderProductReq req); - - - //产品下考核成绩列表 - IPage listOfAssessmentResultsUnderTheProduct(Page page,@Param("req") PerformanceUnderProductReq req); - - - - List testErrorRateUnderProduct(@Param("req") PerformanceUnderProductReq req); - - //实验报告数据处理:将原来未绑定产品的实验报告补上 - List experimentalReportDataProcessing(); - - - String getItemOptions(@Param("itemId")String ruleAnswer); - - String getStItemOptions(@Param("itemId")String ruleAnswer); - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/PermissionMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/PermissionMapper.java deleted file mode 100644 index 410139c..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/PermissionMapper.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.huoran.occupationlab.mapper; - - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.huoran.occupationlab.entity.AclPermission; - -import java.util.List; - -/** - * 权限 Mapper 接口 - */ -public interface PermissionMapper extends BaseMapper { - - List selectPermissionValueByUserId(String id); - - List selectAllPermissionValue(); - - List selectPermissionByUserId(String userId); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/PlayRecordMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/PlayRecordMapper.java deleted file mode 100644 index 8af3196..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/PlayRecordMapper.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.huoran.occupationlab.entity.PlayRecord; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.huoran.occupationlab.entity.req.StudentPerformanceAnalysisReq; -import com.huoran.occupationlab.entity.resp.MonthlyOnlineStudyHoursResp; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - *

- * 资源播放记录表 Mapper 接口 - *

- * - * @author lr - * @since 2022-09-09 - */ -@Mapper -public interface PlayRecordMapper extends BaseMapper { - MonthlyOnlineStudyHoursResp monthlyAverageOnlineTime(@Param("schoolId") Integer schoolId, @Param("startTime") String startTime, @Param("endTime") String endTime); - - List courseRankings(@Param("schoolId")Integer schoolId); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ProjectHiddenMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ProjectHiddenMapper.java deleted file mode 100644 index 196d904..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ProjectHiddenMapper.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.huoran.occupationlab.entity.ProjectHidden; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; - -/** - *

- * 此表是在教师端成绩管理,虚仿以及教学列表展示中使用到 Mapper 接口 - *

- * - * @author lr - * @since 2021-09-23 - */ -@Mapper -public interface ProjectHiddenMapper extends BaseMapper { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ProjectJudgmentMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ProjectJudgmentMapper.java deleted file mode 100644 index 294da6e..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ProjectJudgmentMapper.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.huoran.occupationlab.entity.ProjectJudgment; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; - -/** - *

- * 项目管理判分点绑定表 Mapper 接口 - *

- * - * @author Mr.JK - * @since 2021-08-26 - */ -@Mapper -public interface ProjectJudgmentMapper extends BaseMapper { - - /** - * 迁移数据使用接口 勿用 - * @param pointName - * @param experimentalRequirements - * @return - */ - Integer tempSelectBcId(@Param("pointName") String pointName,@Param("experimentalRequirements") String experimentalRequirements); - - /** - * 更新项目管理中间表 - * @param judgmentId id - * @param judgmentScore 分数 - * @param judgmentSort 排序 - * @return - */ - Integer updateJudgment(Integer judgmentId,Integer judgmentScore,Integer judgmentSort); - - ArrayList selectBcJudgmentIdList(@Param("ids") HashSet ids,@Param("name") String name); - - ArrayList selectLcJudgmentIdList(@Param("ids") HashSet set,@Param("name") String name); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ProjectManageDisableMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ProjectManageDisableMapper.java deleted file mode 100644 index 83fb9bc..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ProjectManageDisableMapper.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.huoran.occupationlab.entity.ProjectManageDisable; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; - -/** - *

- * 记录项目学校端的禁用记录 Mapper 接口 - *

- * - * @author lr - * @since 2022-01-12 - */ -@Mapper -public interface ProjectManageDisableMapper extends BaseMapper { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ProjectManageMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ProjectManageMapper.java deleted file mode 100644 index 61ed49c..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ProjectManageMapper.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.huoran.common.entity.ProjectManage; -import com.huoran.occupationlab.entity.req.ProjectManageReq; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - *

- * 项目管理表 Mapper 接口 - *

- * - * @author Mr.JK - * @since 2021-08-26 - */ -@Mapper -public interface ProjectManageMapper extends BaseMapper { - - /** - * 更新职站是否开启 - * - * @param projectId - * @param isOpen - */ - void updateIsOpenZz(Integer projectId, Integer isOpen); - - /** - * 更新中台是否开启 - * - * @param projectId - * @param isOpen - */ - void updateIsOpenZt(Integer projectId, Integer isOpen); - - /** - * 查询所有订单下的所有课程下的所有项目 - * - * @param schoolId - * @param systemId - * @param permissions - * @return - */ - List selectCurriculumProject(@Param("schoolId") Integer schoolId, @Param("systemId") String systemId, @Param("permissions") Integer permissions, @Param("cId") Integer cId); - - /** - * 发布项目 - * - * @param projectId - */ - void updateState(Integer projectId); - - /** - * @Description : 项目管理列表 - * @Param page - * @Param req - * @Author Rong---2021/11/30 - */ - IPage queryProjectManage(Page page, @Param("req") ProjectManageReq req); - - /** - * @Description : 教师:项目管理列表 - * @Param page - * @Param req - * @Author Rong---2021/12/1 - */ - IPage queryProjectManageByTeacher(Page page, @Param("req") ProjectManageReq req); - - /** - * @Description : 中台:全部项目管理列表 - * @Param page - * @Param req - * @Author Rong---2021/12/6 - */ - IPage queryNakadaiProjectList(Page page, @Param("req") ProjectManageReq req); - - /** - * @Description :职站实验项目管理-全部: - * 1、查询中台全部数据以及学校发布的全部数据 - * 2、查询购买的课程下的项目以及根据角色查询本校内的项目 - *

- * 22.3.9更新后逻辑 - * 1).系统的项目依据课程排序的项目顺序展示 - * 2).老师的依据发布时间展示 在系统项目上面 - * 3).处于草稿的项目置信在最上面。 - * @Param page - * @Param req - * @Author Rong---2021/12/6 - */ - IPage queryOccupationlabProjectList(Page page, @Param("req") ProjectManageReq req); - - /** - * @Description :中台项目管理列表——教师条件 - * @Param page - * @Param req - * @Author Rong---2022/1/12 - */ - IPage nakadaiProjectListByTeacher(Page page, @Param("req") ProjectManageReq req); - - - /** - * 中台项目管理列表——系统条件 - * @param page - * @param req - * @return - */ - IPage nakadaiProjectListBySystem(Page page, @Param("req") ProjectManageReq req); - - Integer selectSystemType(@Param("systemId") Integer systemId); - - List selectProjectList(@Param("systemIds") String systemIds,@Param("permissions") Integer permissions); - - IPage selectProjectAssessmentByCompetition(Page page, @Param("req") ProjectManageReq projectManageReq); - - String selectSystemName(@Param("systemId")Integer systemId); - - - ProjectManage getProjectDetails(@Param("projectId")Integer projectId); - - ProjectManage undeletedAndDeletedItemDetails(@Param("projectId")Integer projectId); - - Integer getCurriculumCountByType(@Param("cid")Integer cid,@Param("permissions")Integer permissions); - - Integer projectCreatedUnderProduct(@Param("mallId")Integer mallId,@Param("permissions")Integer permissions,@Param("schoolId")Integer schoolId); - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ProvinceMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ProvinceMapper.java deleted file mode 100644 index bda39b8..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/ProvinceMapper.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.huoran.occupationlab.entity.Province; -import org.apache.ibatis.annotations.Mapper; - -/** - *

- * 省份表 Mapper 接口 - *

- * - * @author Ning - * @since 2020-10-27 - */ -@Mapper -public interface ProvinceMapper extends BaseMapper { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/PythonFileDataMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/PythonFileDataMapper.java deleted file mode 100644 index a1e8f6e..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/PythonFileDataMapper.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.huoran.occupationlab.entity.PythonFileData; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; - -/** - *

- * Mapper 接口 - *

- * - * @author lr - * @since 2022-04-06 - */ -public interface PythonFileDataMapper extends BaseMapper { - //新增前统计 - Double statistics(@Param("accountId") Integer accountId, @Param("schoolId") Integer schoolId); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/PythonRunCodeMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/PythonRunCodeMapper.java deleted file mode 100644 index d7b59ca..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/PythonRunCodeMapper.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.huoran.occupationlab.entity.PythonRunCode; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import io.lettuce.core.dynamic.annotation.Param; -import org.apache.ibatis.annotations.Mapper; - -/** - *

- * python储存实验运行记录 Mapper 接口 - *

- * - * @author lr - * @since 2021-12-22 - */ -@Mapper -public interface PythonRunCodeMapper extends BaseMapper { - String getRunCode(PythonRunCode code); - - String getRunPhotoUrlString(@Param("reportId") Integer reportId,@Param("judgmentPointsId") Integer judgmentPointsId); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/PythonSystemMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/PythonSystemMapper.java deleted file mode 100644 index a6705c5..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/PythonSystemMapper.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.huoran.occupationlab.entity.PythonSystem; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.huoran.occupationlab.entity.vo.AssessmentVO; -import org.apache.ibatis.annotations.Param; -import org.springframework.web.bind.annotation.RequestParam; - -import java.util.List; - -/** - *

- * python系统记录表 Mapper 接口 - *

- * - * @author lr - * @since 2021-08-19 - */ -public interface PythonSystemMapper extends BaseMapper { - List getCourseTitle(@Param("accountId") Integer accountId,@Param("schoolId") Integer schoolId); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/PythonTableDataMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/PythonTableDataMapper.java deleted file mode 100644 index ea23078..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/PythonTableDataMapper.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.huoran.occupationlab.entity.PythonTableData; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -/** - *

- * 储存全部python表数据表导出Excel路径 Mapper 接口 - *

- * - * @author lr - * @since 2022-08-12 - */ -public interface PythonTableDataMapper extends BaseMapper { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/QuestionsMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/QuestionsMapper.java deleted file mode 100644 index 01adf9d..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/QuestionsMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.huoran.occupationlab.entity.EvaluationRules; -import com.huoran.occupationlab.entity.Questions; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - *

- * 测评管理-题库记录表 Mapper 接口 - *

- * - * @author lr - * @since 2021-08-12 - */ -public interface QuestionsMapper extends BaseMapper { - - EvaluationRules queryNumberOfQuestions(@Param("schoolId")Integer schoolId); - - EvaluationRules queryNumberOfTatolQuestions(@Param("schoolId")Integer schoolId); - - Integer queryQuestionNumber(String number,@Param("schoolId")Integer schoolId); - - - Integer countTotalMultipleNum(@Param("schoolId")Integer schoolId); - - Integer countTotalJudgmentNum(@Param("schoolId")Integer schoolId); - - Integer countTotalMultiplenum(@Param("schoolId")Integer schoolId); - - Integer countTotalJudgmentnum(@Param("schoolId")Integer schoolId); - - - List selectIds(@Param("questionType") String questionType,@Param("schoolId")Integer schoolId); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/RoleMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/RoleMapper.java deleted file mode 100644 index b9a5a06..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/RoleMapper.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.huoran.occupationlab.entity.AclRole; - -/** - * 角色 Mapper 接口 - */ -public interface RoleMapper extends BaseMapper { - - int removeRolePermission(String roleId); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/RolePermissionMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/RolePermissionMapper.java deleted file mode 100644 index f5c051f..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/RolePermissionMapper.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.huoran.occupationlab.entity.AclRolePermission; - -/** - * 角色权限 Mapper 接口 - */ -public interface RolePermissionMapper extends BaseMapper { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/SchoolClassificationMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/SchoolClassificationMapper.java deleted file mode 100644 index 8532105..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/SchoolClassificationMapper.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.huoran.occupationlab.entity.SchoolClassification; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -/** - *

- * 学校对应分类表 Mapper 接口 - *

- * - * @author lr - * @since 2021-09-09 - */ -public interface SchoolClassificationMapper extends BaseMapper { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/SchoolCourseMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/SchoolCourseMapper.java deleted file mode 100644 index 02b49fe..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/SchoolCourseMapper.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.huoran.occupationlab.entity.SchoolCourse; -import com.huoran.occupationlab.entity.vo.CourseVO; -import org.apache.ibatis.annotations.Param; - -import java.util.HashMap; -import java.util.List; - -/** - *

- * 学校内置课程表 Mapper 接口 - *

- * - * @author Cheney - * @since 2020-11-30 - */ -public interface SchoolCourseMapper extends BaseMapper { - - List selectCoursePageByCondition(HashMap map); - - int coursePageConditionCount(HashMap map); - - List builtInCoursePageQuery(HashMap map); - - int builtInCoursePageCount(HashMap map); - - int builtInCourseClassificationCount(@Param("schoolId")String schoolId, @Param("classificationId")String classificationId); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/SchoolMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/SchoolMapper.java deleted file mode 100644 index 3731e6d..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/SchoolMapper.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.huoran.common.entity.School; -import org.apache.ibatis.annotations.Mapper; - -/** - *

- * 学校表 Mapper 接口 - *

- * - * @author Ning - * @since 2020-10-27 - */ -@Mapper -public interface SchoolMapper extends BaseMapper { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/SchoolProjectHintOpenMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/SchoolProjectHintOpenMapper.java deleted file mode 100644 index 0b377ca..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/SchoolProjectHintOpenMapper.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.huoran.occupationlab.entity.SchoolProjectHintOpen; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; - -/** - *

- * 学校项目实验提示管理表 Mapper 接口 - *

- * - * @author lr - * @since 2023-06-02 - */ -@Mapper -public interface SchoolProjectHintOpenMapper extends BaseMapper { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/StaffGradeMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/StaffGradeMapper.java deleted file mode 100644 index f0b5ba0..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/StaffGradeMapper.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.huoran.occupationlab.entity.StaffGrade; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -/** - *

- * 员工年级表 Mapper 接口 - *

- * - * @author lr - * @since 2021-10-13 - */ -public interface StaffGradeMapper extends BaseMapper { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/StaffMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/StaffMapper.java deleted file mode 100644 index 42eb81a..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/StaffMapper.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.huoran.occupationlab.entity.Questions; -import com.huoran.occupationlab.entity.Staff; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.huoran.occupationlab.entity.req.PageStaffListReq; -import com.huoran.occupationlab.entity.req.QuestionsQueryReq; -import com.huoran.occupationlab.entity.resp.AchievementResp; -import com.huoran.occupationlab.entity.resp.StaffResp; -import com.huoran.occupationlab.entity.resp.StaffRoleResp; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - *

- * 员工表 Mapper 接口 - *

- * - * @author lr - * @since 2021-10-13 - */ -public interface StaffMapper extends BaseMapper { - - IPage staffList(Page page, @Param("req") PageStaffListReq req); - - StaffResp staffDetail(@Param("accountId")Integer accountId); - - List getStaffInfoByAccountId(@Param("accountId")Integer accountId); - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/StaffProfessionalArchitectureMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/StaffProfessionalArchitectureMapper.java deleted file mode 100644 index 4e49733..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/StaffProfessionalArchitectureMapper.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.huoran.occupationlab.entity.StaffProfessionalArchitecture; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -/** - *

- * 员工专业组织架构 Mapper 接口 - *

- * - * @author lr - * @since 2021-10-13 - */ -public interface StaffProfessionalArchitectureMapper extends BaseMapper { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/StudentMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/StudentMapper.java deleted file mode 100644 index 270ec8d..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/StudentMapper.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.huoran.common.entity.Student; -import com.huoran.common.entity.UserAccount; -import com.huoran.common.entity.UserInfo; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.huoran.occupationlab.entity.req.AddStudentCheckReq; -import com.huoran.occupationlab.entity.req.EditStudentsReq; -import com.huoran.occupationlab.entity.req.OrganizationStudentReq; -import com.huoran.occupationlab.entity.resp.StudentInfoResp; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; -import java.util.Map; - -/** - *

- * 学生表 Mapper 接口 - *

- * - * @author lr - * @since 2021-08-24 - */ -@Mapper -public interface StudentMapper extends BaseMapper { - StudentInfoResp getStudentInfoDetail(@Param("params") Map params); - //根据学号获取学生详情信息 - StudentInfoResp getStudentInfoDetailByWorkNum(@Param("params") Map params); - - //根据账号id获取用户名 - StudentInfoResp getUerName(Integer accountId); - - //新增用户信息 - Integer addUserInfo(UserInfo userInfo); - - //新增账号信息 - Integer addUserAccount(UserAccount account); - - /** - * 学号(本校内)——————账号(全平台)判重 ——————手机号、邮箱根据平台id判重 - */ - //手机号、邮箱根据平台id判重 - List checkUserInfo(UserInfo userInfo); - - //学号(本校内)——————账号(全平台) - List checkUserAccount(UserAccount userAccount); - - //查询学生列表oc - List studentList(@Param("params") Map params); - - //统计学生列表总数 - Integer studentListNum(@Param("params") Map params); - - //查询职站学生端的用户 - List getOccupationlabStudent(); - - //查询学生信息 - StudentInfoResp getStudentInfoByAccountId(Integer stuAccountId); - - //修改用户信息 - boolean modifyUserInfo(UserInfo userInfo); - - //根据用户id修改账户信息 - boolean modifyUserAccountByUserId(@Param("u") EditStudentsReq userInfo); - - //修改账户信息 - boolean modifyUserAccount(UserAccount userAccount); - - //组织架构筛选学生 - List organizationalStudentList(@Param("req") OrganizationStudentReq req); - - //统计组织架构筛选学生 - Integer organizationalStudentListNum(@Param("req") OrganizationStudentReq req); - - Integer updateAccountEnable(@Param("id") Integer id, @Param("isEnable") Integer isEnable); - - //根据账号id拿到用户id - Integer getUserId(Integer accountId); - - //根据学校id、用户姓名、学生账号、学号平台、端口查询 - StudentInfoResp isExistUserInfo(@Param("req") AddStudentCheckReq req); - - //学号(本校内)——————账号(全平台) - UserAccount checkAccountOrWorkNum(UserAccount userAccount); - - //连表根据账号学号姓名学校查询用户信息 - StudentInfoResp getUserInfo(StudentInfoResp resp); - - Integer countClassSizes(@Param("schoolId")Integer schoolId,@Param("classId")Integer classId); - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/SysJobLogMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/SysJobLogMapper.java deleted file mode 100644 index 77a6f09..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/SysJobLogMapper.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.huoran.occupationlab.entity.SysJobLog; - -/** - * 定时任务日志、 Mapper - * - * @author cheney - * @version V1.0 - * @date 2022年7月28日 - */ -public interface SysJobLogMapper extends BaseMapper { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/SysJobMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/SysJobMapper.java deleted file mode 100644 index 470270b..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/SysJobMapper.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.huoran.occupationlab.entity.SysJob; - -/** - * 定时任务 Mapper - * - * @author cheney - * @version V1.0 - * @date 2022年7月28日 - */ -public interface SysJobMapper extends BaseMapper { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/SysLogMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/SysLogMapper.java deleted file mode 100644 index 3bd906d..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/SysLogMapper.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.huoran.occupationlab.mapper; - - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.huoran.occupationlab.entity.SysLog; -import org.apache.ibatis.annotations.Mapper; - -/** - * 操作日志 Mapper - * - * @author cheney - * @version V1.0 - * @date 2022年7月28日 - */ -@Mapper -public interface SysLogMapper extends BaseMapper { -} \ No newline at end of file diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/SystemLogoMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/SystemLogoMapper.java deleted file mode 100644 index b970f8b..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/SystemLogoMapper.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.huoran.occupationlab.entity.SystemLogo; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -/** - *

- * 职站教师端-系统logo设置 Mapper 接口 - *

- * - * @author lr - * @since 2021-10-18 - */ -public interface SystemLogoMapper extends BaseMapper { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/TheoreticalCourseChapterMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/TheoreticalCourseChapterMapper.java deleted file mode 100644 index 108107a..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/TheoreticalCourseChapterMapper.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.huoran.occupationlab.entity.TheoreticalCourseChapter; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -/** - *

- * 理论课程章节表 Mapper 接口 - *

- * - * @author lr - * @since 2022-09-22 - */ -public interface TheoreticalCourseChapterMapper extends BaseMapper { - - Integer selectMaxSort(); - - Integer selectMinSort(); - - /** - * 查询上一章节 - * @param currentChapterId 当前章节id - * @return 上一章节id - */ - String selectPreviousChapter(String currentChapterId); - - /** - * 查询下一章节 - * @param currentChapterId 当前章节id - * @return 下一章节id - */ - String selectNextChapter(String currentChapterId); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/TheoreticalCourseClassificationMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/TheoreticalCourseClassificationMapper.java deleted file mode 100644 index 474bad3..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/TheoreticalCourseClassificationMapper.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.TheoreticalCourseClassification; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -import java.util.List; - -/** - *

- * 理论课程分类信息 Mapper 接口 - *

- * - * @author lr - * @since 2022-09-14 - */ -public interface TheoreticalCourseClassificationMapper extends BaseMapper { - List queryAllCategoriesOfSchools(); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/TheoreticalCourseCollectMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/TheoreticalCourseCollectMapper.java deleted file mode 100644 index 545873c..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/TheoreticalCourseCollectMapper.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.huoran.occupationlab.entity.TheoreticalCourseCollect; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -/** - *

- * 理论课程收藏表 Mapper 接口 - *

- * - * @author lr - * @since 2023-04-18 - */ -public interface TheoreticalCourseCollectMapper extends BaseMapper { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/TheoreticalCourseConfigureMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/TheoreticalCourseConfigureMapper.java deleted file mode 100644 index b0d3962..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/TheoreticalCourseConfigureMapper.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.huoran.occupationlab.entity.TheoreticalCourseConfigure; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.huoran.occupationlab.entity.req.PageTheoreticalCourseReq; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - *

- * 理论课程与理论课程分类配置表 Mapper 接口 - *

- * - * @author lr - * @since 2022-09-14 - */ -public interface TheoreticalCourseConfigureMapper extends BaseMapper { - - List getConfigInfoByCourseId(@Param("courseId") Integer courseId, @Param("classificationType") Integer classificationType); - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/TheoreticalCourseMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/TheoreticalCourseMapper.java deleted file mode 100644 index f0254b2..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/TheoreticalCourseMapper.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.huoran.occupationlab.entity.TheoreticalCourse; -import com.huoran.occupationlab.entity.req.PageStudentTheoreticalCourseReq; -import com.huoran.occupationlab.entity.req.PageTheoreticalCourseReq; -import com.huoran.occupationlab.entity.resp.PageTheoreticalCourseByNakadaiResp; -import com.huoran.occupationlab.entity.resp.TheoreticalCourseDetailResp; -import org.apache.ibatis.annotations.Param; - -/** - *

- * 理论课程基本信息 Mapper 接口 - *

- * - * @author lr - * @since 2022-09-14 - */ -public interface TheoreticalCourseMapper extends BaseMapper { - IPage pageConditionalQueryCourseByNakadai(Page page, @Param("req") PageTheoreticalCourseReq req); - - - TheoreticalCourseDetailResp theoryCoursesDetail(@Param("id") Integer id); - - - IPage pageConditionalQueryCourseByStudent(Page page, @Param("req") PageStudentTheoreticalCourseReq req); - - - IPage studentLoginPreCourse(Page page, @Param("req") PageTheoreticalCourseReq req); - - //本校创建的课程 - IPage theoreticalCoursesOfTheSchool(Page page, @Param("req") PageStudentTheoreticalCourseReq req); - - - //本人收藏的课程 - IPage theCurrentUserFavoriteCourse(Page page, @Param("req") PageStudentTheoreticalCourseReq req); - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/TheoreticalCourseRangeMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/TheoreticalCourseRangeMapper.java deleted file mode 100644 index d52fb7e..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/TheoreticalCourseRangeMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.huoran.occupationlab.entity.TheoreticalCourseRange; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.huoran.occupationlab.entity.resp.ContestRangeResp; -import com.huoran.occupationlab.entity.resp.TheoreticalCoursetRangeResp; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - *

- * 理论课程指定范围选择 Mapper 接口 - *

- * - * @author lr - * @since 2022-09-19 - */ -public interface TheoreticalCourseRangeMapper extends BaseMapper { - List getCourseRangeByCourseId(@Param("courseId")Integer courseId); - - List getRangeByCourseId(@Param("courseId")Integer courseId); - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/TheoreticalCourseSubsectionMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/TheoreticalCourseSubsectionMapper.java deleted file mode 100644 index 8c3ef98..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/TheoreticalCourseSubsectionMapper.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.huoran.occupationlab.entity.TheoreticalCourseSubsection; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -/** - *

- * 课程小节 Mapper 接口 - *

- * - * @author lr - * @since 2022-09-22 - */ -public interface TheoreticalCourseSubsectionMapper extends BaseMapper { - - Integer selectMaxSort(); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/UserInfoMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/UserInfoMapper.java deleted file mode 100644 index 3c7e508..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/UserInfoMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.huoran.occupationlab.entity.HrUserInfo; - -import java.util.HashMap; -import java.util.List; - -/** - *

- * 用户信息表 Mapper 接口 - *

- * - * @author Ning - * @since 2020-10-21 - */ -public interface UserInfoMapper extends BaseMapper { - - List queryList(HashMap map); - - HrUserInfo login(HashMap map); - - int updateTime(Integer userId); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/UserManagementMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/UserManagementMapper.java deleted file mode 100644 index d37e5ad..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/UserManagementMapper.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.huoran.occupationlab.entity.UserManagement; -import com.huoran.occupationlab.entity.vo.UserInfo; -import org.apache.ibatis.annotations.Mapper; - -import java.util.HashMap; -import java.util.List; - -/** - *

- * 企业端用户管理 Mapper 接口 - *

- * - * @author Ning - * @since 2020-10-27 - */ -@Mapper -public interface UserManagementMapper extends BaseMapper { - - boolean addUserInfo(UserInfo userInfo); - - List queryList(HashMap map); - - int queryListCount(HashMap map); - - Integer selectUserId(Integer id); - - int deleteUser(Integer userId); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/UserRoleMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/UserRoleMapper.java deleted file mode 100644 index 3c7819b..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/UserRoleMapper.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.huoran.occupationlab.entity.AclUserRole; - -/** - * 用户角色 Mapper 接口 - */ -public interface UserRoleMapper extends BaseMapper { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/UserScoreMapper.java b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/UserScoreMapper.java deleted file mode 100644 index 0157d3f..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/UserScoreMapper.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.huoran.occupationlab.mapper; - -import com.huoran.common.entity.BcJudgmentPoint; -import com.huoran.occupationlab.entity.UserScore; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.web.bind.annotation.PostMapping; - -import java.util.List; - -/** - *

- * 用户分数表 Mapper 接口 - *

- * - * @author Mr.JK - * @since 2021-09-14 - */ -@Mapper -public interface UserScoreMapper extends BaseMapper { - - /** - * 查询判分点名称 - * - * @param judgmentId - * @return - */ - String selectJudgmentNameById(Integer judgmentId); - - /** - * 获取编程类判分名称 - * - * @param bcId - * @return - */ - BcJudgmentPoint selectJudgmentNameByBcId(Integer bcId); - - List selectScoreList(@Param("reportId") Integer reportId); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ApplicantMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ApplicantMapper.xml deleted file mode 100644 index 90b1134..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ApplicantMapper.xml +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - - - - - - - - - - - update ol_applicant set is_disable = 1 where id in - - #{id} - - - - DELETE - FROM ol_applicant - WHERE contest_id = #{contestId} - and account_id = #{accountId} - - - - - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ArchitectureMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ArchitectureMapper.xml deleted file mode 100644 index 40d3ee3..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ArchitectureMapper.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ArticleMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ArticleMapper.xml deleted file mode 100644 index dee1f54..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ArticleMapper.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - update ol_article - set view_count=view_count + 1 - where id = #{articleId} - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/AssessmentExamMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/AssessmentExamMapper.xml deleted file mode 100644 index 72abd66..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/AssessmentExamMapper.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/AssessmentMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/AssessmentMapper.xml deleted file mode 100644 index ba42b5e..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/AssessmentMapper.xml +++ /dev/null @@ -1,614 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/CityMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/CityMapper.xml deleted file mode 100644 index 8d4a8cc..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/CityMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ClassMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ClassMapper.xml deleted file mode 100644 index f47ef7b..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ClassMapper.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ClientManagementMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ClientManagementMapper.xml deleted file mode 100644 index a0c2f08..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ClientManagementMapper.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - delete - from ol_hr_user_info - where clientId = #{clientId} - - - - delete - from ol_staff - where schoolId = #{clientId} - - - delete - from ol_student - where clientId = #{clientId} - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ColumnMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ColumnMapper.xml deleted file mode 100644 index 50ea363..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ColumnMapper.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ContestAnnexMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ContestAnnexMapper.xml deleted file mode 100644 index f77828f..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ContestAnnexMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ContestAnnouncementAnnexMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ContestAnnouncementAnnexMapper.xml deleted file mode 100644 index de4e679..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ContestAnnouncementAnnexMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ContestAnnouncementMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ContestAnnouncementMapper.xml deleted file mode 100644 index c3936cd..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ContestAnnouncementMapper.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ContestMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ContestMapper.xml deleted file mode 100644 index da819b3..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ContestMapper.xml +++ /dev/null @@ -1,489 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ContestProgressMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ContestProgressMapper.xml deleted file mode 100644 index 340bff5..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ContestProgressMapper.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ContestRangeMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ContestRangeMapper.xml deleted file mode 100644 index 47674d0..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ContestRangeMapper.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/CourseChapterMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/CourseChapterMapper.xml deleted file mode 100644 index c913f7d..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/CourseChapterMapper.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/CourseClassificationMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/CourseClassificationMapper.xml deleted file mode 100644 index af055d2..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/CourseClassificationMapper.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/CourseMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/CourseMapper.xml deleted file mode 100644 index ba3be5c..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/CourseMapper.xml +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/CourseSubsectionMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/CourseSubsectionMapper.xml deleted file mode 100644 index 1b2c3ba..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/CourseSubsectionMapper.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/EntrepreneurialActivityAnnouncementAnnexMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/EntrepreneurialActivityAnnouncementAnnexMapper.xml deleted file mode 100644 index 8714939..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/EntrepreneurialActivityAnnouncementAnnexMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/EntrepreneurialActivityAnnouncementMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/EntrepreneurialActivityAnnouncementMapper.xml deleted file mode 100644 index 8e5a734..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/EntrepreneurialActivityAnnouncementMapper.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/EntrepreneurialActivityApplicantMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/EntrepreneurialActivityApplicantMapper.xml deleted file mode 100644 index 8239add..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/EntrepreneurialActivityApplicantMapper.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/EntrepreneurialActivityCollectMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/EntrepreneurialActivityCollectMapper.xml deleted file mode 100644 index 919fe4f..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/EntrepreneurialActivityCollectMapper.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/EntrepreneurialActivityFileMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/EntrepreneurialActivityFileMapper.xml deleted file mode 100644 index 01bff8c..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/EntrepreneurialActivityFileMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/EntrepreneurialActivityMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/EntrepreneurialActivityMapper.xml deleted file mode 100644 index 339bec9..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/EntrepreneurialActivityMapper.xml +++ /dev/null @@ -1,310 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/EntrepreneurialActivityProgressMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/EntrepreneurialActivityProgressMapper.xml deleted file mode 100644 index 6884d81..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/EntrepreneurialActivityProgressMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/EvaluationFractionMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/EvaluationFractionMapper.xml deleted file mode 100644 index 02d7549..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/EvaluationFractionMapper.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/EvaluationQuestionMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/EvaluationQuestionMapper.xml deleted file mode 100644 index dbabd7d..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/EvaluationQuestionMapper.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/EvaluationRecordMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/EvaluationRecordMapper.xml deleted file mode 100644 index ec71490..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/EvaluationRecordMapper.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/EvaluationRulesMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/EvaluationRulesMapper.xml deleted file mode 100644 index 4ed9217..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/EvaluationRulesMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ExperimentalReportMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ExperimentalReportMapper.xml deleted file mode 100644 index d42aa29..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ExperimentalReportMapper.xml +++ /dev/null @@ -1,2520 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/PermissionMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/PermissionMapper.xml deleted file mode 100644 index c3bc5ed..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/PermissionMapper.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - p - . - id - ,p.pid,p.name,p.type,p.permission_value,path,p.component,p.icon,p.status,p.gmt_create,p.gmt_modified - - - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/PlayRecordMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/PlayRecordMapper.xml deleted file mode 100644 index 6e783d1..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/PlayRecordMapper.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ProjectHiddenMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ProjectHiddenMapper.xml deleted file mode 100644 index 4748ebf..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ProjectHiddenMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ProjectJudgmentMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ProjectJudgmentMapper.xml deleted file mode 100644 index f28591d..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ProjectJudgmentMapper.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - update ol_project_judgment set is_del = 0,score = #{judgmentScore},sort = #{judgmentSort} where id = #{judgmentId} - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ProjectManageDisableMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ProjectManageDisableMapper.xml deleted file mode 100644 index 81ae963..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ProjectManageDisableMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ProjectManageMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ProjectManageMapper.xml deleted file mode 100644 index 04a3c82..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ProjectManageMapper.xml +++ /dev/null @@ -1,569 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - update ol_project_manage - set is_open = #{isOpen} - where project_id = #{projectId} - - - - update ol_project_manage - set zt_open = #{isOpen} - where project_id = #{projectId} - - - - update ol_project_manage - set state = 1 - where project_id = #{projectId} - - - - - - - - - - - - - - - - - - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ProvinceMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ProvinceMapper.xml deleted file mode 100644 index 6de839d..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ProvinceMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/PythonFileDataMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/PythonFileDataMapper.xml deleted file mode 100644 index d303a28..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/PythonFileDataMapper.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/PythonRunCodeMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/PythonRunCodeMapper.xml deleted file mode 100644 index 3a7010a..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/PythonRunCodeMapper.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/PythonSystemMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/PythonSystemMapper.xml deleted file mode 100644 index 676fa35..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/PythonSystemMapper.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/PythonTableDataMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/PythonTableDataMapper.xml deleted file mode 100644 index c1b0e87..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/PythonTableDataMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/QuestionsMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/QuestionsMapper.xml deleted file mode 100644 index 279db38..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/QuestionsMapper.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/RoleMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/RoleMapper.xml deleted file mode 100644 index dd8e6e3..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/RoleMapper.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - delete - from ol_acl_role_permission - where role_id = #{roleId} - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/RolePermissionMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/RolePermissionMapper.xml deleted file mode 100644 index 6c00dc6..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/RolePermissionMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/SchoolClassificationMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/SchoolClassificationMapper.xml deleted file mode 100644 index c3238a1..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/SchoolClassificationMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/SchoolCourseMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/SchoolCourseMapper.xml deleted file mode 100644 index 180525f..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/SchoolCourseMapper.xml +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/SchoolMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/SchoolMapper.xml deleted file mode 100644 index dfa17ee..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/SchoolMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/SchoolProjectHintOpenMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/SchoolProjectHintOpenMapper.xml deleted file mode 100644 index 0d44ce3..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/SchoolProjectHintOpenMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/StaffGradeMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/StaffGradeMapper.xml deleted file mode 100644 index a1f6beb..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/StaffGradeMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/StaffMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/StaffMapper.xml deleted file mode 100644 index 72fff0d..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/StaffMapper.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/StaffProfessionalArchitectureMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/StaffProfessionalArchitectureMapper.xml deleted file mode 100644 index 23e0878..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/StaffProfessionalArchitectureMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/StudentMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/StudentMapper.xml deleted file mode 100644 index b575b29..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/StudentMapper.xml +++ /dev/null @@ -1,420 +0,0 @@ - - - - - - - INSERT INTO nakadai.hr_user_info (user_name, unique_identification, school_id, email, role_id, - create_time, update_time) - VALUES (#{userName}, #{uniqueIdentification}, #{schoolId}, #{email}, #{roleId}, now(), now()) - - - - - - INSERT INTO nakadai.hr_user_account(user_id, account, password, work_number, role_id, school_id, platform_id, - type, create_time, update_time, phone_binding_time, phone) - VALUES (#{userId}, #{account}, #{password}, #{workNumber}, #{roleId}, #{schoolId}, #{platformId}, #{type}, - now(), now(), #{phoneBindingTime}, #{phone}) - - - - - - - - - - - - - - - - - - - - - - - - - - - update nakadai.hr_user_info - set user_name = #{userName}, - email = #{email} - where user_id = #{userId} - - - - - UPDATE nakadai.hr_user_account - - - - work_number = #{workNumber}, - - - account = #{account}, - - - - phone = #{phone}, - - phone_binding_time = #{phoneBindingTime}, - - - - - - - id=#{id} - - - - - - update nakadai.hr_user_account - set is_enable = #{isEnable} - WHERE id = #{id} - - - update nakadai.hr_user_account - set phone = #{u.phone} - WHERE user_id = #{u.userId} - - - - - - - - - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/SystemLogoMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/SystemLogoMapper.xml deleted file mode 100644 index 4825ff8..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/SystemLogoMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/TheoreticalCourseChapterMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/TheoreticalCourseChapterMapper.xml deleted file mode 100644 index 62f2b09..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/TheoreticalCourseChapterMapper.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/TheoreticalCourseClassificationMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/TheoreticalCourseClassificationMapper.xml deleted file mode 100644 index ba46661..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/TheoreticalCourseClassificationMapper.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/TheoreticalCourseCollectMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/TheoreticalCourseCollectMapper.xml deleted file mode 100644 index 09e65f1..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/TheoreticalCourseCollectMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/TheoreticalCourseConfigureMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/TheoreticalCourseConfigureMapper.xml deleted file mode 100644 index e61c561..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/TheoreticalCourseConfigureMapper.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/TheoreticalCourseMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/TheoreticalCourseMapper.xml deleted file mode 100644 index 85d7f06..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/TheoreticalCourseMapper.xml +++ /dev/null @@ -1,323 +0,0 @@ - - - - - - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/TheoreticalCourseRangeMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/TheoreticalCourseRangeMapper.xml deleted file mode 100644 index ae12d1d..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/TheoreticalCourseRangeMapper.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/TheoreticalCourseSubsectionMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/TheoreticalCourseSubsectionMapper.xml deleted file mode 100644 index e9194ef..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/TheoreticalCourseSubsectionMapper.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/UserInfoMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/UserInfoMapper.xml deleted file mode 100644 index 5e23b86..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/UserInfoMapper.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - update ol_hr_user_info - SET logInNumber=logInNumber + 1, - lastLoginTime=NOW() - where userId = #{userId} - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/UserManagementMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/UserManagementMapper.xml deleted file mode 100644 index 68266eb..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/UserManagementMapper.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - INSERT INTO ol_hr_user_info (userName, roleId, email, clientId, clientName, uniqueIdentificationAccount, - account, password, creationTime, isPort) - VALUES (#{userName}, #{roleId}, #{email}, #{clientId}, #{clientName}, #{uniqueIdentificationAccount}, - #{account}, #{password}, NOW(), #{isPort}) - - - - - - - - update ol_hr_user_info - SET isdel = 1 - where userId = #{userId} - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/UserRoleMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/UserRoleMapper.xml deleted file mode 100644 index c1767d7..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/UserRoleMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/UserScoreMapper.xml b/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/UserScoreMapper.xml deleted file mode 100644 index 2301234..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/UserScoreMapper.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/ApplicantService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/ApplicantService.java deleted file mode 100644 index a03d362..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/ApplicantService.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.huoran.occupationlab.service; - - - -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.Applicant; -import com.huoran.common.entity.School; -import com.huoran.occupationlab.entity.req.PageRegistrationStaffReq; -import com.huoran.occupationlab.entity.vo.ApplicantVO; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; - -/** - *

- * 报名人员表 服务类 - *

- * - * @author chen - * @since 2020-10-15 - */ -public interface ApplicantService extends IService { - - R applicantPageConditionQuery(PageRegistrationStaffReq req); - - boolean disableContests(List ids); - - void export(HttpServletResponse response, PageRegistrationStaffReq contestId) throws IOException; - - void batchExport(HttpServletResponse response, List ids) throws IOException; - - List queryContestId(String account_id); - - boolean selectOne(String accountId, String contestId); - - School getSchool(Integer schoolId); - - - void exportDataInBatches(List list, HttpServletResponse response) throws Exception; - - R cancelRegistration(String contestId, Integer accountId); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/ArchitectureService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/ArchitectureService.java deleted file mode 100644 index 43a4183..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/ArchitectureService.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.Architecture; -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.occupationlab.entity.Class; -import com.huoran.occupationlab.entity.resp.StudentInfoResp; -import com.huoran.occupationlab.entity.vo.ArchitectureVO; -import io.swagger.annotations.ApiParam; -import org.springframework.web.bind.annotation.RequestParam; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -/** - *

- * 学生组织架构 服务类 - *

- * - * @author lr - * @since 2021-08-24 - */ -public interface ArchitectureService extends IService { - //级联分类列表列表展示 - List treeList(Integer schoolId); - - R stuOrganizationTree(Integer schoolId, Integer accountId, Integer level, Integer parentId); - - List chenckReapt(Architecture classes); - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/ArticleService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/ArticleService.java deleted file mode 100644 index f19e794..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/ArticleService.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.occupationlab.entity.Article; -import com.huoran.occupationlab.entity.vo.ArticleSort; - -/** - *

- * 文章表 服务类 - *

- * - * @author chen - * @since 2020-10-15 - */ -public interface ArticleService extends IService
{ - - void articlePageQuery(Page
page, String columnId, String port,Integer schoolId); - - Article getArticle(String articleId); - - boolean sort(ArticleSort articleSort); - - boolean repeat(Article article); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/AssessmentExamService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/AssessmentExamService.java deleted file mode 100644 index ebf15e9..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/AssessmentExamService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.huoran.occupationlab.entity.AssessmentExam; -import com.baomidou.mybatisplus.extension.service.IService; - -/** - *

- * 学生考试表(考核) 服务类 - *

- * - * @author lr - * @since 2021-08-19 - */ -public interface AssessmentExamService extends IService { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/AssessmentService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/AssessmentService.java deleted file mode 100644 index 6a36a0b..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/AssessmentService.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.Assessment; -import com.huoran.occupationlab.entity.req.AssessmentReq; -import com.huoran.occupationlab.entity.req.PageAssessmentReq; -import com.huoran.occupationlab.entity.req.PageStuAssessmentReq; -import com.huoran.occupationlab.entity.resp.StuAssessmentListResp; -import org.apache.ibatis.annotations.Param; -import org.springframework.web.bind.annotation.RequestBody; - -import javax.servlet.http.HttpServletRequest; -import java.text.ParseException; -import java.util.List; -import java.util.Set; - -/** - *

- * 考核管理 服务类 - *

- * - * @author lr - * @since 2021-08-18 - */ -public interface AssessmentService extends IService { - - List pageByCondition(PageAssessmentReq req); - - Integer pageByConditionNum(PageAssessmentReq req); - - List pageStuAssessment(PageStuAssessmentReq req); - - Integer pageStuAssessmentNum(PageStuAssessmentReq req); - - R saveAssessment(AssessmentReq req) throws ParseException; - - R deleteAssessment(@RequestBody List ids); - - R modifyAssessment(@RequestBody Assessment ass) throws ParseException; - - R getDetailById(Integer id); - - R collectPaper(Integer id); - - R enterExam(Integer assessmentId, Integer classId, Integer invitationCode, HttpServletRequest request); - - R getMineClass(Integer accountId); - - Set myClassByStudent(@Param("accountId") Integer accountId, @Param("schoolId") Integer schoolId); - - R enableAssessment(Integer id) throws ParseException; - - boolean checkReapt(Assessment assessment); - - boolean submitExam(Integer assessmentId, Integer classId, Integer accountId, Integer score); - - R spliceClass(Integer assessmentId); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/CityService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/CityService.java deleted file mode 100644 index 723e720..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/CityService.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.occupationlab.entity.City; - -import java.util.List; - -/** - *

- * 城市 服务类 - *

- * - * @author Ning - * @since 2020-10-27 - */ -public interface CityService extends IService { - - List queryCity(Integer provinceId); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/ClassService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/ClassService.java deleted file mode 100644 index b252bb1..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/ClassService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.huoran.occupationlab.entity.Class; -import com.baomidou.mybatisplus.extension.service.IService; - -import java.util.List; - -/** - *

- * 班级表 服务类 - *

- * - * @author lr - * @since 2021-08-18 - */ -public interface ClassService extends IService { - - List chenckReapt(Class classes); - - List getClassesUnderTheSchool(Integer schoolId); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/ClientManagementService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/ClientManagementService.java deleted file mode 100644 index 2de59c0..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/ClientManagementService.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.common.entity.NewClientManagement; -import com.huoran.occupationlab.entity.ClientManagement; - -import java.util.HashMap; -import java.util.List; - -/** - *

- * 企业端客户管理 服务类 - *

- * - * @author Ning - * @since 2020-10-27 - */ -public interface ClientManagementService extends IService { - //添加客户 - boolean addClient(ClientManagement clientManagement); - - //查询客户列表 - List queryList(HashMap map); - - //查询客户列表数量 - int queryListCount(HashMap map); - - //批量删除客户 - boolean deleteClient(List clientIds); - - //修改客户 - boolean updateClient(ClientManagement clientManagement); - - //查询客户列表数量 - int queryClientNameSize(String clientName); - - //查询客户列表数量 - NewClientManagement queryOneClient(String clientName); - - List getClientName(String clientName); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/ColumnService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/ColumnService.java deleted file mode 100644 index 24bb62a..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/ColumnService.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.occupationlab.entity.Column; -import com.huoran.occupationlab.entity.vo.ColumnSort; - -import java.util.List; - -/** - *

- * 栏目表 服务类 - *

- * - * @author chen - * @since 2020-10-15 - */ -public interface ColumnService extends IService { - - boolean saveColumn(Column column); - - boolean removeColumn(Integer columnId); - - List columnTree(Integer schoolId,String platformId); - - boolean updateSort(ColumnSort columnSort); - - boolean repeat(Column column); - - List firstLevelColumn(Integer schoolId); - - List secondaryColumnsByFirst(String id,Integer schoolId); - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/ContestAnnexService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/ContestAnnexService.java deleted file mode 100644 index 3ae0b5e..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/ContestAnnexService.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.huoran.occupationlab.entity.ContestAnnex; -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.occupationlab.entity.ContestRange; - -import java.util.List; - -/** - *

- * 赛事附件 服务类 - *

- * - * @author lr - * @since 2022-06-16 - */ -public interface ContestAnnexService extends IService { - List getContestAnnexByContestId(String ContestId); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/ContestAnnouncementAnnexService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/ContestAnnouncementAnnexService.java deleted file mode 100644 index 6e887c2..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/ContestAnnouncementAnnexService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.huoran.occupationlab.entity.ContestAnnouncementAnnex; -import com.baomidou.mybatisplus.extension.service.IService; - -/** - *

- * 大赛公告附件存储 服务类 - *

- * - * @author lr - * @since 2022-06-17 - */ -public interface ContestAnnouncementAnnexService extends IService { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/ContestAnnouncementService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/ContestAnnouncementService.java deleted file mode 100644 index c1c3a87..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/ContestAnnouncementService.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.ContestAnnouncement; -import com.baomidou.mybatisplus.extension.service.IService; -import io.swagger.annotations.ApiParam; -import org.springframework.web.bind.annotation.RequestParam; - -/** - *

- * 赛事公告 服务类 - *

- * - * @author lr - * @since 2022-06-17 - */ -public interface ContestAnnouncementService extends IService { - R queryAnnouncementByContestId(String contestId,Integer pageNum,Integer pageSize); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/ContestProgressService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/ContestProgressService.java deleted file mode 100644 index f97827f..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/ContestProgressService.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.occupationlab.entity.ContestProgress; - -/** - *

- * 竞赛进展表 服务类 - *

- * - * @author chen - * @since 2020-10-15 - */ -public interface ContestProgressService extends IService { - - boolean repeat(ContestProgress contestProgress); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/ContestRangeService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/ContestRangeService.java deleted file mode 100644 index 1fadcf4..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/ContestRangeService.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.huoran.occupationlab.entity.ContestRange; -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.common.entity.School; -import com.huoran.occupationlab.entity.resp.ContestRangeResp; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - *

- * 服务类 - *

- * - * @author lr - * @since 2022-06-16 - */ -public interface ContestRangeService extends IService { - List getContestRangeByContestId(String ContestId); - - List getRangeByContestId(@Param("contestId")String contestId); - -// List getRangeDetailByContestId(String contestId,Integer type); - - boolean checkWhetherToParticipate(School school, String contestId) ; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/ContestService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/ContestService.java deleted file mode 100644 index 7c9fe2d..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/ContestService.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.huoran.occupationlab.service; - - -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.Contest; -import com.huoran.occupationlab.entity.req.AfterLoginPageContestListReq; -import com.huoran.occupationlab.entity.req.PageContestListReq; -import com.huoran.occupationlab.entity.vo.ContestVO; - -import java.util.HashMap; -import java.util.List; - -/** - *

- * 竞赛管理表 服务类 - *

- * - * @author chen - * @since 2020-10-15 - */ -public interface ContestService extends IService { - - boolean removeContest(String contestId); - - /*List contestPageConditionQuery(HashMap map); - - int contestPageConditionCount(HashMap map);*/ - - void pageQuery(Page page, String name, String way, Integer schoolId); - - boolean repeat(Contest contest); - - R contestPageConditionQueryByNakadai(PageContestListReq pageContestListReq); - - R contestPageConditionQueryByOccupationlab(PageContestListReq pageContestListReq); - -// R onlineCompetitionByStudent(PageContestListReq pageContestListReq); - -// String getSchoolNameById(Integer schoolId); - -// R contestPageConditionQueryByOccupationlabStu(PageContestListReq pageContestListReq); - -// R listOfRegisteredEvents(PageContestListReq pageContestListReq); - - //学生——未登录前 - R notLoggedInBeforeStudentEvents(PageContestListReq pageContestListReq); - - //学生——登录后 - R contestAfterLogin(AfterLoginPageContestListReq pageContestListReq); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/CourseChapterService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/CourseChapterService.java deleted file mode 100644 index 912e5d7..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/CourseChapterService.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.occupationlab.entity.CourseChapter; -import com.huoran.occupationlab.entity.vo.ChapterVO; -import com.huoran.occupationlab.entity.vo.SortVO; - -import java.util.List; - -/** - * 课程章节 服务类 - * @author chen - * @since 2020-09-30 - */ -public interface CourseChapterService extends IService { - - List getChapterTree(String courseId); - - boolean removeChapter(String chapterId); - - boolean saveChapter(CourseChapter courseChapter); - - boolean updateSort(SortVO sortVO); - - boolean repeat(CourseChapter courseChapter); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/CourseClassificationService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/CourseClassificationService.java deleted file mode 100644 index a654746..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/CourseClassificationService.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.occupationlab.entity.EduCourseClassification; - -import java.util.List; - -/** - * 课程类别 服务类 - * - * @author chen - * @since 2020-09-30 - */ -public interface CourseClassificationService extends IService { - - List queryGlClassification(String schoolId); - - List checkReapt(EduCourseClassification classification); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/CourseService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/CourseService.java deleted file mode 100644 index 8a4e82e..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/CourseService.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.huoran.occupationlab.service; - - -import com.aliyuncs.exceptions.ClientException; -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.occupationlab.entity.EduCourse; -import com.huoran.occupationlab.entity.vo.CourseVO; - -import java.util.HashMap; -import java.util.List; - -/** - * 课程基本信息 服务类 - * - * @author chen - * @since 2020-09-30 - */ -public interface CourseService extends IService { - - List coursePageConditionQuery(HashMap map); - - int coursePageConditionCount(HashMap map); - - boolean deleteCourses(List courseIds); - - boolean removeCourse(String courseId); - - boolean repeat(EduCourse course); - - void addChapter(EduCourse course); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/CourseSubsectionService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/CourseSubsectionService.java deleted file mode 100644 index d21f306..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/CourseSubsectionService.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.aliyuncs.exceptions.ClientException; -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.occupationlab.entity.CourseSubsection; - -/** - * 课程小节 服务类 - * @author chen - * @since 2020-09-30 - */ -public interface CourseSubsectionService extends IService { - - boolean removeSubsection(String subsectionId) throws ClientException; - - boolean saveSubsection(CourseSubsection courseSubsection); - - boolean repeat(CourseSubsection courseSubsection); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/EntrepreneurialActivityAnnouncementAnnexService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/EntrepreneurialActivityAnnouncementAnnexService.java deleted file mode 100644 index e797945..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/EntrepreneurialActivityAnnouncementAnnexService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.huoran.occupationlab.entity.EntrepreneurialActivityAnnouncementAnnex; -import com.baomidou.mybatisplus.extension.service.IService; - -/** - *

- * 活动公告附件表 服务类 - *

- * - * @author lr - * @since 2023-05-12 - */ -public interface EntrepreneurialActivityAnnouncementAnnexService extends IService { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/EntrepreneurialActivityAnnouncementService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/EntrepreneurialActivityAnnouncementService.java deleted file mode 100644 index 71e1f2e..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/EntrepreneurialActivityAnnouncementService.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.EntrepreneurialActivityAnnouncement; -import com.baomidou.mybatisplus.extension.service.IService; - -/** - *

- * 活动公告表 服务类 - *

- * - * @author lr - * @since 2023-05-12 - */ -public interface EntrepreneurialActivityAnnouncementService extends IService { - R queryAnnouncementByActivityId(String competitionId, Integer pageNum, Integer pageSize); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/EntrepreneurialActivityApplicantService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/EntrepreneurialActivityApplicantService.java deleted file mode 100644 index 84062de..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/EntrepreneurialActivityApplicantService.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.EntrepreneurialActivityApplicant; -import com.huoran.occupationlab.entity.req.ActivityApplicantReq; -import com.huoran.occupationlab.entity.vo.RegistrationVO; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; - -/** - *

- * 创业活动报名人员表 服务类 - *

- * - * @author lr - * @since 2023-04-27 - */ -public interface EntrepreneurialActivityApplicantService extends IService { - R ApplicantsList(ActivityApplicantReq req); - - - void export(HttpServletResponse response, ActivityApplicantReq req) throws IOException; - - void exportDataInBatches(List listOfExportSub, HttpServletResponse response) throws IOException; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/EntrepreneurialActivityCollectService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/EntrepreneurialActivityCollectService.java deleted file mode 100644 index cd94c04..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/EntrepreneurialActivityCollectService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.huoran.occupationlab.entity.EntrepreneurialActivityCollect; -import com.baomidou.mybatisplus.extension.service.IService; - -/** - *

- * 理论课程收藏表 服务类 - *

- * - * @author lr - * @since 2023-06-01 - */ -public interface EntrepreneurialActivityCollectService extends IService { - Integer countTheNumberOfCollectors(Integer activityId); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/EntrepreneurialActivityFileService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/EntrepreneurialActivityFileService.java deleted file mode 100644 index 78e1c78..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/EntrepreneurialActivityFileService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.huoran.occupationlab.entity.EntrepreneurialActivityFile; -import com.baomidou.mybatisplus.extension.service.IService; - -/** - *

- * 创业活动附件存储 服务类 - *

- * - * @author lr - * @since 2023-04-26 - */ -public interface EntrepreneurialActivityFileService extends IService { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/EntrepreneurialActivityProgressService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/EntrepreneurialActivityProgressService.java deleted file mode 100644 index dd5e1ee..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/EntrepreneurialActivityProgressService.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.huoran.occupationlab.entity.EntrepreneurialActivityProgress; -import com.baomidou.mybatisplus.extension.service.IService; - -/** - *

- * 活动进展表 服务类 - *

- * - * @author lr - * @since 2023-05-12 - */ -public interface EntrepreneurialActivityProgressService extends IService { - boolean repeat(EntrepreneurialActivityProgress activityProgress); - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/EntrepreneurialActivityService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/EntrepreneurialActivityService.java deleted file mode 100644 index 412fe66..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/EntrepreneurialActivityService.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.EntrepreneurialActivity; -import com.huoran.occupationlab.entity.req.EntrepreneurshipActivityListrReq; - -/** - *

- * 创业活动管理表 服务类 - *

- * - * @author lr - * @since 2023-04-26 - */ -public interface EntrepreneurialActivityService extends IService { - R activityList(EntrepreneurshipActivityListrReq req); - - - R schoolActivities(EntrepreneurshipActivityListrReq req); - - R myActivities(EntrepreneurshipActivityListrReq req); - - R concernedActivity(EntrepreneurshipActivityListrReq req); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/EvaluationFractionService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/EvaluationFractionService.java deleted file mode 100644 index 5fce012..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/EvaluationFractionService.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.huoran.occupationlab.entity.EvaluationFraction; -import com.baomidou.mybatisplus.extension.service.IService; - -/** - *

- * 记录用户能力测评的总分数 服务类 - *

- * - * @author lr - * @since 2021-09-26 - */ -public interface EvaluationFractionService extends IService { - - void insertRecord(EvaluationFraction fraction); - - Integer queryExerciseRecord(Integer accountId); - - Integer queryTeachingRecord(Integer accountId); - - Integer queryScore(Integer accountId, Integer type); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/EvaluationQuestionService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/EvaluationQuestionService.java deleted file mode 100644 index e930f66..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/EvaluationQuestionService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.huoran.occupationlab.entity.EvaluationQuestion; -import com.baomidou.mybatisplus.extension.service.IService; - -/** - *

- * 测评试题表,记录每次测评的试题,与测评记录表相关联 服务类 - *

- * - * @author lr - * @since 2021-09-26 - */ -public interface EvaluationQuestionService extends IService { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/EvaluationRecordService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/EvaluationRecordService.java deleted file mode 100644 index b380d4d..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/EvaluationRecordService.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.huoran.occupationlab.entity.EvaluationRecord; -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.occupationlab.entity.vo.EvaluationRecordDetailVO; -import com.huoran.occupationlab.entity.vo.EvaluationRecordSubmitVO; -import com.huoran.occupationlab.entity.vo.TMSEvaluationRecordVO; - -import java.util.concurrent.ExecutionException; - -/** - *

- * 记录用户测评信息 服务类 - *

- * - * @author lr - * @since 2021-09-26 - */ -public interface EvaluationRecordService extends IService { - TMSEvaluationRecordVO startEvaluation(Integer accountId,Integer schoolId); - - TMSEvaluationRecordVO convertQuestion(Integer evaluationRecordId, - Integer currentQuestionSortNo, - String userAnswer, - Integer changeSortNo) throws ExecutionException, InterruptedException; - - EvaluationRecordSubmitVO submitEvaluation(Integer evaluationRecordId, - Integer currentQuestionSortNo, - String userAnswer, - Integer accountId) throws ExecutionException, InterruptedException; - - EvaluationRecordDetailVO evaluationDetail(Integer evaluationRecordId) throws ExecutionException, InterruptedException; - - String selectNotMade(Integer evaluationRecordId); - - void cleanRemainingTime(Integer accountId); - - boolean isOpenExperiment(Integer accountId); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/EvaluationRulesService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/EvaluationRulesService.java deleted file mode 100644 index 39f1f04..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/EvaluationRulesService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.huoran.occupationlab.entity.EvaluationRules; -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.occupationlab.entity.vo.EvaluationRulesVO; -import org.apache.ibatis.annotations.Param; - -/** - *

- * 测评规则信息记录,只记录一条信息 服务类 - *

- * - * @author lr - * @since 2021-08-12 - */ -public interface EvaluationRulesService extends IService { - EvaluationRulesVO getEvaluationRules(Integer schoolId); - - boolean updateEvaluationRulesById(EvaluationRules evaluationRules); - - boolean copyEvaluationRules(@Param("schoolId") Integer schoolId); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/ExperimentalReportService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/ExperimentalReportService.java deleted file mode 100644 index fc70ab5..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/ExperimentalReportService.java +++ /dev/null @@ -1,179 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.common.entity.ExperimentalReport; -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.req.*; -import com.huoran.occupationlab.entity.resp.*; -import com.huoran.occupationlab.entity.vo.ActivityDerivationVO; -import com.huoran.occupationlab.entity.vo.ProductClassInformationVO; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; - -/** - *

- * 存储各子系统的实验报告 服务类 - *

- * - * @author lr - * @since 2021-09-08 - */ -public interface ExperimentalReportService extends IService { - - /** - * @Description: 学生端-实验记录-实验概览 - * @auther: Rong - * @date: 2021/9/8 17:43 - */ - R getExperimentOverview(Integer accountId); - - /** - * @Description: 学生端-实验记录-考核列表 - * @auther: Rong - * @date: 2021/9/8 17:45 - */ - R queryAssessmentByStudent(PageAchievementByStuReq accountId); - - /** - * @Description: 学生端-实验记录-练习列表 - * @auther: Rong - * @date: 2021/9/8 17:45 - */ - R queryPracticeByStudent(PageAchievementByStuReq accountId); - - /** - * 管理端——练习成绩管理列表 - * - * @param req - * @return - */ - R getAchievementInfo(PageAchievementByTeacherReq req); - - /** - * 成绩详情 - * - * @param projectId - * @param pageNum - * @param pageSize - * @return - */ - R getPracticeDetail(Integer projectId, Integer pageNum, Integer pageSize, Integer schoolId,Integer classId,String keyWord,Integer mallId); - - /** - * @Description: 管理端考核成绩详情 - * @auther: Rong - * @date: 2021/9/8 15:22 - */ - R getAssessmentDetail(Integer assessmentId, Integer classId, Integer pageNum, Integer pageSize,String keyword); - - /** - * @Description: 批量导出练习成绩 - * @auther: Rong - * @date: 2021/9/8 16:39 - */ - void exportPracticeInfo(String ids, HttpServletResponse response, Integer schoolId, Integer projectId,Integer mallId) throws Exception; - - /** - * @Description: 批量导出考核成绩 - * @auther: Rong - * @date: 2021/9/8 16:39 - */ - void exportAssessmentInfo(String ids, HttpServletResponse response, Integer schoolId, Integer assessmentId, Integer classId) throws Exception; - - R deleteReportById(List projectId, Integer projectPermissions, List id); - - /** - * @Description: 学生端-实验记录-导出考核记录 - * @auther: Rong - * @date: 2021/9/8 17:45 - */ - void exportAssessmentByStudent(Integer accountId, Integer curriculumId, String ids, HttpServletResponse response) throws Exception; - - /** - * @Description: 学生端-实验记录-导出练习记录 - * @auther: Rong - * @date: 2021/9/8 17:45 - */ - void exportPracticeByStudent(Integer curriculumId, Integer accountId, HttpServletResponse response) throws Exception; - - /** - * @Description: 学生端-练习-实验情况 - * @auther: Rong - * @date: 2021/9/30 15:35 - */ - R practiceByStudentDetail(Integer curriculumId, Integer projectId, Integer accountId, Integer pageNum, Integer pageSize); - - /** - * @Description: 学生端-练习-导出实验情况 - * @auther: Rong - * @date: 2021/9/30 15:53 - */ - void exportPracticeByStudentDetail(String ids, Integer projectId, Integer accountId, HttpServletResponse response) throws Exception; - - - - /** - * 学生端-练习、考核-实验报告详情 - * - * @param reportId - * @return - */ - R reportDetail(Integer reportId); - - - - R practiceActivity(Integer projectId, Integer pageNum, Integer pageSize, Integer schoolId,Integer classId,String keyWord,Integer mallId); - - - - void exportDataInBatches(List list, HttpServletResponse response) throws Exception; - - - void exportAllData(Integer projectId,Integer schoolId, HttpServletResponse response,Integer mallId) throws Exception; - - R maximumPracticeScoreList(Integer projectId, Integer pageNum, Integer pageSize, Integer schoolId,Integer mallId); - - - //-------------------------------以下为数据看板功能 START------------------------------- - R getTheMostUsedCoursesInOurSchool(Integer schoolId); - - R academicLeadersRanking(Integer schoolId,PageReq req);//学霸排行榜 - - R examStatistics(Integer schoolId, Integer choose);//平台考试数据统计 - - R studentGradeDistribution(Integer schoolId, List req);//学生成绩分布分析 - - R studentAssessSchievement(Integer schoolId, List req);//学生实验课程考核成绩趋势 - - R overviewOfOurSchoolData(Integer schoolId);//本校数据概览 - - R monthlyAverageOnlineTime(Integer schoolId, List req);//月人均在线时长情况 - - R courseRankings(Integer schoolId); - - R activityRanking(Integer schoolId); - - //-------------------------------以上为数据看板功能 END--------------------------------- - - List getProduct(Integer schoolId); - - - R productReadScore(PerformanceUnderProductReq req); - - R productReadGradeDetails(PerformanceUnderProductReq req); - - void exportDetailsOfStudentPracticeScores(PerformanceUnderProductReq req, HttpServletResponse response, HttpServletRequest request) throws IOException; - - void exportDetailsOfStudentAssessmentResults(PerformanceUnderProductReq req, HttpServletResponse response, HttpServletRequest request) throws IOException; - - - void exportProductPracticeResults(List list, HttpServletResponse response) throws IOException; - void exportProductAssessResults(List list, HttpServletResponse response) throws IOException; - - //实验报告数据处理:将原来未绑定产品的实验报告补上 - List experimentalReportDataProcessing(); - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/LogService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/LogService.java deleted file mode 100644 index 5a525c2..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/LogService.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.occupationlab.entity.SysLog; - -/** - * 系统日志 - * - * @author cheney - * @version V1.0 - * @date 2022年7月28日 - */ -public interface LogService extends IService { -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/OSSFileService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/OSSFileService.java deleted file mode 100644 index ba5a99b..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/OSSFileService.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.aliyuncs.exceptions.ClientException; -import com.huoran.common.entity.FilesResult; -import org.springframework.web.multipart.MultipartFile; - -import java.io.IOException; -import java.util.List; - -/** - * @Author chen - * @DATE 2020/9/1 22:01 - * @Version 1.0 - */ -public interface OSSFileService { - - - FilesResult upload(MultipartFile file,String tableName) throws IOException; - - FilesResult fileupload(MultipartFile file, String tableName) throws IOException; - - FilesResult vodUpload(MultipartFile file) throws IOException; - - List fileDeletion(List keys); - - String getPlayAuth(String videoId) throws ClientException; - - void removeVideo(String videoId) throws ClientException; - - void removeMoreVideo(List videoIdList) throws ClientException; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/PermissionService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/PermissionService.java deleted file mode 100644 index 677ddf5..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/PermissionService.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.occupationlab.entity.AclPermission; -import com.huoran.occupationlab.entity.vo.PermissionVO; - -import java.util.List; - -/** - * 权限 服务类 - */ -public interface PermissionService extends IService { - - //获取全部菜单 - List queryAllMenu(); - - //获取企业端菜单 - List queryManagementAllMenu(); - - //根据角色获取菜单 - List selectAllMenu(String roleId, Integer isPort); - - //给角色分配权限 - void saveRolePermissionRelationShip(PermissionVO permissionVO); - - //递归删除菜单 - void removeChildById(String id); - - //根据用户id获取用户菜单 - List selectPermissionValueByUserId(String id); - - - List selectPermissionByUserId(String id); - - List selectRoleMenu(String roleId); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/PlayRecordService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/PlayRecordService.java deleted file mode 100644 index a3e8935..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/PlayRecordService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.huoran.occupationlab.entity.PlayRecord; -import com.baomidou.mybatisplus.extension.service.IService; - -/** - *

- * 资源播放记录表 服务类 - *

- * - * @author lr - * @since 2022-09-09 - */ -public interface PlayRecordService extends IService { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/ProjectHiddenService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/ProjectHiddenService.java deleted file mode 100644 index 4ce29ed..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/ProjectHiddenService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.huoran.occupationlab.entity.ProjectHidden; -import com.baomidou.mybatisplus.extension.service.IService; - -/** - *

- * 此表是在教师端成绩管理,虚仿以及教学列表展示中使用到 服务类 - *

- * - * @author lr - * @since 2021-09-23 - */ -public interface ProjectHiddenService extends IService { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/ProjectJudgmentService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/ProjectJudgmentService.java deleted file mode 100644 index cff301d..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/ProjectJudgmentService.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.huoran.occupationlab.entity.ProjectJudgment; -import com.baomidou.mybatisplus.extension.service.IService; - -import java.util.List; - -/** - *

- * 项目管理判分点绑定表 服务类 - *

- * - * @author Mr.JK - * @since 2021-08-26 - */ -public interface ProjectJudgmentService extends IService { - - /** - * 获取判分点分数 - * @param projectId - * @param judgmentId - * @return - */ - Integer getJudgmentScore(Integer projectId, Integer judgmentId); - - /** - * 更新中间表 - * @param projectId - * @param projectJudgments - * @return - */ - Integer updateProjectJudgment(Integer projectId,List projectJudgments); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/ProjectManageDisableService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/ProjectManageDisableService.java deleted file mode 100644 index 93d9825..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/ProjectManageDisableService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.huoran.occupationlab.entity.ProjectManageDisable; -import com.baomidou.mybatisplus.extension.service.IService; - -/** - *

- * 记录项目学校端的禁用记录 服务类 - *

- * - * @author lr - * @since 2022-01-12 - */ -public interface ProjectManageDisableService extends IService { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/ProjectManageService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/ProjectManageService.java deleted file mode 100644 index 9fb172e..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/ProjectManageService.java +++ /dev/null @@ -1,153 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.common.entity.ProjectManage; -import com.huoran.common.entity.to.JudgmentPointDataTo; -import com.huoran.common.entity.to.ProjectDataTo; -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.req.PageAssessmentForProjectReq; -import com.huoran.occupationlab.entity.req.ProjectManageReq; -import com.huoran.occupationlab.entity.vo.ProjectVo; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - *

- *

- * 项目管理表 服务类 - *

- * - * @author Mr.JK - * @since 2021-08-26 - */ -public interface ProjectManageService extends IService { - - /** - * 新增项目管理 - * - * @param projectVo - * @return - */ - R addProjectManage(ProjectVo projectVo); - - /** - * 更新项目管理 - * - * @param projectVo - * @return - */ - R updateProjectManage(ProjectVo projectVo); - - /** - * 批量删除项目管理 - * - * @param projectIds - * @param platformId - * @return - */ - R deleteProjectManage(List projectIds, Integer platformId); - - /** - * 获取项目管理详情 - * - * @param projectId - * @return - */ - R getProjectDetail(Integer projectId, Integer stuAssessent,Integer schoolId); - - /** - * 查询名称是否重复 - * - * @param projectManage - * @return - */ - Integer queryNameIsExist(ProjectManage projectManage); - - /** - * 平均分分配值 - * - * @param number - * @return - */ - R avgValues(Integer number); - - /** - * 根据系统id获取项目 - * - * @param systemId - * @param accountId - * @return - */ - R getProjectBySystemId(String systemId, String accountId, Integer permissions, Integer cId,Integer mallId); - - - List getProjectBySystemIdRemoteCall(String systemId, String accountId, Integer permissions, Integer cId,Integer mallId); - - /** - * 复制项目管理 - * - * @param projectVo - * @return - */ - R copyProjectManage(ProjectVo projectVo); - - /** - * 根据系统id获取系统内置项目 - * - * @param systemId - * @return - */ - List getInternalProjectBySystemId(List systemId, Integer permissions); - - /** - * 获取学校下所有系统id - * - * @param schoolId - * @return - */ - R getSystemIdBySchool(Integer schoolId); - - /** - * 更新是否开启 - * - * @param projectId - * @param isOpen - * @param platformId - */ - void updateIsOpen(Integer projectId, Integer isOpen, Integer platformId, Integer schoolId); - - /** - * 中台项目管理列表 分页,筛选 - * - * @param projectManageReq - * @return - */ - R queryProjectManageByNakadai(ProjectManageReq projectManageReq); - - /** - * 职站项目管理列表 分页,筛选 - * - * @param projectManageReq - * @return - */ - R queryProjectManageByOccupationlab(ProjectManageReq projectManageReq); - - /** - * @Description : 创建考核——>根据课程筛选项目列表 - * @Param req - * @Author Rong---2022/1/13 - */ - R getSchoolProjectByAssessent(PageAssessmentForProjectReq req); - - JudgmentPointDataTo getProjectPoints(ProjectDataTo projectDataTo); - - R getProjectAssessmentByCompetition(PageAssessmentForProjectReq projectManageReq); - - //根据类型获取课程下项目总数 - Integer getCurriculumCountByType(Integer cid, Integer permissions); - - //获取当前学校在当前产品下创建的某类型的项目 - Integer projectCreatedUnderProduct( Integer mallId, Integer permissions, Integer schoolId); - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/ProvinceService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/ProvinceService.java deleted file mode 100644 index e44f5fe..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/ProvinceService.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.occupationlab.entity.Province; - -import java.util.List; - -/** - *

- * 省份表 服务类 - *

- * - * @author Ning - * @since 2020-10-27 - */ -public interface ProvinceService extends IService { - - List queryProvince(); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/PythonFileDataService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/PythonFileDataService.java deleted file mode 100644 index 733f2f7..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/PythonFileDataService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.PythonFileData; -import com.baomidou.mybatisplus.extension.service.IService; - -/** - *

- * 服务类 - *

- * - * @author lr - * @since 2022-04-06 - */ -public interface PythonFileDataService extends IService { - R myData(PythonFileData fileData); - - //新增前统计 - Double statistics(Integer accountId,Integer schoolId); - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/PythonRunCodeService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/PythonRunCodeService.java deleted file mode 100644 index 3d7764b..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/PythonRunCodeService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.huoran.occupationlab.entity.PythonRunCode; -import com.baomidou.mybatisplus.extension.service.IService; - -/** - *

- * python储存实验运行记录 服务类 - *

- * - * @author lr - * @since 2021-12-22 - */ -public interface PythonRunCodeService extends IService { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/PythonSystemService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/PythonSystemService.java deleted file mode 100644 index 434d295..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/PythonSystemService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.huoran.occupationlab.entity.PythonSystem; -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.occupationlab.entity.vo.AssessmentVO; - -import java.util.List; - -/** - *

- * python系统记录表 服务类 - *

- * - * @author lr - * @since 2021-08-19 - */ -public interface PythonSystemService extends IService { - - //根据学生账号id获取课程名称 - List getCourseTitle(Integer accountId,Integer schoolId); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/PythonTableDataService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/PythonTableDataService.java deleted file mode 100644 index c173487..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/PythonTableDataService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.huoran.occupationlab.entity.PythonTableData; -import com.baomidou.mybatisplus.extension.service.IService; - -/** - *

- * 储存全部python表数据表导出Excel路径 服务类 - *

- * - * @author lr - * @since 2022-08-12 - */ -public interface PythonTableDataService extends IService { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/QuestionsService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/QuestionsService.java deleted file mode 100644 index b0f2c88..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/QuestionsService.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.Questions; -import com.huoran.occupationlab.entity.req.QuestionsAddReq; -import com.huoran.occupationlab.entity.req.QuestionsQueryReq; -import com.huoran.occupationlab.entity.req.QuestionsUpdateReq; -import com.huoran.occupationlab.entity.vo.EvaluationVO; -import com.huoran.occupationlab.entity.vo.QuestionsDetailVO; -import org.springframework.web.multipart.MultipartFile; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - *

- * 测评管理-题库记录表 服务类 - *

- * - * @author lr - * @since 2021-08-12 - */ -public interface QuestionsService extends IService { - - //题库列表 - IPage getQuestionsList(QuestionsQueryReq req); - - boolean saveQuestion(QuestionsAddReq questions); - - boolean updateQuestionById(QuestionsUpdateReq questions); - - boolean deleteByIds(List ids); - - R isDisable(Integer id,Integer schoolId); - - QuestionsDetailVO getQuestionDetailById(Integer id); - - //批量导入 - Map upload(MultipartFile file,Integer schoolId,Integer accountId ) throws IOException; - - //批量导入失败 - void exportFailureRecord(HttpServletResponse response, String token) throws Exception; - - String getEvaluationRemainingTime(Integer accountId,Integer schoolId); - - EvaluationVO randomQuestions(Integer schoolId); - - //复制内置题库 - boolean copyQuestion(Integer schoolId,Integer accountId); - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/RabbitService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/RabbitService.java deleted file mode 100644 index da31e89..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/RabbitService.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.huoran.common.response.R; - -public interface RabbitService { - R receiveMessage(); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/RolePermissionService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/RolePermissionService.java deleted file mode 100644 index 86ef55f..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/RolePermissionService.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.occupationlab.entity.AclRolePermission; - -/** - *

- * 角色权限 服务类 - *

- * - * @author testjava - * @since 2020-01-12 - */ -public interface RolePermissionService extends IService { - - void removeMenu(String roleId, Integer isPort); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/RoleService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/RoleService.java deleted file mode 100644 index 1c65056..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/RoleService.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.huoran.occupationlab.service; - - -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.occupationlab.entity.AclRole; - -import java.util.List; -import java.util.Map; - -/** - *

- * 服务类 - *

- * - * @author testjava - * @since 2020-01-12 - */ -public interface RoleService extends IService { - - //根据用户获取角色数据 - Map findRoleByUserId(String userId); - - //根据用户分配角色 - void saveUserRoleRelationShip(String userId, String[] roleId); - - // 根据用户id拥有的角色id - List selectRoleByUserId(String id); - - boolean repeat(AclRole role); - - boolean removeRolePermission(String roleId); - - boolean removeRolePermissions(List roleIds); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/SchoolClassificationService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/SchoolClassificationService.java deleted file mode 100644 index 818265b..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/SchoolClassificationService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.huoran.occupationlab.entity.SchoolClassification; -import com.baomidou.mybatisplus.extension.service.IService; - -/** - *

- * 学校对应分类表 服务类 - *

- * - * @author lr - * @since 2021-09-09 - */ -public interface SchoolClassificationService extends IService { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/SchoolCourseService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/SchoolCourseService.java deleted file mode 100644 index 2ec8c12..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/SchoolCourseService.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.occupationlab.entity.SchoolCourse; -import com.huoran.occupationlab.entity.vo.CourseVO; - -import java.util.HashMap; -import java.util.List; - -/** - *

- * 学校内置课程表 服务类 - *

- * - * @author Cheney - * @since 2020-11-30 - */ -public interface SchoolCourseService extends IService { - - List coursePageConditionQuery(HashMap map); - - int coursePageConditionCount(HashMap map); - - List builtInCoursePageQuery(HashMap map); - - int builtInCoursePageCount(HashMap map); - - boolean addBuiltInCourse(String schoolId, String courseIds , String classificationIds); - - void removeClassificationId(String schoolId, String classificationId); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/SchoolProjectHintOpenService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/SchoolProjectHintOpenService.java deleted file mode 100644 index 6ae2f7a..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/SchoolProjectHintOpenService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.huoran.occupationlab.entity.SchoolProjectHintOpen; -import com.baomidou.mybatisplus.extension.service.IService; - -/** - *

- * 学校项目实验提示管理表 服务类 - *

- * - * @author lr - * @since 2023-06-02 - */ -public interface SchoolProjectHintOpenService extends IService { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/SchoolService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/SchoolService.java deleted file mode 100644 index e68881a..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/SchoolService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.common.entity.School; - -/** - *

- * 学校表 服务类 - *

- * - * @author Ning - * @since 2020-10-27 - */ -public interface SchoolService extends IService { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/StaffGradeService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/StaffGradeService.java deleted file mode 100644 index e934573..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/StaffGradeService.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.huoran.occupationlab.entity.StaffGrade; -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.occupationlab.entity.StaffProfessionalArchitecture; - -/** - *

- * 员工年级表 服务类 - *

- * - * @author lr - * @since 2021-10-13 - */ -public interface StaffGradeService extends IService { - boolean repeat(StaffGrade staffGrade); - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/StaffProfessionalArchitectureService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/StaffProfessionalArchitectureService.java deleted file mode 100644 index 2279ecd..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/StaffProfessionalArchitectureService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.huoran.occupationlab.entity.StaffProfessionalArchitecture; -import com.baomidou.mybatisplus.extension.service.IService; - -/** - *

- * 员工专业组织架构 服务类 - *

- * - * @author lr - * @since 2021-10-13 - */ -public interface StaffProfessionalArchitectureService extends IService { - boolean repeat(StaffProfessionalArchitecture staffProfessionalArchitecture); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/StaffService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/StaffService.java deleted file mode 100644 index eb04369..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/StaffService.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.Staff; -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.occupationlab.entity.req.AddStaffReq; -import com.huoran.occupationlab.entity.req.ModifyStaffReq; -import com.huoran.occupationlab.entity.req.PageStaffListReq; -import io.swagger.models.auth.In; -import org.springframework.web.multipart.MultipartFile; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - *

- * 员工表 服务类 - *

- * - * @author lr - * @since 2021-10-13 - */ -public interface StaffService extends IService { - R saveStaff(AddStaffReq staffReq) throws Exception; - - R pageStaffList(PageStaffListReq req); - - R staffDetail(Integer accountId); - - R modifyStaff(ModifyStaffReq staffReq,Integer schoolId); - - R delStaff(List ids); - - Map importStaff(MultipartFile file, Integer schoolId) throws IOException; - - //批量导入失败 - void exportFailureRecord(HttpServletResponse response, String token) throws Exception; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/StudentService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/StudentService.java deleted file mode 100644 index ab89aca..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/StudentService.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.huoran.common.entity.Student; -import com.huoran.common.entity.UserAccount; -import com.huoran.common.entity.UserInfo; -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.occupationlab.entity.req.OrganizationStudentReq; -import com.huoran.occupationlab.entity.req.PageStudentListReq; -import com.huoran.occupationlab.entity.resp.StudentInfoResp; -import org.apache.ibatis.annotations.Param; -import org.springframework.web.multipart.MultipartFile; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - *

- * 学生表 服务类 - *

- * - * @author lr - * @since 2021-08-24 - */ -public interface StudentService extends IService { - - //获取学生详情信息 - StudentInfoResp getStudentInfoDetail(@Param("params") Map params); - - //根据学号获取学生详情信息 - StudentInfoResp getStudentInfoDetailByWorkNum(@Param("params") Map params); - - //新增用户信息 - boolean addUserInfo(UserInfo userInfo); - - //新增账号信息 - boolean addUserAccount(UserAccount account); - - /** - * 学号(本校内)——————账号(全平台)判重 ——————手机号、邮箱根据平台id判重 - */ - //手机号、邮箱根据平台id判重 - List checkUserInfo(UserInfo userInfo); - - //学号(本校内)——————账号(全平台 - List checkUserAccount(UserAccount userAccount); - - //查询学生列表 - List studentList(PageStudentListReq req); - - //统计查询学生列表总数 - Integer studentListNum(PageStudentListReq req); - - - //查询职站学生端的用户 - List getOccupationlabStudent(); - - //查询学生信息 - StudentInfoResp getStudentInfoByAccountId(Integer stuAccountId); - - //修改用户信息 - boolean modifyUserInfo(UserInfo userInfo); - - //修改账户信息 - boolean modifyUserAccount(UserAccount userAccount); - - //批量导入学生 - Map uploadStudent(MultipartFile file, Integer schoolId) throws IOException; - - //批量导入失败 - void exportFailureRecord(HttpServletResponse response, String token) throws Exception; - - //组织架构筛选学生 - List organizationalStudentList(OrganizationStudentReq req); - - //统计组织架构筛选学生 - Integer organizationalStudentListNum(OrganizationStudentReq req); - - //禁用启用学生账号 - Integer updateAccountEnable(Integer id, Integer isEnable); - - //根据账号id拿到用户id - Integer getUserId(Integer accountId); - - //统计班级下人数 - Integer countClassSizes(Integer schoolId,Integer classId); - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/SysJobLogService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/SysJobLogService.java deleted file mode 100644 index c857e1e..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/SysJobLogService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.occupationlab.entity.SysJobLog; - -/** - * 定时任务 服务类 - * - * @author cheney - * @version V1.0 - * @date 2022年7月28日 - */ -public interface SysJobLogService extends IService { - -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/SysJobService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/SysJobService.java deleted file mode 100644 index e2ce1c7..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/SysJobService.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.occupationlab.entity.SysJob; - -import java.util.List; - -/** - * 定时任务 服务类 - * - * @author cheney - * @version V1.0 - * @date 2022年7月28日 - */ -public interface SysJobService extends IService { - - /** - * 保存job - * - * @param sysJob sysJob - */ - void saveJob(SysJob sysJob); - - /** - * 更新job - * - * @param sysJob sysJob - */ - void updateJobById(SysJob sysJob); - - /** - * 删除job - * - * @param ids ids - */ - void delete(List ids); - - /** - * 运行一次job - * - * @param ids ids - */ - void run(List ids); - - /** - * 暂停job - * - * @param ids ids - */ - void pause(List ids); - - /** - * 恢复job - * - * @param ids ids - */ - void resume(List ids); - - /** - * 批量更新状态 - * - * @param ids ids - * @param status status - */ - void updateBatch(List ids, int status); -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/SystemLogoService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/SystemLogoService.java deleted file mode 100644 index 708b9b0..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/SystemLogoService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.huoran.occupationlab.entity.SystemLogo; -import com.baomidou.mybatisplus.extension.service.IService; - -/** - *

- * 职站教师端-系统logo设置 服务类 - *

- * - * @author lr - * @since 2021-10-18 - */ -public interface SystemLogoService extends IService { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/TheoreticalCourseChapterService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/TheoreticalCourseChapterService.java deleted file mode 100644 index 34f0a88..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/TheoreticalCourseChapterService.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.occupationlab.entity.TheoreticalCourseChapter; -import com.huoran.occupationlab.entity.vo.ReorderVO; -import com.huoran.occupationlab.entity.vo.TheoreticalChapterVO; - -import java.util.List; - -/** - *

- * 理论课程章节表 服务类 - *

- * - * @author lr - * @since 2022-09-22 - */ -public interface TheoreticalCourseChapterService extends IService { - - List getChapterTree(String courseId); - - boolean updateSort(ReorderVO reorderVO); - - boolean repeat(TheoreticalCourseChapter theoreticalCourseChapter); - - boolean saveChapter(TheoreticalCourseChapter theoreticalCourseChapter); - - boolean removeChapter(Integer chapterId); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/TheoreticalCourseClassificationService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/TheoreticalCourseClassificationService.java deleted file mode 100644 index 44ac7fc..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/TheoreticalCourseClassificationService.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.TheoreticalCourseClassification; -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.occupationlab.entity.req.ClassificationPageReq; -import org.springframework.web.bind.annotation.RequestBody; - -import javax.servlet.http.HttpServletRequest; - -/** - *

- * 理论课程分类信息 服务类 - *

- * - * @author lr - * @since 2022-09-14 - */ -public interface TheoreticalCourseClassificationService extends IService { - - - R checkRepeat(TheoreticalCourseClassification classification); - - - R pagingQuery(ClassificationPageReq pageReq); - - R queryAllCategoriesOfSchools(); - - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/TheoreticalCourseCollectService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/TheoreticalCourseCollectService.java deleted file mode 100644 index 63478be..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/TheoreticalCourseCollectService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.huoran.occupationlab.entity.TheoreticalCourseCollect; -import com.baomidou.mybatisplus.extension.service.IService; - -/** - *

- * 理论课程收藏表 服务类 - *

- * - * @author lr - * @since 2023-04-18 - */ -public interface TheoreticalCourseCollectService extends IService { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/TheoreticalCourseConfigureService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/TheoreticalCourseConfigureService.java deleted file mode 100644 index a46ed70..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/TheoreticalCourseConfigureService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.huoran.occupationlab.entity.TheoreticalCourseConfigure; -import com.baomidou.mybatisplus.extension.service.IService; - -/** - *

- * 理论课程与理论课程分类配置表 服务类 - *

- * - * @author lr - * @since 2022-09-14 - */ -public interface TheoreticalCourseConfigureService extends IService { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/TheoreticalCourseRangeService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/TheoreticalCourseRangeService.java deleted file mode 100644 index b775b1b..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/TheoreticalCourseRangeService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.huoran.occupationlab.entity.TheoreticalCourseRange; -import com.baomidou.mybatisplus.extension.service.IService; - -/** - *

- * 理论课程指定范围选择 服务类 - *

- * - * @author lr - * @since 2022-09-19 - */ -public interface TheoreticalCourseRangeService extends IService { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/TheoreticalCourseService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/TheoreticalCourseService.java deleted file mode 100644 index 6a43377..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/TheoreticalCourseService.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.TheoreticalCourse; -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.occupationlab.entity.TheoreticalCourseClassification; -import com.huoran.occupationlab.entity.req.AddTheoreticalCourseReq; -import com.huoran.occupationlab.entity.req.PageStudentTheoreticalCourseReq; -import com.huoran.occupationlab.entity.req.PageTheoreticalCourseReq; -import io.swagger.annotations.ApiParam; -import org.springframework.web.bind.annotation.RequestBody; - -import javax.servlet.http.HttpServletRequest; - -/** - *

- * 理论课程基本信息 服务类 - *

- * - * @author lr - * @since 2022-09-14 - */ -public interface TheoreticalCourseService extends IService { - - R addTheoryCourses(AddTheoreticalCourseReq req, HttpServletRequest request); - - R pageConditionalQueryCourse(PageTheoreticalCourseReq pageReq); - - R modifyTheoryCourses(AddTheoreticalCourseReq req, HttpServletRequest request); - - R theoryCoursesDetail(Integer id); - - //学生端 课程列表 - R pageConditionalQueryCourseByStudent(PageStudentTheoreticalCourseReq pageReq); - - //登录前 学生端课程列表 - R studentLoginPreCourse(PageTheoreticalCourseReq pageReq); - - R checkRepeat(TheoreticalCourse classification); - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/TheoreticalCourseSubsectionService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/TheoreticalCourseSubsectionService.java deleted file mode 100644 index f2e0610..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/TheoreticalCourseSubsectionService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.aliyuncs.exceptions.ClientException; -import com.huoran.occupationlab.entity.TheoreticalCourseSubsection; -import com.baomidou.mybatisplus.extension.service.IService; - -/** - *

- * 课程小节 服务类 - *

- * - * @author lr - * @since 2022-09-22 - */ -public interface TheoreticalCourseSubsectionService extends IService { - - boolean repeat(TheoreticalCourseSubsection theoreticalCourseSubsection); - - boolean saveSubsection(TheoreticalCourseSubsection theoreticalCourseSubsection); - - boolean removeSubsection(Integer subsectionId) throws ClientException; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/UserInfoService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/UserInfoService.java deleted file mode 100644 index e3e4623..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/UserInfoService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.occupationlab.entity.HrUserInfo; - -import java.util.HashMap; - -/** - *

- * 用户信息表 服务类 - *

- * - * @author Ning - * @since 2020-10-21 - */ -public interface UserInfoService extends IService { - HrUserInfo getUserInfo(Integer userId); - - HrUserInfo login(HashMap map); - - boolean updateTime(Integer userId); -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/UserManagementService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/UserManagementService.java deleted file mode 100644 index dbff1e1..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/UserManagementService.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.occupationlab.entity.UserManagement; -import com.huoran.occupationlab.entity.vo.UserVO; -import org.springframework.web.multipart.MultipartFile; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - *

- * 企业端用户管理 服务类 - *

- * - * @author Ning - * @since 2020-10-27 - */ -public interface UserManagementService extends IService { - - //添加用户 - boolean addUser(UserVO vo); - - //查询用户列表 - List queryList(HashMap map); - - //查询用户列表数量 - int queryListCount(HashMap map); - - //批量删除用户 - boolean deleteUser(List userIds); - - //修改用户 - boolean updateUser(UserVO vo); - - Map upload(MultipartFile file) throws IOException; - - void exportFailureRecord(HttpServletResponse response, String token) throws Exception; - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/UserRoleService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/UserRoleService.java deleted file mode 100644 index 9b75c97..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/UserRoleService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.occupationlab.entity.AclUserRole; - -/** - *

- * 服务类 - *

- * - * @author testjava - * @since 2020-01-12 - */ -public interface UserRoleService extends IService { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/UserScoreService.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/UserScoreService.java deleted file mode 100644 index 0163aeb..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/UserScoreService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.huoran.occupationlab.service; - -import com.huoran.occupationlab.entity.UserScore; -import com.baomidou.mybatisplus.extension.service.IService; - -/** - *

- * 用户分数表 服务类 - *

- * - * @author Mr.JK - * @since 2021-09-14 - */ -public interface UserScoreService extends IService { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ApplicantServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ApplicantServiceImpl.java deleted file mode 100644 index 3968b22..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ApplicantServiceImpl.java +++ /dev/null @@ -1,150 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import cn.afterturn.easypoi.excel.ExcelExportUtil; -import cn.afterturn.easypoi.excel.entity.ExportParams; -import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.Applicant; -import com.huoran.common.entity.School; -import com.huoran.occupationlab.entity.excel.ExcelData; -import com.huoran.occupationlab.entity.req.PageRegistrationStaffReq; -import com.huoran.occupationlab.entity.vo.ApplicantVO; -import com.huoran.occupationlab.mapper.ApplicantMapper; -import com.huoran.occupationlab.service.ApplicantService; -import com.huoran.occupationlab.utils.EasyExcelUtil; -import com.huoran.occupationlab.utils.poi.ExcelStyleUtil; -import org.apache.poi.ss.usermodel.Workbook; -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Service; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.net.URLEncoder; -import java.util.ArrayList; -import java.util.List; -import java.util.stream.Collectors; - -/** - *

- * 报名人员表 服务实现类 - *

- * - * @author chen - * @since 2020-10-15 - */ -@Service -public class ApplicantServiceImpl extends ServiceImpl implements ApplicantService { - - @Override - public R applicantPageConditionQuery(PageRegistrationStaffReq req) { - - Page page = new Page(req.getPageNum(), req.getPageSize()); - IPage pageList = baseMapper.selectApplicantByCondition(page, req); - return R.ok().put("data", pageList); - - - } - - - @Override - public boolean disableContests(List ids) { - int updates = baseMapper.disableByIds(ids); - return updates > 0; - } - - @Override - public void export(HttpServletResponse response, PageRegistrationStaffReq req) throws IOException { - - Page page = new Page(req.getPageNum(), req.getPageSize()); - IPage applicantVOList = baseMapper.selectApplicantByCondition(page, req); - List excelDataList = new ArrayList<>(); - applicantVOList.getRecords().forEach(applicantVO -> { - ExcelData excelData = new ExcelData(); - /*//是否禁用(0未禁用,1禁用) - if (applicantVO.getIsDisable().equals("0")){ - applicantVO.setIsDisable("启用"); - }else{ - applicantVO.setIsDisable("禁用"); - }*/ - BeanUtils.copyProperties(applicantVO, excelData); - excelDataList.add(excelData); - }); - /* EasyExcelUtil.download(response, ExcelData.class, excelDataList);*/ - - - // 告诉浏览器用什么软件可以打开此文件 - response.setHeader("content-Type", "application/vnd.ms-excel"); - // 下载文件的默认名称 - response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("报名人员导出", "UTF-8") + ".xls"); - //编码 - response.setCharacterEncoding("UTF-8"); - Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), ExcelData.class, excelDataList); - ExportParams exportParams = new ExportParams(null, "delivery", ExcelType.XSSF); - exportParams.setStyle(ExcelStyleUtil.class); - workbook.write(response.getOutputStream()); - } - - @Override - public void batchExport(HttpServletResponse response, List ids) throws IOException { - List excelDataList = baseMapper.selectBatchData(ids); - EasyExcelUtil.download(response, ExcelData.class, excelDataList); - } - - @Override - public List queryContestId(String account_id) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("account_id", account_id); - wrapper.select("contest_id"); - List applicants = baseMapper.selectList(wrapper); - List contestIds = applicants.stream().map(Applicant::getContestId).collect(Collectors.toList()); - return contestIds; - } - - @Override - public boolean selectOne(String accountId, String contestId) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("account_id", accountId); - wrapper.eq("contest_id", contestId); - Integer count = baseMapper.selectCount(wrapper); - return count > 0; - } - - @Override - public School getSchool(Integer schoolId) { - return baseMapper.getSchool(schoolId); - } - - @Override - public void exportDataInBatches(List list, HttpServletResponse response) throws Exception { - - /* list.forEach(applicantVO -> { - //是否禁用(0启用,1禁用) - if (applicantVO.getIsDisable().equals("1")){ - applicantVO.setIsDisable("已禁用"); - }else{ - applicantVO.setIsDisable("启用"); - } - });*/ - - // 告诉浏览器用什么软件可以打开此文件 - response.setHeader("content-Type", "application/vnd.ms-excel"); - // 下载文件的默认名称 - response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("报名人员导出", "UTF-8") + ".xls"); - //编码 - response.setCharacterEncoding("UTF-8"); - Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), ApplicantVO.class, list); - ExportParams exportParams = new ExportParams(null, "delivery", ExcelType.XSSF); - exportParams.setStyle(ExcelStyleUtil.class); - workbook.write(response.getOutputStream()); - } - - @Override - public R cancelRegistration(String contestId, Integer accountId) { - boolean ret = baseMapper.cancelRegistration(contestId, accountId); - return ret ? R.ok() : R.error(); - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ArchitectureServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ArchitectureServiceImpl.java deleted file mode 100644 index b4247a0..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ArchitectureServiceImpl.java +++ /dev/null @@ -1,183 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.common.constant.DelConstant; -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.Architecture; -import com.huoran.occupationlab.entity.Class; -import com.huoran.common.entity.Student; -import com.huoran.occupationlab.entity.resp.StudentInfoResp; -import com.huoran.occupationlab.mapper.ArchitectureMapper; -import com.huoran.occupationlab.mapper.ClassMapper; -import com.huoran.occupationlab.mapper.StudentMapper; -import com.huoran.occupationlab.service.ArchitectureService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.List; - -/** - *

- * 学生组织架构 服务实现类 - *

- * - * @author lr - * @since 2021-08-24 - */ -@Service -public class ArchitectureServiceImpl extends ServiceImpl implements ArchitectureService { - - @Autowired - private ClassMapper classMapper; - - @Autowired - private StudentMapper studentMapper; - - /** - * 使用递归方法构建权限菜单 - */ - public List bulid(List treeNodes) { - List trees = new ArrayList<>(); - for (Architecture treeNode : treeNodes) { - if (treeNode.getLevel() == 1) { - trees.add(findChildren(treeNode, treeNodes)); - } - } - return trees; - } - - /** - * 递归查找子节点 - */ - public Architecture findChildren(Architecture treeNode, List treeNodes) { - treeNode.setChildren(new ArrayList()); - - for (Architecture it : treeNodes) { - if (treeNode.getLevel() == 2) {//表示查询年级下的班级 拼接 - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("is_del", DelConstant.NOT_DEL); - queryWrapper.eq("architecture_id", treeNode.getId()); - List classList = classMapper.selectList(queryWrapper); - - List addClassList = new ArrayList<>(); - for (Class cla : classList) { - Architecture classArchitecture = new Architecture(); - classArchitecture.setOrganizationName(cla.getClassName()); - classArchitecture.setParentId(cla.getArchitectureId()); - classArchitecture.setLevel(3); - classArchitecture.setId(cla.getId()); - - QueryWrapper studentQueryWrapper = new QueryWrapper<>(); - studentQueryWrapper.eq("is_del", DelConstant.NOT_DEL); - studentQueryWrapper.last(" and FIND_IN_SET(" + cla.getId() + ",class_id)"); - List students = studentMapper.selectList(studentQueryWrapper); - List addStudentList = new ArrayList<>(); - for (Student student : students) { - StudentInfoResp stu = studentMapper.getUerName(student.getAccountId()); - Architecture studentArchitecture = new Architecture(); - studentArchitecture.setOrganizationName(stu.getUserName()); - studentArchitecture.setLevel(4); - studentArchitecture.setId(student.getId()); - studentArchitecture.setParentId(cla.getId()); - addStudentList.add(studentArchitecture); - } - - classArchitecture.setChildren(addStudentList); - - addClassList.add(classArchitecture); - } - treeNode.setChildren(addClassList); - - } - if (treeNode.getId().equals(it.getParentId())) { - if (treeNode.getChildren() == null) { - treeNode.setChildren(new ArrayList<>()); - } - treeNode.getChildren().add(findChildren(it, treeNodes)); - } - } - return treeNode; - } - - @Override - public List treeList(Integer schoolId) { - //查询父级的 - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("is_del", DelConstant.NOT_DEL); - wrapper.eq("school_id", schoolId); - List permissionList = baseMapper.selectList(wrapper); - List result = bulid(permissionList); - - return result; - } - - @Override - public R stuOrganizationTree(Integer schoolId, Integer accountId, Integer level, Integer parentId) { - QueryWrapper queryWrapper = new QueryWrapper(); - queryWrapper.eq("is_del", DelConstant.NOT_DEL); - queryWrapper.eq("school_id", schoolId); - queryWrapper.eq("level", level); - - List list = new ArrayList<>(); - switch (level) { - case 1: - return R.ok().put("treeList", baseMapper.selectList(queryWrapper)); - case 2: - queryWrapper.eq("parent_id", parentId); - return R.ok().put("treeList", baseMapper.selectList(queryWrapper)); - case 3: - //查询年级下的班级 - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("is_del", DelConstant.NOT_DEL); - wrapper.eq("architecture_id", parentId); - List classList = classMapper.selectList(wrapper); - for (Class classes : classList) { - Architecture architecture = new Architecture(); - architecture.setOrganizationName(classes.getClassName()); - architecture.setLevel(3); - architecture.setParentId(parentId); - architecture.setId(classes.getId()); - list.add(architecture); - } - return R.ok().put("treeList", list); - case 4: - //查询年级下的班级 - QueryWrapper studentQueryWrapper = new QueryWrapper<>(); - studentQueryWrapper.eq("is_del", DelConstant.NOT_DEL); - studentQueryWrapper.last(" and FIND_IN_SET(" + parentId + ",class_id)"); - List students = studentMapper.selectList(studentQueryWrapper); - List addStudentList = new ArrayList<>(); - for (Student student : students) { - StudentInfoResp stu = studentMapper.getUerName(student.getAccountId()); - Architecture studentArchitecture = new Architecture(); - studentArchitecture.setOrganizationName(stu.getUserName()); - studentArchitecture.setLevel(4); - studentArchitecture.setId(student.getAccountId()); - studentArchitecture.setParentId(parentId); - addStudentList.add(studentArchitecture); - } - - return R.ok().put("treeList", addStudentList); - default: - return R.error("请输入正确的层级!"); - } - - } - - @Override - public List chenckReapt(Architecture architecture) { - QueryWrapper queryWrapper = new QueryWrapper(); - queryWrapper.eq("is_del", DelConstant.NOT_DEL); - queryWrapper.eq("level", architecture.getLevel()); - queryWrapper.eq("school_id", architecture.getSchoolId()); - queryWrapper.eq("organization_name", architecture.getOrganizationName()); - queryWrapper.eq("parent_id", architecture.getParentId()); - if (architecture.getId() != null) { - queryWrapper.last(" and id != " + architecture.getId()); - } - List architectureList = baseMapper.selectList(queryWrapper); - return architectureList; - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ArticleServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ArticleServiceImpl.java deleted file mode 100644 index 83a78c0..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ArticleServiceImpl.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.huoran.occupationlab.entity.Article; -import com.huoran.occupationlab.entity.vo.ArticleSort; -import com.huoran.occupationlab.mapper.ArticleMapper; -import com.huoran.occupationlab.service.ArticleService; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.List; - -/** - *

- * 文章表 服务实现类 - *

- * - * @author chen - * @since 2020-10-15 - */ -@Service -public class ArticleServiceImpl extends ServiceImpl implements ArticleService { - - @Override - public void articlePageQuery(Page
page, String columnId, String port, Integer schoolId) { - QueryWrapper
wrapper = new QueryWrapper<>(); - wrapper.orderByAsc("sort"); - wrapper.orderByDesc("date"); - wrapper.eq("column_id", columnId); - wrapper.eq("school_id", schoolId); - if (StringUtils.isNotEmpty(port)) { - wrapper.eq("status", 0); - } - baseMapper.selectPage(page, wrapper); - } - - @Transactional - @Override - public Article getArticle(String articleId) { - Article article = baseMapper.selectById(articleId); - baseMapper.updateViewNum(articleId); - return article; - } - - @Override - public boolean sort(ArticleSort articleSort) { - List
articleList = articleSort.getArticleList(); - if (articleList != null && articleList.size() != 0) { - articleList.forEach(article -> { - baseMapper.updateById(article); - }); - return true; - } else { - return false; - } - } - - @Override - public boolean repeat(Article article) { - QueryWrapper
wrapper = new QueryWrapper<>(); - wrapper.eq("column_id", article.getColumnId()); - wrapper.eq("title", article.getTitle()); - wrapper.eq("school_id", article.getSchoolId()); - if (article.getId() != null) { - wrapper.last(" and id != " + article.getId()); - } - Integer count = baseMapper.selectCount(wrapper); - return count > 0; - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/AssessmentExamServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/AssessmentExamServiceImpl.java deleted file mode 100644 index 1968060..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/AssessmentExamServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.huoran.occupationlab.entity.AssessmentExam; -import com.huoran.occupationlab.mapper.AssessmentExamMapper; -import com.huoran.occupationlab.service.AssessmentExamService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -/** - *

- * 学生考试表(考核) 服务实现类 - *

- * - * @author lr - * @since 2021-08-19 - */ -@Service -public class AssessmentExamServiceImpl extends ServiceImpl implements AssessmentExamService { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/AssessmentServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/AssessmentServiceImpl.java deleted file mode 100644 index b9c2a23..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/AssessmentServiceImpl.java +++ /dev/null @@ -1,737 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.huoran.api.UserClient; -import com.huoran.common.constant.AssessmentConstant; -import com.huoran.common.constant.DelConstant; -import com.huoran.common.constant.PlatformConstant; -import com.huoran.common.exception.CustomException; -import com.huoran.common.exception.ExceptionEnum; -import com.huoran.common.response.R; -import com.huoran.common.utils.CheckDateUtil; -import com.huoran.common.utils.TokenUtils; -import com.huoran.occupationlab.entity.Architecture; -import com.huoran.occupationlab.entity.Assessment; -import com.huoran.occupationlab.entity.AssessmentExam; -import com.huoran.occupationlab.entity.Class; -import com.huoran.occupationlab.entity.req.AssessmentReq; -import com.huoran.occupationlab.entity.req.ClassReq; -import com.huoran.occupationlab.entity.req.PageAssessmentReq; -import com.huoran.occupationlab.entity.req.PageStuAssessmentReq; -import com.huoran.occupationlab.entity.resp.EnterExamResp; -import com.huoran.occupationlab.entity.resp.StuAssessmentListResp; -import com.huoran.occupationlab.mapper.ArchitectureMapper; -import com.huoran.occupationlab.mapper.AssessmentExamMapper; -import com.huoran.occupationlab.mapper.AssessmentMapper; -import com.huoran.occupationlab.mapper.ClassMapper; -import com.huoran.occupationlab.service.AssessmentService; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.ObjectUtils; - -import javax.servlet.http.HttpServletRequest; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.ParsePosition; -import java.text.SimpleDateFormat; -import java.util.*; -import java.util.stream.Collectors; - -/** - *

- * 考核管理 服务实现类 - *

- * - * @author lr - * @since 2021-08-18 - */ -@Service -public class AssessmentServiceImpl extends ServiceImpl implements AssessmentService { - - @Autowired - private AssessmentMapper mapper; - @Autowired - private ClassMapper classMapper; - - @Autowired - private ArchitectureMapper architectureMapper; - - @Autowired - private AssessmentExamMapper examMapper; - -// @Autowired -// private XxlJobService xxlJobService; - - @Autowired - private UserClient userClient; - - @Override - public List pageByCondition(PageAssessmentReq req) { - Map map = new HashMap(); - - map.put("month", req.getMonth()); - map.put("type", req.getType()); - map.put("status", req.getStatus()); - map.put("curriculumId", req.getCurriculumId()); - map.put("keyWord", req.getKeyWord()); - map.put("pageNum", (req.getPageNum() - 1) * req.getPageSize()); - map.put("pageSize", req.getPageSize()); - map.put("schoolId", req.getSchoolId()); - map.put("startTime", req.getStartTime()); - map.put("endTime", req.getEndTime()); - - map.put("accountId", req.getAccountId()); - - map.put("isAdmin", 0); - map.put("mallId", req.getMallId()); - - String roleName = userClient.getUserAllRole(req.getAccountId() + "", 1); - if (roleName.contains("超级管理员") || roleName.contains("管理员")) { - //依据角色查询本校内的项目(超管管理员角色、管理员角色能看到全部考核列表 其它角色只能看到自己发布的) - map.put("isAdmin", 1); - } else { - List accountIdList = userClient.getAccountIdsBySchoolId(req.getSchoolId(), PlatformConstant.POST_STATION); - //为满足非超管、管理员的角色情况下能看到本人及超管、管理员角色发布的项目 由此将当前用户的账号id赋值进去List - accountIdList.add(req.getAccountId()); - map.put("accountIdList", accountIdList); - } - - List assessments = mapper.pageByCondition(map); - - for (Assessment ass : assessments) { - List classList = new ArrayList<>(); - for (String classId : ass.getClassId().split(",")) { - Class classInfo = classMapper.selectById(classId); - classList.add(classInfo); - } - ass.setClassInfo(classList); - } - - return assessments; - } - - @Override - public Integer pageByConditionNum(PageAssessmentReq req) { - Map map = new HashMap(); - - map.put("month", req.getMonth()); - map.put("type", req.getType()); - map.put("status", req.getStatus()); - map.put("curriculumId", req.getCurriculumId()); - map.put("keyWord", req.getKeyWord()); - map.put("pageNum", (req.getPageNum() - 1) * req.getPageSize()); - map.put("pageSize", req.getPageSize()); - map.put("schoolId", req.getSchoolId()); - map.put("startTime", req.getStartTime()); - map.put("endTime", req.getEndTime()); - - map.put("accountId", req.getAccountId()); - map.put("mallId", req.getMallId()); - map.put("isAdmin", 0); - - String roleName = userClient.getUserAllRole(req.getAccountId() + "", 1); - if (roleName.contains("超级管理员") || roleName.contains("管理员")) { - //依据角色查询本校内的项目(超管管理员角色、管理员角色能看到全部考核列表 其它角色只能看到自己发布的) - map.put("isAdmin", 1); - } else { - List accountIdList = userClient.getAccountIdsBySchoolId(req.getSchoolId(), PlatformConstant.POST_STATION); - //为满足非超管、管理员的角色情况下能看到本人及超管、管理员角色发布的项目 由此将当前用户的账号id赋值进去List - accountIdList.add(req.getAccountId()); - map.put("accountIdList", accountIdList); - } - - Integer total = mapper.pageByConditionNum(map).size(); - return total; - } - - @Override - public List pageStuAssessment(PageStuAssessmentReq req) { - Map map = new HashMap(); - map.put("accountId", req.getAccountId()); - map.put("month", req.getMonth()); - map.put("status", req.getStatus()); - map.put("curriculumId", req.getCurriculumId()); - map.put("keyWord", req.getKeyWord()); - map.put("classId", req.getClassId()); - map.put("pageNum", (req.getPageNum() - 1) * req.getPageSize()); - map.put("pageSize", req.getPageSize()); - map.put("schoolId", req.getSchoolId()); - map.put("startTime", req.getStartTime()); - map.put("endTime", req.getEndTime()); - map.put("mallId", req.getMallId()); - List assessments = mapper.pageStuAssessment(map); - - return assessments; - } - - @Override - public Integer pageStuAssessmentNum(PageStuAssessmentReq req) { - /*Map map = new HashMap(); - map.put("month", req.getMonth()); - map.put("accountId", req.getAccountId()); - map.put("keyWord", req.getKeyWord()); - map.put("status", req.getStatus()); - map.put("sysName", req.getSysName()); - map.put("classId", req.getClassId()); - map.put("pageNum", (req.getPageNum() - 1) * req.getPageSize()); - map.put("pageSize", req.getPageSize()); - map.put("schoolId", req.getSchoolId()); - map.put("startTime", req.getStartTime()); - map.put("endTime", req.getEndTime());*/ - - Map map = new HashMap(); - map.put("accountId", req.getAccountId()); - map.put("month", req.getMonth()); - map.put("status", req.getStatus()); - map.put("curriculumId", req.getCurriculumId()); - map.put("keyWord", req.getKeyWord()); - map.put("classId", req.getClassId()); - map.put("pageNum", (req.getPageNum() - 1) * req.getPageSize()); - map.put("pageSize", req.getPageSize()); - map.put("schoolId", req.getSchoolId()); - map.put("startTime", req.getStartTime()); - map.put("endTime", req.getEndTime()); - map.put("mallId", req.getMallId()); - List num = mapper.pageStuAssessmentNum(map); - /*Integer countNum = 0; - for (Integer count : num) { - countNum += count; - }*/ - return num.size(); - } - - @Override - public R saveAssessment(AssessmentReq req) throws ParseException { - - Assessment assessment = new Assessment(); - if (StringUtils.isNotEmpty(req.getStartTime())) { - //校验考核开始结束时间与当前时间对比 - if (CheckDateUtil.checStartkTime(req.getStartTime()) == false) { - return R.error("考试开始时间不能小于当前时间"); - } - } - if (StringUtils.isNotEmpty(req.getStopTime())) { - if (CheckDateUtil.checStartkTime(req.getStopTime()) == false) { - return R.error("考试结束时间不能小于当前时间"); - } - } - //检验名称是否有相同的 - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("experimental_name", req.getExperimentalName()); - queryWrapper.eq("is_del", DelConstant.NOT_DEL); - queryWrapper.eq("school_id", req.getSchoolId()); - if (baseMapper.selectOne(queryWrapper) != null) { - return R.error("考核名称不能重复!"); - } - - //指定范围(0无指定范围 1指定范围) - if (req.getIsSpecify() == 0) { - //remark:创建无指定范围时候不同时对学生考试表进行新增操作 - req.setClassId("1");//无指定范围测classId为1 - } else { - if (StringUtils.isEmpty(req.getClassId())) { - return R.error("指定范围班级id不能为空"); - } - } - - //复制属性 - BeanUtils.copyProperties(req, assessment); - //添加学生考核考试记录 - SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - - if (req.getStartTime() != null) { - ParsePosition pos = new ParsePosition(0); - Date strtodate = formatter.parse(req.getStartTime(), pos); - assessment.setStartTime(strtodate); - } - - if (req.getStartTime() != null) { - ParsePosition pos1 = new ParsePosition(0); - Date stopdate = formatter.parse(req.getStopTime(), pos1); - assessment.setStopTime(stopdate); - } - - int addRet = mapper.insert(assessment); - Integer type = assessment.getType(); - //定时发布添加定时开启和关闭 -// if (type == 2) { -// DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); -// Integer startTaskId = xxlJobService.addJustExecuteOnceJob(assessment.getId() + "start", dateFormat.parse(dateFormat.format(assessment.getStartTime())), assessment.getId().toString(), "assessmentJobStart"); -// //开始运行开启考核任务 -// xxlJobService.start(startTaskId); -// -// Integer stopTaskId = xxlJobService.addJustExecuteOnceJob(assessment.getId() + "stop", dateFormat.parse(dateFormat.format(assessment.getStopTime())), assessment.getId().toString(), "assessmentJobStop"); -// //开始运行停止考核任务 -// xxlJobService.start(stopTaskId); -// } - - if (req.getIsSpecify() == 1) { - //remark:为指定范围时 需要对选择班级下的学生对学生考试表做新增操作 - for (ClassReq stuAccount : assessment.getStuInfo()) { - AssessmentExam exam = new AssessmentExam(); - exam.setAssessmentId(assessment.getId()); - exam.setAccountId(stuAccount.getStuAccountId()); - exam.setClassId(stuAccount.getClassId()); - exam.setState(AssessmentConstant.EXAMINATION_STATE_NOT_START); - examMapper.insert(exam); - } - } - - return addRet > 0 ? R.ok() : R.error(); - } - - @Override - public R deleteAssessment(List ids) { - for (Integer id : ids) { - QueryWrapper queryWrapper = new QueryWrapper(); - queryWrapper.eq("assessment_id", id); - examMapper.delete(queryWrapper); - - /* //定时时间修改,删除之前定时任务 - Integer removeStartTaskId = xxlJobService.getJobIdByCustomId(id+"start"); - Integer removeStopTaskId = xxlJobService.getJobIdByCustomId(id+"stop"); - //删除任务 - xxlJobService.remove(removeStartTaskId); - xxlJobService.remove(removeStopTaskId);*/ - - } - int ret = baseMapper.deleteBatchIds(ids); - return ret > 0 ? R.ok() : R.error(); - } - - @Override - public R modifyAssessment(Assessment ass) throws ParseException { - - //指定范围(0无指定范围 1指定范围) - if (ass.getIsSpecify() == 0) { - //remark:创建无指定范围时候不同时对学生考试表进行新增操作 - ass.setClassId("1");//无指定范围测classId为1 - //删除原有考试表中的信息 - examMapper.delete(new QueryWrapper().eq("assessment_id", ass.getId())); - } else { - if (StringUtils.isEmpty(ass.getClassId())) { - return R.error("指定范围班级id不能为空"); - } - } - int ret = 0; - //assessment:查看更改前的考核详情 - Assessment assessment = baseMapper.selectById(ass.getId()); - - //删除已存在的考核定时任务 -// Integer removeStartTaskId = xxlJobService.getJobIdByCustomId(ass.getId() + "start"); -// Integer removeStopTaskId = xxlJobService.getJobIdByCustomId(ass.getId() + "stop"); -// //删除任务 -// if (!ObjectUtils.isEmpty(removeStartTaskId)) { -// xxlJobService.remove(removeStartTaskId); -// } -// if (!ObjectUtils.isEmpty(removeStopTaskId)) { -// xxlJobService.remove(removeStopTaskId); -// } -// // 判断当前考核类型已做变更 -// if (assessment.getType() != ass.getType()) { -// /*根据当前选择的考核类型处理相应操作*/ -// switch (ass.getType()) {//发布类型(1、手动发布 2、定时发布) -// case 1: -// //将原有的定时发布时间 起始结束时间置空 -// ass.setStartTime(null); -// ass.setStopTime(null); -// break; -// case 2: -// DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); -// //新增新任务 -// Integer startTaskId = xxlJobService.addJustExecuteOnceJob(assessment.getId() + "start", dateFormat.parse(dateFormat.format(ass.getStartTime())), assessment.getId().toString(), "assessmentJobStart"); -// //开始运行开启考核任务 -// xxlJobService.start(startTaskId); -// -// Integer stopTaskId = xxlJobService.addJustExecuteOnceJob(assessment.getId() + "stop", dateFormat.parse(dateFormat.format(ass.getStopTime())), assessment.getId().toString(), "assessmentJobStop"); -// //开始运行停止考核任务 -// xxlJobService.start(stopTaskId); -// break; -// -// } -// } - - - - - - - /*String time = ""; - if (assessment.getType() == 1) {//发布类型(1、手动发布 2、定时发布) - if (!ObjectUtils.isEmpty(ass.getExperimentDuration())) { - time = ass.getExperimentDuration(); - } else { - time = assessment.getExperimentDuration(); - - } - int d = time.indexOf("d"); - int h = time.indexOf("h"); - int m = time.indexOf("m"); - int dd = Integer.parseInt(time.substring(0, d)); - int hh = Integer.parseInt(time.substring(d + 1, h)); - int mm = Integer.parseInt(time.substring(h + 1, m)); - int newTime = dd * 24 * 60 + hh * 60 + mm; - - Calendar nowTime = Calendar.getInstance(); - Date date = new Date(); - nowTime.setTime(date); - nowTime.add(Calendar.MINUTE, newTime); - ass.setStopTime(nowTime.getTime()); - }else { - DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - //定时时间修改,删除之前定时任务 - Integer removeStartTaskId = xxlJobService.getJobIdByCustomId(ass.getId()+"start"); - Integer removeStopTaskId = xxlJobService.getJobIdByCustomId(ass.getId()+"stop"); - //删除任务 - if (!ObjectUtils.isEmpty(removeStartTaskId)){ - xxlJobService.remove(removeStartTaskId); - } - if (!ObjectUtils.isEmpty(removeStopTaskId)){ - xxlJobService.remove(removeStopTaskId); - } - //新增新任务 - Integer startTaskId = xxlJobService.addJustExecuteOnceJob( - assessment.getId()+"start", - dateFormat.parse(dateFormat.format(assessment.getStartTime())), - assessment.getId().toString(),"assessmentJobStart"); - //开始运行开启考核任务 - xxlJobService.start(startTaskId); - - Integer stopTaskId = xxlJobService.addJustExecuteOnceJob( - assessment.getId()+"stop", - dateFormat.parse(dateFormat.format(assessment.getStopTime())), - assessment.getId().toString(),"assessmentJobStop"); - //开始运行停止考核任务 - xxlJobService.start(stopTaskId); - }*/ - //学生列表不为空表示修改了学生列表 需对考试表进行删除 - if (!ass.getClassId().equals("1")) { - if (!ObjectUtils.isEmpty(ass.getStuInfo())) { - //先删除原有的再新增 - examMapper.delete(new QueryWrapper().eq("assessment_id", ass.getId())); - - for (ClassReq classreq : ass.getStuInfo()) { - examMapper.insert(new AssessmentExam().setAssessmentId(ass.getId()).setAccountId(classreq.getStuAccountId()).setClassId(classreq.getClassId())); - } - } - } - ret = baseMapper.updateById(ass); - return ret > 0 ? R.ok() : R.error(); - } - - @Override - public R getDetailById(Integer id) { - Assessment assessment = baseMapper.selectById(id); - List list = new ArrayList(); - //将classId循环出来获取到班级名称 - for (String classId : assessment.getClassId().split(",")) { - //根据班级id查询班级名称 - QueryWrapper queryWrapper1 = new QueryWrapper<>(); - queryWrapper1.eq("is_del", DelConstant.NOT_DEL); - queryWrapper1.eq("id", classId); - Class classes = classMapper.selectOne(queryWrapper1); - Class cla = new Class(); - cla.setId(Integer.valueOf(classes.getId())); - cla.setClassName(classes.getClassName()); - list.add(cla); - } - - List classReqList = new ArrayList(); - //当本次考核为指定范围时候 查询本次考核的所有学生 - if (assessment.getIsSpecify() == 1) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("assessment_id", assessment.getId()); - List assessmentExam = examMapper.selectList(queryWrapper); - - for (AssessmentExam exam : assessmentExam) { - ClassReq req = new ClassReq(); - req.setClassId(exam.getClassId()); - req.setStuAccountId(exam.getAccountId()); - classReqList.add(req); - - } - } - - assessment.setClassInfo(list); - assessment.setStuInfo(classReqList); - return R.ok().put("data", assessment); - } - - @Override - public R collectPaper(Integer id) { - //执行收卷操作需要对考核表考核状态进行修改以及学生考试表进行对学生考试状态修改 - Assessment assessment = new Assessment(); - assessment.setStatus(AssessmentConstant.EXAMINATION_STATE_STOP);//设置考核状态为已结束 - assessment.setId(id); - assessment.setStopTime(new Date()); - int ret = baseMapper.updateById(assessment); -// if (ret > 0) { -// //提前结束删除定时停止任务 -// Integer taskId = xxlJobService.getJobIdByCustomId(id + "stop"); -// //删除任务 -// xxlJobService.remove(taskId); -// -// QueryWrapper queryWrapper = new QueryWrapper<>(); -// queryWrapper.eq("assessment_id", id); -// List examList = examMapper.selectList(queryWrapper); -// -// if (examList.size() > 0) { -// //对学生考核表考核状态进行修改 -// UpdateWrapper updateWrapper = new UpdateWrapper<>(); -// updateWrapper.set("state", AssessmentConstant.EXAMINATION_STATE_STOP); -// updateWrapper.ne("state", AssessmentConstant.EXAMINATION_STATE_STOP); -// updateWrapper.set("stop_time", new Date()); -// updateWrapper.eq("assessment_id", id); -// //对考核状态不为已结束的修改状态 -// examMapper.update(new AssessmentExam(), updateWrapper); -// } -// -// } - return ret > 0 ? R.ok() : R.error(); - } - - @Transactional - @Override - public R enterExam(Integer assessmentId, Integer classId, Integer invitationCode, HttpServletRequest request) { - - String accountId = TokenUtils.getIdByJwtToken(request); - //根据考核id获取到考核信息 用于判断为第几种情况 - Assessment assessment = baseMapper.selectById(assessmentId); - //校验当启用验证码时候 输入的验证码为空弹出相应提示 - if (assessment.getIsEnableCode() == AssessmentConstant.IS_ENABLE_CODE) {//如果查询的考核启用验证码时候 - if (invitationCode == null) { - return R.error(ExceptionEnum.ASSESSMENT_ENABLE_CODE_NULL.getCode(), ExceptionEnum.ASSESSMENT_ENABLE_CODE_NULL.getMsg()); - } else if (!invitationCode.equals(assessment.getInvitationCode())) { - //校验输入的验证码是否与考核设置的验证码相匹配 - return R.error(ExceptionEnum.ASSESSMENT_ENABLE_CODE_NULL.getCode(), ExceptionEnum.ASSESSMENT_ENABLE_CODE_NULL.getMsg()); - } - - } - - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("assessment_id", assessmentId); - queryWrapper.eq("account_id", accountId); - queryWrapper.eq("class_id", classId); - - AssessmentExam exam = examMapper.selectOne(queryWrapper); - if (exam == null) { - AssessmentExam addExam = new AssessmentExam(); - addExam.setAssessmentId(assessmentId); - addExam.setState(AssessmentConstant.EXAMINATION_STATE_START); - addExam.setClassId(classId); - addExam.setAccountId(Integer.valueOf(accountId)); - addExam.setExamTime(new Date()); - int inserRet = examMapper.insert(addExam); - if (inserRet < 1) { - throw new CustomException(ExceptionEnum.ENTER_EXAM_FAIL); - } - - } else { - - //进入考试将状态更改完进行中且添加学生开考时间 - UpdateWrapper updateWrapper = new UpdateWrapper<>(); - updateWrapper.set("state", AssessmentConstant.EXAMINATION_STATE_START); - updateWrapper.set("exam_time", new Date()); - updateWrapper.eq("assessment_id", assessmentId); - updateWrapper.eq("account_id", accountId); - updateWrapper.eq("class_id", classId); - - int updateRet = examMapper.update(new AssessmentExam(), updateWrapper); - if (updateRet < 1) { - throw new CustomException(ExceptionEnum.ENTER_EXAM_FAIL); - } - } - - EnterExamResp examResp = mapper.getUrl(assessmentId); - - //返回当前项目id及邀请码以及跳转路径 - return R.ok().put("projectId", assessment.getProjectId()).put("invitationCode", assessment.getInvitationCode()).put("assessmentInfo", assessment).put("url", examResp.getUrl()).put("info", examResp); - } - - @Override - public R getMineClass(Integer accountId) { - String throughLine = mapper.getMineClass(accountId); - - if (StringUtils.isNotEmpty(throughLine)) { - //将字符串变成数组,然后利用stream流变成集合 - List throughLines = Arrays.stream(throughLine.split(",")).collect(Collectors.toList()); - //利用stream流将集合去重 - List throughLineList = throughLines.stream().distinct().collect(Collectors.toList()); - //然后再用Stringuitls.join将集合变成逗号分开的字符串 - String thoughLineTarget = StringUtils.join(throughLineList, ","); - List classIdList = new ArrayList<>(); - for (String classId : thoughLineTarget.split(",")) { - if (!classId.equals("")) { - classIdList.add(Integer.valueOf(classId)); - } - - } - - List classList = classMapper.selectBatchIds(classIdList); - for (Class cla : classList) { - //拿到班级的上级年级以及上上级专业 - - if (cla.getId() != 1) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("id", cla.getArchitectureId()); - Architecture getGrade = architectureMapper.selectOne(wrapper); - //根据年级拿到专业信息 - QueryWrapper wrapper1 = new QueryWrapper<>(); - wrapper1.eq("id", getGrade.getParentId()); - Architecture getProfessional = architectureMapper.selectOne(wrapper1); - cla.setClassName(getProfessional.getOrganizationName() + "/" + getGrade.getOrganizationName() + "/" + cla.getClassName()); - } - } - return R.ok().put("list", classList); - - } - return R.ok(); - } - - @Override - public Set myClassByStudent(Integer accountId, Integer schoolId) { - List list = baseMapper.myClassByStudent(accountId, schoolId); - Set set = new HashSet<>(); - List classList = new ArrayList<>(); - list.stream().forEach(str -> { - if (str != null) { - if (str.contains(",")) { - for (String classId : str.split(",")) { - classList.add(classId); - set.addAll(new HashSet(classList)); - - } - } else { - classList.add(str); - set.addAll(new HashSet(classList)); - } - } - }); - return set; - } - - @Override - public R enableAssessment(Integer id) throws ParseException { - int ret = 0; - Assessment assessment = baseMapper.selectById(id); - assessment.setStatus(1);//状态(0、待开始 1、进行中 2、已结束) - if (assessment.getType() == 1) {//发布类型(1、手动发布 2、定时发布) - String time = assessment.getExperimentDuration(); - int d = time.indexOf("d"); - int h = time.indexOf("h"); - int m = time.indexOf("m"); - int dd = Integer.parseInt(time.substring(0, d)); - int hh = Integer.parseInt(time.substring(d + 1, h)); - int mm = Integer.parseInt(time.substring(h + 1, m)); - int newTime = dd * 24 * 60 + hh * 60 + mm; - Calendar nowTime = Calendar.getInstance(); - Date date = new Date(); - nowTime.setTime(date); - nowTime.add(Calendar.MINUTE, newTime); - assessment.setStopTime(nowTime.getTime()); - assessment.setStartTime(new Date()); - - } - //assessment.setIsEnableCode(1); - ret = baseMapper.updateById(assessment); - -// SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); -// Integer stopTaskId = xxlJobService.addJustExecuteOnceJob(assessment.getId() + "stop", dateFormat.parse(dateFormat.format(assessment.getStopTime())), assessment.getId().toString(), "assessmentJobStop"); -// //开始运行停止考核任务 -// xxlJobService.start(stopTaskId); - - return ret > 0 ? R.ok() : R.error(); - } - - @Override - public boolean checkReapt(Assessment assessment) { - //检验名称是否有相同的 - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("experimental_name", assessment.getExperimentalName()); - queryWrapper.eq("is_del", DelConstant.NOT_DEL); - queryWrapper.eq("school_id", assessment.getSchoolId()); - if (assessment.getId() != null) { - queryWrapper.last(" and id != " + assessment.getId()); - } - - return baseMapper.selectOne(queryWrapper) == null; - } - - @Override - public boolean submitExam(Integer assessmentId, Integer classId, Integer accountId, Integer score) { - - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("assessment_id", assessmentId); - queryWrapper.eq("account_id", accountId); - queryWrapper.eq("class_id", classId); - AssessmentExam exam = examMapper.selectOne(queryWrapper); - - UpdateWrapper updateWrapper = new UpdateWrapper<>(); - updateWrapper.set("state", 2);//考试状态(0、未考 1、在考 2、已考) - updateWrapper.set("stop_time", new Date()); - updateWrapper.set("time_cost", Long.valueOf(((new Date().getTime() - exam.getExamTime().getTime()) / 1000 / 60)).intValue()); - updateWrapper.set("score", score); - updateWrapper.eq("assessment_id", assessmentId); - updateWrapper.eq("account_id", accountId); - updateWrapper.eq("class_id", classId); - Integer ret = examMapper.update(new AssessmentExam(), updateWrapper); - return ret > 0; - } - - @Override - public R spliceClass(Integer assessmentId) { - String throughLine = mapper.spliceClass(assessmentId); - - if (StringUtils.isNotEmpty(throughLine)) { - //将字符串变成数组,然后利用stream流变成集合 - List throughLines = Arrays.stream(throughLine.split(",")).collect(Collectors.toList()); - //利用stream流将集合去重 - List throughLineList = throughLines.stream().distinct().collect(Collectors.toList()); - //然后再用Stringuitls.join将集合变成逗号分开的字符串 - String thoughLineTarget = StringUtils.join(throughLineList, ","); - List classIdList = new ArrayList<>(); - for (String classId : thoughLineTarget.split(",")) { - if (!classId.equals("")) { - classIdList.add(Integer.valueOf(classId)); - } - - } - - List classList = classMapper.selectBatchIds(classIdList); - for (Class cla : classList) { - //拿到班级的上级年级以及上上级专业 - - if (cla.getId() != 1) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("id", cla.getArchitectureId()); - Architecture getGrade = architectureMapper.selectOne(wrapper); - //根据年级拿到专业信息 - QueryWrapper wrapper1 = new QueryWrapper<>(); - wrapper1.eq("id", getGrade.getParentId()); - Architecture getProfessional = architectureMapper.selectOne(wrapper1); - cla.setClassName(getProfessional.getOrganizationName() + "/" + getGrade.getOrganizationName() + "/" + cla.getClassName()); - } - } - return R.ok().put("list", classList); - - } - return R.ok(); - } - - public static void main(String[] args) { - String throughLine = "6"; - //将字符串变成数组,然后利用stream流变成集合 - List throughLines = Arrays.stream(throughLine.split(",")).collect(Collectors.toList()); - //利用stream流将集合去重 - List throughLineList = throughLines.stream().distinct().collect(Collectors.toList()); - //然后再用Stringuitls.join将集合变成逗号分开的字符串 - String thoughLineTarget = StringUtils.join(throughLineList, ","); - System.out.println(thoughLineTarget); - } - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/CityServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/CityServiceImpl.java deleted file mode 100644 index 0f3bfcd..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/CityServiceImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.huoran.occupationlab.entity.City; -import com.huoran.occupationlab.mapper.CityMapper; -import com.huoran.occupationlab.service.CityService; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - *

- * 城市 服务实现类 - *

- * - * @author Ning - * @since 2020-10-27 - */ -@Service -public class CityServiceImpl extends ServiceImpl implements CityService { - @Override - public List queryCity(Integer provinceId) { - QueryWrapper chapterWrapper = new QueryWrapper<>(); - chapterWrapper.eq("provinceId",provinceId); - chapterWrapper.select("*"); - return baseMapper.selectList(chapterWrapper); - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ClassServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ClassServiceImpl.java deleted file mode 100644 index 4cca60e..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ClassServiceImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.common.constant.DelConstant; -import com.huoran.occupationlab.entity.Class; -import com.huoran.occupationlab.mapper.ClassMapper; -import com.huoran.occupationlab.service.ClassService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - *

- * 班级表 服务实现类 - *

- * - * @author lr - * @since 2021-08-18 - */ -@Service -public class ClassServiceImpl extends ServiceImpl implements ClassService { - - @Override - public List chenckReapt(Class classes) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("is_del", DelConstant.NOT_DEL); - queryWrapper.eq("architecture_id", classes.getArchitectureId()); - queryWrapper.eq("class_name", classes.getClassName()); - if (classes.getId() != null) { - queryWrapper.last(" and id != " + classes.getId()); - } - - List classList = baseMapper.selectList(queryWrapper); - return classList; - } - - @Override - public List getClassesUnderTheSchool(Integer schoolId) { - return baseMapper.getClassesUnderTheSchool(schoolId); - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ClientManagementServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ClientManagementServiceImpl.java deleted file mode 100644 index 9f78b07..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ClientManagementServiceImpl.java +++ /dev/null @@ -1,131 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.huoran.common.entity.NewClientManagement; -import com.huoran.occupationlab.entity.ClientManagement; -import com.huoran.occupationlab.mapper.ClientManagementMapper; -import com.huoran.occupationlab.service.ClientManagementService; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.HashMap; -import java.util.List; - -/** - *

- * 企业端客户管理 服务实现类 - *

- * - * @author Ning - * @since 2020-10-27 - */ -@Service -public class ClientManagementServiceImpl extends ServiceImpl implements ClientManagementService { - - @Autowired - private ClientManagementMapper mapper; - - //查询客户列表 - @Override - public List queryList(HashMap map) { - Object cityId = map.get("cityId"); - Object provinceId = map.get("provinceId"); - Object searchContent = map.get("searchContent"); - QueryWrapper wrapper = new QueryWrapper<>(); - if (cityId != null) { - wrapper.eq("city_id", cityId); - } - if (provinceId != null) { - wrapper.eq("province_id", provinceId); - } - if (searchContent != null && searchContent != "") { - wrapper.like("client_name", searchContent).or().like("contact_person_name", searchContent).or().like("phone", searchContent); - } - wrapper.ne("id", 1); - return mapper.queryList(map); - } - - //查询客户列表数量 - @Override - public int queryListCount(HashMap map) { - Object cityId = map.get("cityId"); - Object provinceId = map.get("provinceId"); - Object searchContent = map.get("searchContent"); - QueryWrapper wrapper = new QueryWrapper<>(); - if (cityId != null) { - wrapper.eq("city_id", cityId); - } - if (provinceId != null) { - wrapper.eq("province_id", provinceId); - } - if (searchContent != null) { - wrapper.like("client_name", searchContent); - } - wrapper.ne("id", 1); - return baseMapper.selectCount(wrapper); - } - - //添加客户 - @Override - public boolean addClient(ClientManagement clientManagement) { - int size = baseMapper.insert(clientManagement); - return size > 0; - } - - //批量删除客户 - @Override - public boolean deleteClient(List clientIds) { - int size = baseMapper.deleteBatchIds(clientIds); - int sum = clientIds.size(); - for (int i = 0; i < sum; i++) { - Integer clientId = clientIds.get(i); - //删除该客户下的所有用户 - int deteleUser = baseMapper.deleteUser(clientId); - //删除该客户下的所有员工 - int deteleStaff = baseMapper.deleteStaff(clientId); - //删除该客户下的所有员工 - int deteleStudent = baseMapper.deleteStudent(clientId); - } - return size > 0; - } - - //修改客户 - @Override - public boolean updateClient(ClientManagement clientManagement) { - int size = baseMapper.updateById(clientManagement); - return size > 0; - } - - //查询客户列表数量 - @Override - public int queryClientNameSize(String clientName) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("client_name", clientName); - return baseMapper.selectCount(wrapper); - } - - //查询客户名称 - @Override - public List getClientName(String clientName) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("client_name", clientName); - return baseMapper.selectList(wrapper); - } - - //查询客户名称 - @Override - public NewClientManagement queryOneClient(String clientName) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("client_name", clientName); - NewClientManagement newClientManagement = new NewClientManagement(); - ClientManagement clientManagement = baseMapper.selectOne(wrapper); - if (clientManagement != null) { - BeanUtils.copyProperties(clientManagement, newClientManagement); - return newClientManagement; - } else { - return null; - } - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ColumnServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ColumnServiceImpl.java deleted file mode 100644 index 1d7aaa5..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ColumnServiceImpl.java +++ /dev/null @@ -1,209 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.huoran.occupationlab.entity.Column; -import com.huoran.occupationlab.entity.vo.ColumnSort; -import com.huoran.occupationlab.entity.vo.ColumnTree; -import com.huoran.occupationlab.mapper.ColumnMapper; -import com.huoran.occupationlab.service.ColumnService; -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.List; - -/** - *

- * 栏目表 服务实现类 - *

- * - * @author chen - * @since 2020-10-15 - */ -@Service -public class ColumnServiceImpl extends ServiceImpl implements ColumnService { - - @Override - public boolean updateSort(ColumnSort columnSort) { - /*List firstColumnList = columnSort.getColumnTree(); - if (firstColumnList != null && firstColumnList.size() != 0) { - firstColumnList.forEach(firstColumn -> { - Column column1 = new Column(); - BeanUtils.copyProperties(firstColumn, column1); - baseMapper.updateById(column1); - List secondColumnList = firstColumn.getSecondColumn(); - if (secondColumnList != null && secondColumnList.size() != 0) { - secondColumnList.forEach(secondColumn -> { - Column column2 = new Column(); - BeanUtils.copyProperties(secondColumn, column2); - baseMapper.updateById(column2); - }); - } - }); - return true; - }*/ - //获取所有栏目 - List columnTree = columnSort.getColumnTree(); - update(columnTree); - return true; - } - - /** - * 使用递归方法 - */ - public void update(List columns) { - int count = 1; - for (ColumnTree column : columns) { - Column column1 = new Column(); - column1.setSort(count++); - BeanUtils.copyProperties(column, column1); - baseMapper.updateById(column1); - if (ObjectUtil.isNotNull(column.getChildren()) && column.getChildren().size()>0){ - update(column.getChildren()); - /*for (ColumnTree child : column.getChildren()) { - Column column2 = new Column(); - BeanUtils.copyProperties(child, column2); - baseMapper.updateById(column2); - if (ObjectUtil.isNotNull(child.getChildren()) && child.getChildren().size()>0){ - - } - }*/ - } - } - } - - @Override - public List columnTree(Integer schoolId,String platformId) { - QueryWrapper columnWrapper = new QueryWrapper<>(); - columnWrapper.eq("school_id", schoolId); - // columnWrapper.eq("platform_id", platformId); - columnWrapper.orderByAsc("sort"); - List columns = baseMapper.selectList(columnWrapper); - return build(columns); - } - - /** - * 使用递归方法构建权限菜单 - */ - public List build(List columns) { - List trees = new ArrayList<>(); - for (Column column : columns) { - if (column.getParentId()==0) { - trees.add(findChildren(column, columns)); - } - } - return trees; - } - - /** - * 递归查找子节点 - */ - public Column findChildren(Column treeNode, List treeNodes) { - treeNode.setChildren(new ArrayList<>()); - - for (Column it : treeNodes) { - - if (treeNode.getId().equals(it.getParentId())) { - if (treeNode.getChildren() == null) { - treeNode.setChildren(new ArrayList<>()); - } - treeNode.getChildren().add(findChildren(it, treeNodes)); - } - } - return treeNode; - } - - @Override - public boolean saveColumn(Column column) { - //添加栏目时查询一级栏目数量 - /*if (column.getParentId()==0) { - //查询一级栏目的总数 - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("parent_id", 0); - wrapper.eq("platform_id", column.getPlatformId()); - wrapper.eq("school_id", column.getSchoolId()); - int count = baseMapper.selectCount(wrapper); - if (count == 10) { - throw new CustomException(ExceptionEnum.ADD_COLUMNS_FAILED); - } - //没有一级栏目时,序号为1 - if (count == 0) { - column.setSort(1); - } else { - //查询一级栏目最大排序数 - count = baseMapper.selectFirstMaxSort(); - column.setSort(count + 1); - } - int insert = baseMapper.insert(column); - return insert > 0; - } - //查询二级栏目的总数 - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("parent_id", column.getParentId()); - wrapper.eq("school_id", column.getSchoolId()); - wrapper.eq("platform_id", column.getPlatformId()); - int count = baseMapper.selectCount(wrapper); - //没有二级栏目时,序号为1 - if (count == 0) { - column.setSort(1); - } else { - //查询二级栏目最大排序数 - count = baseMapper.selectSecondMaxSort(column.getParentId(), column.getSchoolId()); - column.setSort(count + 1); - }*/ - int insert = baseMapper.insert(column); - return insert > 0; - } - - @Override - public boolean removeColumn(Integer columnId) { - /*//查询当前分类下的所有子分类,0为分类,1为团队 - List ids = baseMapper.selectIdByPid(columnId); - ids.add(columnId);*/ - - - //批量进行删除 - int i = baseMapper.deleteById(columnId); - return i>0; - } - - @Override - public boolean repeat(Column column) { - Integer parentId = column.getParentId(); - String name = column.getName(); - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("parent_id", parentId); - wrapper.eq("name", name); - // wrapper.eq("platform_id", column.getPlatformId()); - wrapper.eq("school_id", column.getSchoolId()); - if (column.getId() != null) { - wrapper.last(" and id != " + column.getId()); - } - Integer count = baseMapper.selectCount(wrapper); - return count > 0; - } - - @Override - public List firstLevelColumn(Integer schoolId) { - //一级栏目查询 - QueryWrapper firstColumnWrapper = new QueryWrapper<>(); - firstColumnWrapper.eq("parent_id", 1); - firstColumnWrapper.eq("school_id", schoolId); - firstColumnWrapper.orderByAsc("sort"); - List firstColumns = baseMapper.selectList(firstColumnWrapper); - return firstColumns; - } - - @Override - public List secondaryColumnsByFirst(String id, Integer schoolId) { - //二级栏目查询 - QueryWrapper secondColumnWrapper = new QueryWrapper<>(); - secondColumnWrapper.eq("parent_id", id); - secondColumnWrapper.eq("school_id", schoolId); - secondColumnWrapper.orderByAsc("sort"); - List secondColumns = baseMapper.selectList(secondColumnWrapper); - return secondColumns; - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ContestAnnexServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ContestAnnexServiceImpl.java deleted file mode 100644 index d609f78..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ContestAnnexServiceImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.common.constant.DelConstant; -import com.huoran.occupationlab.entity.ContestAnnex; -import com.huoran.occupationlab.entity.ContestRange; -import com.huoran.occupationlab.mapper.ContestAnnexMapper; -import com.huoran.occupationlab.service.ContestAnnexService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - *

- * 赛事附件 服务实现类 - *

- * - * @author lr - * @since 2022-06-16 - */ -@Service -public class ContestAnnexServiceImpl extends ServiceImpl implements ContestAnnexService { - - @Override - public List getContestAnnexByContestId(String contestId) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("contest_id",contestId); - queryWrapper.eq("is_del", DelConstant.NOT_DEL); - List contestAnnexList = baseMapper.selectList(queryWrapper); - - return contestAnnexList; - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ContestAnnouncementAnnexServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ContestAnnouncementAnnexServiceImpl.java deleted file mode 100644 index dc0b6d1..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ContestAnnouncementAnnexServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.huoran.occupationlab.entity.ContestAnnouncementAnnex; -import com.huoran.occupationlab.mapper.ContestAnnouncementAnnexMapper; -import com.huoran.occupationlab.service.ContestAnnouncementAnnexService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -/** - *

- * 大赛公告附件存储 服务实现类 - *

- * - * @author lr - * @since 2022-06-17 - */ -@Service -public class ContestAnnouncementAnnexServiceImpl extends ServiceImpl implements ContestAnnouncementAnnexService { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ContestAnnouncementServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ContestAnnouncementServiceImpl.java deleted file mode 100644 index 7e917fa..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ContestAnnouncementServiceImpl.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.ContestAnnouncement; -import com.huoran.occupationlab.entity.vo.ContestVO; -import com.huoran.occupationlab.mapper.ContestAnnouncementMapper; -import com.huoran.occupationlab.service.ContestAnnouncementService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -/** - *

- * 赛事公告 服务实现类 - *

- * - * @author lr - * @since 2022-06-17 - */ -@Service -public class ContestAnnouncementServiceImpl extends ServiceImpl implements ContestAnnouncementService { - - @Override - public R queryAnnouncementByContestId(String contestId,Integer pageNum,Integer pageSize) { - Page page = new Page(pageNum, pageSize); - IPage pageList = baseMapper.queryAnnouncementByContestId(page, contestId); - return R.ok().put("data", pageList); - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ContestProgressServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ContestProgressServiceImpl.java deleted file mode 100644 index f7c5ff6..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ContestProgressServiceImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.huoran.occupationlab.service.impl; - - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.huoran.occupationlab.entity.ContestProgress; -import com.huoran.occupationlab.mapper.ContestProgressMapper; -import com.huoran.occupationlab.service.ContestProgressService; -import org.springframework.stereotype.Service; - -/** - *

- * 竞赛进展表 服务实现类 - *

- * - * @author chen - * @since 2020-10-15 - */ -@Service -public class ContestProgressServiceImpl extends ServiceImpl implements ContestProgressService { - @Override - public boolean repeat(ContestProgress contestProgress) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("title", contestProgress.getTitle()); - wrapper.eq("contest_id", contestProgress.getContestId()); - Integer count = baseMapper.selectCount(wrapper); - return count > 0; - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ContestRangeServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ContestRangeServiceImpl.java deleted file mode 100644 index 5c104e3..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ContestRangeServiceImpl.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.common.constant.DelConstant; -import com.huoran.occupationlab.entity.ContestRange; -import com.huoran.common.entity.School; -import com.huoran.occupationlab.entity.resp.ContestRangeResp; -import com.huoran.occupationlab.mapper.ContestRangeMapper; -import com.huoran.occupationlab.service.ContestRangeService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - *

- * 服务实现类 - *

- * - * @author lr - * @since 2022-06-16 - */ -@Service -public class ContestRangeServiceImpl extends ServiceImpl implements ContestRangeService { - - @Override - public List getContestRangeByContestId(String contestId) { - - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("contest_id", contestId); - queryWrapper.eq("is_del", DelConstant.NOT_DEL); - List contestRangeList = baseMapper.selectList(queryWrapper); - - return contestRangeList; - } - - @Override - public List getRangeByContestId(String contestId) { - return baseMapper.getRangeByContestId(contestId); - } - - @Override - public boolean checkWhetherToParticipate(School school, String contestId) { - //校验地区范围为学校的标准 - QueryWrapper queryWrapper1 = new QueryWrapper<>(); - queryWrapper1.eq("type", 0); - queryWrapper1.eq("is_del", 0); - queryWrapper1.eq("school_id", school.getSchoolId()); - queryWrapper1.eq("contest_id", contestId); - List schoolList1 = baseMapper.selectList(queryWrapper1); - - //校验地区范围为省的标准 - QueryWrapper queryWrapper2 = new QueryWrapper<>(); - queryWrapper2.eq("contest_id", contestId); - queryWrapper2.eq("type", 1); - queryWrapper2.eq("is_del", 0); - queryWrapper2.eq("province_id", school.getProvinceId()); - List schoolList2 = baseMapper.selectList(queryWrapper2); - - //校验地区范围为市的标准 - QueryWrapper queryWrapper3 = new QueryWrapper<>(); - queryWrapper3.eq("type", 1); - queryWrapper3.eq("is_del", 0); - queryWrapper3.eq("province_id", school.getProvinceId()); - queryWrapper3.eq("city_id", school.getCityId()); - queryWrapper3.eq("contest_id", contestId); - List schoolList3 = baseMapper.selectList(queryWrapper3); - - if (schoolList1.size() <= 0 && schoolList2.size() <= 0 && schoolList3.size() <= 0) { - return true; //你所在院校不符合参赛要求,无法报名! - } - - return false; - } - - /*@Override - public List getRangeDetailByContestId(String contestId,Integer type) { - return baseMapper.getRangeDetailByContestId(contestId, type); - }*/ -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ContestServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ContestServiceImpl.java deleted file mode 100644 index 1bee803..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ContestServiceImpl.java +++ /dev/null @@ -1,234 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.Applicant; -import com.huoran.occupationlab.entity.Contest; -import com.huoran.occupationlab.entity.ContestProgress; -import com.huoran.occupationlab.entity.req.AfterLoginPageContestListReq; -import com.huoran.occupationlab.entity.req.PageContestListReq; -import com.huoran.occupationlab.entity.vo.ContestVO; -import com.huoran.occupationlab.mapper.ApplicantMapper; -import com.huoran.occupationlab.mapper.ContestProgressMapper; -import com.huoran.occupationlab.mapper.ContestMapper; -import com.huoran.occupationlab.mapper.ContestRangeMapper; -import com.huoran.occupationlab.service.ContestService; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.HashMap; -import java.util.List; -import java.util.stream.Collectors; - -/** - *

- * 竞赛管理表 服务实现类 - *

- * - * @author chen - * @since 2020-10-15 - */ -@Service -public class ContestServiceImpl extends ServiceImpl implements ContestService { - - @Autowired - private ApplicantMapper applicantMapper; - - @Autowired - private ContestProgressMapper contestProgressMapper; - - - @Autowired - private ContestRangeMapper contestRangeMapper; - - @Override - public boolean removeContest(String contestId) { - // 删除该赛事报名人员数 - QueryWrapper applicantWrapper = new QueryWrapper<>(); - applicantWrapper.eq("contest_id", contestId); - applicantWrapper.select("id"); - List applicants = applicantMapper.selectList(applicantWrapper); - if (applicants != null && applicants.size() != 0) { - List applicantIds = applicants.stream().map(Applicant::getId).collect(Collectors.toList()); - applicantMapper.deleteBatchIds(applicantIds); - } - // 删除赛事进展 - QueryWrapper contestProgressWrapper = new QueryWrapper<>(); - contestProgressWrapper.eq("contest_id", contestId); - contestProgressWrapper.select("id"); - List contestProgressList = contestProgressMapper.selectList(contestProgressWrapper); - if (contestProgressList != null && contestProgressList.size() != 0) { - List contestProgressIds = contestProgressList.stream().map(ContestProgress::getId).collect(Collectors.toList()); - contestProgressMapper.deleteBatchIds(contestProgressIds); - } - // 删除赛事 - int delete = baseMapper.deleteById(contestId); - return delete > 0; - } - - /* @Override - public List contestPageConditionQuery(HashMap map) { - return baseMapper.selectContestByCondition(map); - } - - @Override - public int contestPageConditionCount(HashMap map) { - return baseMapper.selectContestCountByCondition(map); - }*/ - - @Override - public void pageQuery(Page page, String name, String way, Integer schoolId) { - QueryWrapper wrapper = new QueryWrapper<>(); - //查询发布的赛事 - wrapper.eq("publish_status", 0); - wrapper.eq("school_id", schoolId); - if (StringUtils.isNotEmpty(way) && "0".equals(way)) { - //最近更新时间 - wrapper.orderByDesc("gmt_modified"); - } else { - //默然最近报名时间排序 - wrapper.orderByAsc("sign_up_start_time"); - } - if (StringUtils.isNotEmpty(name)) { - wrapper.like("name", name); - } - baseMapper.selectPage(page, wrapper); - } - - /** - * 创建大赛:名字判重逻辑 - * 2022-06.16当前判重逻辑——>比赛范围为非本校内的比赛,名字要全平台判重。本校内的竞赛名字,只需要本校内判重。 - * - * @param contest - * @return - */ - @Override - public boolean repeat(Contest contest) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("name", contest.getName()); - //大赛范围(0:本校内 1:全平台 2:指定区域、院校) - switch (contest.getCompetitionScope()) { - case 0: - wrapper.eq("school_id", contest.getSchoolId()); - break; - } - if (contest.getId()!=null) { - wrapper.last(" and id != " + contest.getId()); - } - Integer count = baseMapper.selectCount(wrapper); - return count > 0; - } - - @Override - public R contestPageConditionQueryByNakadai(PageContestListReq req) { - Page page = new Page(req.getPageNum(), req.getPageSize()); - IPage pageList = baseMapper.contestPageConditionQueryByNakadai(page, req); - return R.ok().put("data", pageList); - } - - @Override - public R contestPageConditionQueryByOccupationlab(PageContestListReq req) { - Page page = new Page(req.getPageNum(), req.getPageSize()); - IPage pageList = baseMapper.contestPageConditionQueryByOccupationlab(page, req); - - //大赛范围(0:本校内 1:全平台 2:指定区域、院校) - pageList.getRecords().forEach(contestVO -> { - if (contestVO.getCompetitionScope() == 1) { - contestVO.setRange("全平台"); - } else if (contestVO.getCompetitionScope() == 2) { - contestVO.setRange("指定范围"); - //依据赛事id查询指定范围的省、市、学校 - contestVO.setContestRangeRespList(contestRangeMapper.getRangeByContestId(contestVO.getId())); - } else if (contestVO.getCompetitionScope() == 0) { - contestVO.setRange("本校内"); - } - }); - return R.ok().put("data", pageList); - } - - - /** - * 学生端——登录前赛事 - * @param pageContestListReq - * @return - */ - @Override - public R notLoggedInBeforeStudentEvents(PageContestListReq pageContestListReq) { - Page page = new Page(pageContestListReq.getPageNum(), pageContestListReq.getPageSize()); - IPage pageList = null; - //大赛范围(0:本校内 1:全平台 2.指定区域、院校) 3表示不限 - switch (pageContestListReq.getCompetitionScope()) { - case "3": - case "1": - pageList = baseMapper.allContestsByStu(page, pageContestListReq); - break; - case "2": - pageList = baseMapper.designatedRangeCompetitionByStu(page, pageContestListReq); - break; - } - - return getR(pageList); - } - - /** - * 学生端——登录后赛事 - * @param req - * @return - */ - @Override - public R contestAfterLogin(AfterLoginPageContestListReq req) { - Page page = new Page(req.getPageNum(), req.getPageSize()); - IPage pageList = null; - //赛事类型(1.本校赛事/2.赛事广场/3.已报名赛事) - switch (req.getEventType()){ - case 1: - pageList = baseMapper.schoolCompetition(page, req); - break; - case 2: - if (req.getCompetitionScope().equals("3")){ - req.setCompetitionScope(null); - } - pageList = baseMapper.tournamentSquare(page,req); - break; - case 3: - - switch (req.getCompetitionScope()){//大赛范围(0:本校内 1:全平台 2.指定区域、院校 3.不限) - //已报名赛事——修改为依据学生报名时间排序 - case "0": - case "1": - case "3": - if (req.getCompetitionScope().equals("3")){ - req.setCompetitionScope(null); - } - pageList =baseMapper.registeredBySchoolAndAllPlatforms(page,req); - break; - case "2": - pageList = baseMapper.registeredBySpecifiedRange(page,req); - break; - - - } - break; - } - return getR(pageList); - } - - private R getR(IPage pageList) { - pageList.getRecords().forEach(contest -> { - if (contest.getCompetitionScope() == 1) { - contest.setRange("全平台"); - } else if (contest.getCompetitionScope() == 2) { - contest.setRange("指定范围"); - //依据赛事id查询指定范围的省、市、学校 - contest.setContestRangeRespList(contestRangeMapper.getRangeByContestId(contest.getId())); - } else if (contest.getCompetitionScope() == 0) { - contest.setRange("本校内"); - } - }); - return R.ok().put("data", pageList); - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/CourseChapterServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/CourseChapterServiceImpl.java deleted file mode 100644 index a2383b3..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/CourseChapterServiceImpl.java +++ /dev/null @@ -1,165 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.aliyun.oss.OSSClient; -import com.aliyuncs.exceptions.ClientException; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.huoran.common.utils.AliyunOssUtil; -import com.huoran.common.utils.VideoUtil; -import com.huoran.occupationlab.entity.CourseChapter; -import com.huoran.occupationlab.entity.CourseSubsection; -import com.huoran.occupationlab.entity.vo.ChapterVO; -import com.huoran.occupationlab.entity.vo.SortVO; -import com.huoran.occupationlab.entity.vo.SubsectionVO; -import com.huoran.occupationlab.mapper.CourseChapterMapper; -import com.huoran.occupationlab.mapper.CourseSubsectionMapper; -import com.huoran.occupationlab.service.CourseChapterService; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.ArrayList; -import java.util.List; - -/** - * 课程章节 服务实现类 - * - * @author chen - * @since 2020-09-30 - */ -@Service -public class CourseChapterServiceImpl extends ServiceImpl implements CourseChapterService { - - @Autowired - private CourseSubsectionMapper courseSubsectionMapper; - - @Override - public List getChapterTree(String courseId) { - // 根据课程ID查询所有章节 - QueryWrapper chapterWrapper = new QueryWrapper<>(); - chapterWrapper.eq("course_id", courseId); - //降序查询 - chapterWrapper.orderByAsc("sort"); - List chapters = baseMapper.selectList(chapterWrapper); - - // 根据课程ID查询所有小节 - QueryWrapper subsectionWrapper = new QueryWrapper<>(); - subsectionWrapper.eq("course_id", courseId); - //降序查询 - subsectionWrapper.orderByAsc("sort"); - List subsections = courseSubsectionMapper.selectList(subsectionWrapper); - - List chapterVOList = new ArrayList<>(); - // 遍历封装 - for (CourseChapter c : chapters) { - ChapterVO chapterVO = new ChapterVO(); - //属性复制 - BeanUtils.copyProperties(c, chapterVO); - chapterVOList.add(chapterVO); - - List subsectionVOList = new ArrayList<>(); - for (CourseSubsection s : subsections) { - //判断小节是否属于某一章节 - if (StringUtils.equals(c.getId(), s.getChapterId())) { - SubsectionVO subsectionVO = new SubsectionVO(); - BeanUtils.copyProperties(s, subsectionVO); - subsectionVOList.add(subsectionVO); - } - } - //设置小节 - chapterVO.setSubsectionList(subsectionVOList); - } - return chapterVOList; - } - - /** - * 删除章节,删除小节及资源 - * - * @param chapterId 章节id - */ - @Transactional - @Override - public boolean removeChapter(String chapterId) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("chapter_id", chapterId); - List courseSubsections = courseSubsectionMapper.selectList(wrapper); - - if (courseSubsections != null && courseSubsections.size() != 0) { - //循环删除小节 - courseSubsections.forEach(subsection -> { - //删除资源 - boolean isVideo = VideoUtil.isVideo(subsection.getFileType()); - if (isVideo) { - try { - AliyunOssUtil.removeVideo(subsection.getFileId()); - } catch (ClientException e) { - e.printStackTrace(); - } - } else { - List keys = new ArrayList<>(); - keys.add(subsection.getFileName()); - try { - AliyunOssUtil.removeMoreVideo(keys); - } catch (ClientException e) { - e.printStackTrace(); - } - } - courseSubsectionMapper.deleteById(subsection.getId()); - }); - } - int count = baseMapper.deleteById(chapterId); - return count > 0; - } - - @Override - public boolean saveChapter(CourseChapter courseChapter) { - //查询课程章节的总数 - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("course_id", courseChapter.getCourseId()); - int count = baseMapper.selectCount(wrapper); - if (count == 0) { - courseChapter.setSort(1); - } else { - //查询课程章节最大排序数 - count = baseMapper.selectMaxSort(); - courseChapter.setSort(count + 1); - } - int insert = baseMapper.insert(courseChapter); - return insert > 0; - } - - @Override - public boolean updateSort(SortVO sortVO) { - List chapterVOList = sortVO.getChapterVOList(); - if (chapterVOList != null && chapterVOList.size() != 0) { - chapterVOList.forEach(chapterVO -> { - CourseChapter courseChapter = new CourseChapter(); - courseChapter.setId(chapterVO.getId()); - courseChapter.setSort(chapterVO.getSort()); - baseMapper.updateById(courseChapter); - List subsectionList = chapterVO.getSubsectionList(); - if (subsectionList != null && subsectionList.size() != 0) { - subsectionList.forEach(subsectionVO -> { - CourseSubsection courseSubsection = new CourseSubsection(); - courseSubsection.setId(subsectionVO.getId()); - courseSubsection.setSort(subsectionVO.getSort()); - courseSubsectionMapper.updateById(courseSubsection); - }); - } - }); - return true; - } - return false; - } - - @Override - public boolean repeat(CourseChapter courseChapter) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("course_id", courseChapter.getCourseId()); - wrapper.eq("name", courseChapter.getName()); - Integer count = baseMapper.selectCount(wrapper); - return count > 0; - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/CourseClassificationServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/CourseClassificationServiceImpl.java deleted file mode 100644 index 04e7103..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/CourseClassificationServiceImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.huoran.occupationlab.entity.EduCourseClassification; -import com.huoran.occupationlab.mapper.CourseClassificationMapper; -import com.huoran.occupationlab.service.CourseClassificationService; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 课程类别 服务实现类 - * - * @author chen - * @since 2020-09-30 - */ -@Service -public class CourseClassificationServiceImpl extends ServiceImpl implements CourseClassificationService { - - @Override - public List queryGlClassification(String schoolId) { - return baseMapper.selectGlClassification(schoolId); - } - - @Override - public List checkReapt(EduCourseClassification classification) { - return baseMapper.checkReapt(classification); - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/CourseServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/CourseServiceImpl.java deleted file mode 100644 index d06e6c0..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/CourseServiceImpl.java +++ /dev/null @@ -1,156 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.aliyuncs.exceptions.ClientException; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.huoran.common.utils.AliyunOssUtil; -import com.huoran.common.utils.VideoUtil; -import com.huoran.occupationlab.entity.CourseChapter; -import com.huoran.occupationlab.entity.CourseSubsection; -import com.huoran.occupationlab.entity.EduCourse; -import com.huoran.occupationlab.entity.SchoolCourse; -import com.huoran.occupationlab.entity.vo.CourseVO; -import com.huoran.occupationlab.mapper.CourseChapterMapper; -import com.huoran.occupationlab.mapper.CourseMapper; -import com.huoran.occupationlab.mapper.CourseSubsectionMapper; -import com.huoran.occupationlab.mapper.SchoolCourseMapper; -import com.huoran.occupationlab.service.CourseService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.stream.Collectors; - -/** - * 课程基本信息 服务实现类 - * - * @author chen - * @since 2020-09-30 - */ -@Service -public class CourseServiceImpl extends ServiceImpl implements CourseService { - - @Autowired - private CourseMapper courseMapper; - - @Autowired - private CourseChapterMapper courseChapterMapper; - - @Autowired - private CourseSubsectionMapper courseSubsectionMapper; - - @Autowired - private SchoolCourseMapper schoolCourseMapper; - - @Override - public List coursePageConditionQuery(HashMap map) { - return courseMapper.selectCourseByCondition(map); - } - - @Override - public int coursePageConditionCount(HashMap map) { - return courseMapper.selectCourseCountByCondition(map); - } - - /** - * 删除课程、删除课程下的章节、小节及资源 - * - * @param courseId 课程id - */ - @Transactional - @Override - public boolean removeCourse(String courseId) { - //删除小节 - QueryWrapper subsectionWrapper = new QueryWrapper<>(); - subsectionWrapper.eq("course_id", courseId); - List courseSubsections = courseSubsectionMapper.selectList(subsectionWrapper); - if (courseSubsections != null && courseSubsections.size() != 0) { - courseSubsections.forEach(subsection -> { - //删除资源 - boolean isVideo = VideoUtil.isVideo(subsection.getFileType()); - if (isVideo) { - try { - AliyunOssUtil.removeVideo(subsection.getFileId()); - } catch (ClientException e) { - e.printStackTrace(); - } - } else { - List keys = new ArrayList<>(); - keys.add(subsection.getFileName()); - try { - AliyunOssUtil.removeMoreVideo(keys); - } catch (ClientException e) { - e.printStackTrace(); - } - } - courseSubsectionMapper.deleteById(subsection.getId()); - }); - } - //删除章节 - QueryWrapper chapterWrapper = new QueryWrapper<>(); - chapterWrapper.eq("course_id", courseId); - chapterWrapper.select("id"); - List courseChapters = courseChapterMapper.selectList(chapterWrapper); - if (courseChapters != null && courseChapters.size() != 0) { - //获取章节id集 - List chapterIds = courseChapters.stream().map(CourseChapter::getId).collect(Collectors.toList()); - courseChapterMapper.deleteBatchIds(chapterIds); - } - - EduCourse course = baseMapper.selectById(courseId); - //删除课程封面 - if (course != null) { - String fileUrl = course.getCoverUrl(); - String fileName = fileUrl.substring(fileUrl.indexOf("/", 9) + 1); - List key = new ArrayList<>(); - key.add(fileName); - try { - AliyunOssUtil.removeMoreVideo(key); - } catch (ClientException e) { - e.printStackTrace(); - } - } - //删除学校与课程对应关系 - schoolCourseMapper.delete(new QueryWrapper().eq("course_id", courseId)); - //删除课程 - int count = baseMapper.deleteById(courseId); - return count > 0; - } - - /** - * 批量删除课程、删除课程下的章节、小节及资源 - * - * @param courseIds 多个课程id - */ - @Override - public boolean deleteCourses(List courseIds) { - if (courseIds != null && courseIds.size() != 0) { - courseIds.forEach(this::removeCourse); - } - return true; - } - - @Override - public boolean repeat(EduCourse course) { - QueryWrapper courseQueryWrapper = new QueryWrapper<>(); - courseQueryWrapper.eq("school_id", course.getSchoolId()); - courseQueryWrapper.eq("name", course.getName()); - Integer count = baseMapper.selectCount(courseQueryWrapper); - return count > 0; - } - - @Override - public void addChapter(EduCourse course) { - CourseChapter courseChapter = new CourseChapter(); - courseChapter.setCourseId(course.getId()); - courseChapter.setSort(1); - courseChapter.setName("第一章"); - courseChapter.setGmtCreate(new Date()); - courseChapter.setGmtModified(new Date()); - courseChapterMapper.insert(courseChapter); - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/CourseSubsectionServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/CourseSubsectionServiceImpl.java deleted file mode 100644 index 3934d9d..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/CourseSubsectionServiceImpl.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.aliyuncs.exceptions.ClientException; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.huoran.common.utils.AliyunOssUtil; -import com.huoran.common.utils.VideoUtil; -import com.huoran.occupationlab.entity.CourseSubsection; -import com.huoran.occupationlab.mapper.CourseSubsectionMapper; -import com.huoran.occupationlab.service.CourseSubsectionService; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.ArrayList; -import java.util.List; - -/** - * 课程小节 服务实现类 - * - * @author chen - * @since 2020-09-30 - */ -@Service -public class CourseSubsectionServiceImpl extends ServiceImpl implements CourseSubsectionService { - - /** - * 删除小节及资源 - * - * @param subsectionId 小节id - */ - @Transactional - @Override - public boolean removeSubsection(String subsectionId) throws ClientException { - CourseSubsection courseSubsection = baseMapper.selectById(subsectionId); - String fileType = courseSubsection.getFileType(); - //删除资源 - boolean isVideo = VideoUtil.isVideo(fileType); - if (isVideo) { - AliyunOssUtil.removeVideo(courseSubsection.getFileId()); - } else { - List keys = new ArrayList<>(); - keys.add(courseSubsection.getFileName()); - AliyunOssUtil.deleteFiles(keys); - } - //删除小节 - int count = baseMapper.deleteById(subsectionId); - return count > 0; - } - - @Override - public boolean saveSubsection(CourseSubsection courseSubsection) { - //查询章节小节的总数 - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("chapter_id", courseSubsection.getChapterId()); - int count = baseMapper.selectCount(wrapper); - if (count == 0) { - courseSubsection.setSort(1); - } else { - //查询章节小节最大排序数 - count = baseMapper.selectMaxSort(); - courseSubsection.setSort(count + 1); - } - int insert = baseMapper.insert(courseSubsection); - return insert > 0; - } - - @Override - public boolean repeat(CourseSubsection courseSubsection) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("chapter_id", courseSubsection.getChapterId()); - wrapper.eq("course_id", courseSubsection.getCourseId()); - wrapper.eq("name", courseSubsection.getName()); - Integer count = baseMapper.selectCount(wrapper); - return count > 0; - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/EntrepreneurialActivityAnnouncementAnnexServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/EntrepreneurialActivityAnnouncementAnnexServiceImpl.java deleted file mode 100644 index 54d8964..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/EntrepreneurialActivityAnnouncementAnnexServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.huoran.occupationlab.entity.EntrepreneurialActivityAnnouncementAnnex; -import com.huoran.occupationlab.mapper.EntrepreneurialActivityAnnouncementAnnexMapper; -import com.huoran.occupationlab.service.EntrepreneurialActivityAnnouncementAnnexService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -/** - *

- * 活动公告附件表 服务实现类 - *

- * - * @author lr - * @since 2023-05-12 - */ -@Service -public class EntrepreneurialActivityAnnouncementAnnexServiceImpl extends ServiceImpl implements EntrepreneurialActivityAnnouncementAnnexService { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/EntrepreneurialActivityAnnouncementServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/EntrepreneurialActivityAnnouncementServiceImpl.java deleted file mode 100644 index db783c0..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/EntrepreneurialActivityAnnouncementServiceImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.EntrepreneurialActivityAnnouncement; -import com.huoran.occupationlab.mapper.EntrepreneurialActivityAnnouncementMapper; -import com.huoran.occupationlab.service.EntrepreneurialActivityAnnouncementService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -/** - *

- * 活动公告表 服务实现类 - *

- * - * @author lr - * @since 2023-05-12 - */ -@Service -public class EntrepreneurialActivityAnnouncementServiceImpl extends ServiceImpl implements EntrepreneurialActivityAnnouncementService { - - @Override - public R queryAnnouncementByActivityId(String competitionId, Integer pageNum, Integer pageSize) { - Page page = new Page(pageNum, pageSize); - IPage pageList = baseMapper.queryAnnouncementByActivityId(page, competitionId); - return R.ok().put("data", pageList); - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/EntrepreneurialActivityApplicantServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/EntrepreneurialActivityApplicantServiceImpl.java deleted file mode 100644 index 1018cb2..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/EntrepreneurialActivityApplicantServiceImpl.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import cn.afterturn.easypoi.excel.ExcelExportUtil; -import cn.afterturn.easypoi.excel.entity.ExportParams; -import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.EntrepreneurialActivityApplicant; -import com.huoran.occupationlab.entity.req.ActivityApplicantReq; -import com.huoran.occupationlab.entity.vo.RegistrationVO; -import com.huoran.occupationlab.mapper.EntrepreneurialActivityApplicantMapper; -import com.huoran.occupationlab.service.EntrepreneurialActivityApplicantService; -import com.huoran.occupationlab.utils.poi.ExcelStyleUtil; -import org.apache.poi.ss.usermodel.Workbook; -import org.springframework.stereotype.Service; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.net.URLEncoder; -import java.util.List; -import java.util.stream.Collectors; - -/** - *

- * 创业活动报名人员表 服务实现类 - *

- * - * @author lr - * @since 2023-04-27 - */ -@Service -public class EntrepreneurialActivityApplicantServiceImpl extends ServiceImpl implements EntrepreneurialActivityApplicantService { - - @Override - public R ApplicantsList(ActivityApplicantReq req) { - Page page = new Page(req.getPageNum(), req.getPageSize()); - IPage pageList = baseMapper.selectRegistration(page, req); - return R.ok().put("data", pageList); - } - - @Override - public void export(HttpServletResponse response, ActivityApplicantReq req) throws IOException { - Page page = new Page(req.getPageNum(), req.getPageSize()); - IPage pageList = baseMapper.selectRegistration(page, req); - //添加序列号 - Integer[] arr = {1}; - List retList = pageList.getRecords().stream().peek(e -> e.setRownum(arr[0]++)).collect(Collectors.toList()); - // 告诉浏览器用什么软件可以打开此文件 - response.setHeader("content-Type", "application/vnd.ms-excel"); - // 下载文件的默认名称 - response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("报名人员导出", "UTF-8") + ".xls"); - //编码 - response.setCharacterEncoding("UTF-8"); - Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), RegistrationVO.class, retList); - ExportParams exportParams = new ExportParams(null, "delivery", ExcelType.XSSF); - exportParams.setStyle(ExcelStyleUtil.class); - workbook.write(response.getOutputStream()); - - } - - @Override - public void exportDataInBatches(List listOfExportSub, HttpServletResponse response) throws IOException { - // 告诉浏览器用什么软件可以打开此文件 - response.setHeader("content-Type", "application/vnd.ms-excel"); - // 下载文件的默认名称 - response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("报名人员导出", "UTF-8") + ".xls"); - //编码 - response.setCharacterEncoding("UTF-8"); - //添加序列号 - Integer[] arr = {1}; - listOfExportSub = listOfExportSub.stream().peek(e -> e.setRownum(arr[0]++)).collect(Collectors.toList()); - Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), RegistrationVO.class, listOfExportSub); - ExportParams exportParams = new ExportParams(null, "delivery", ExcelType.XSSF); - exportParams.setStyle(ExcelStyleUtil.class); - workbook.write(response.getOutputStream()); - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/EntrepreneurialActivityCollectServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/EntrepreneurialActivityCollectServiceImpl.java deleted file mode 100644 index 75e8b22..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/EntrepreneurialActivityCollectServiceImpl.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.huoran.occupationlab.entity.EntrepreneurialActivityCollect; -import com.huoran.occupationlab.mapper.EntrepreneurialActivityCollectMapper; -import com.huoran.occupationlab.service.EntrepreneurialActivityCollectService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -/** - *

- * 理论课程收藏表 服务实现类 - *

- * - * @author lr - * @since 2023-06-01 - */ -@Service -public class EntrepreneurialActivityCollectServiceImpl extends ServiceImpl implements EntrepreneurialActivityCollectService { - - @Override - public Integer countTheNumberOfCollectors(Integer activityId) { - return baseMapper.countTheNumberOfCollectors(activityId); - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/EntrepreneurialActivityFileServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/EntrepreneurialActivityFileServiceImpl.java deleted file mode 100644 index d278465..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/EntrepreneurialActivityFileServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.huoran.occupationlab.entity.EntrepreneurialActivityFile; -import com.huoran.occupationlab.mapper.EntrepreneurialActivityFileMapper; -import com.huoran.occupationlab.service.EntrepreneurialActivityFileService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -/** - *

- * 创业活动附件存储 服务实现类 - *

- * - * @author lr - * @since 2023-04-26 - */ -@Service -public class EntrepreneurialActivityFileServiceImpl extends ServiceImpl implements EntrepreneurialActivityFileService { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/EntrepreneurialActivityProgressServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/EntrepreneurialActivityProgressServiceImpl.java deleted file mode 100644 index 860ee9f..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/EntrepreneurialActivityProgressServiceImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.occupationlab.entity.EntrepreneurialActivityProgress; -import com.huoran.occupationlab.mapper.EntrepreneurialActivityProgressMapper; -import com.huoran.occupationlab.service.EntrepreneurialActivityProgressService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -/** - *

- * 活动进展表 服务实现类 - *

- * - * @author lr - * @since 2023-05-12 - */ -@Service -public class EntrepreneurialActivityProgressServiceImpl extends ServiceImpl implements EntrepreneurialActivityProgressService { - - @Override - public boolean repeat(EntrepreneurialActivityProgress activityProgress) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("title", activityProgress.getTitle()); - wrapper.eq("activity_id", activityProgress.getActivityId()); - Integer count = baseMapper.selectCount(wrapper); - return count > 0; - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/EntrepreneurialActivityServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/EntrepreneurialActivityServiceImpl.java deleted file mode 100644 index 6b2aa67..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/EntrepreneurialActivityServiceImpl.java +++ /dev/null @@ -1,124 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.EntrepreneurialActivity; -import com.huoran.occupationlab.entity.EntrepreneurialActivityCollect; -import com.huoran.occupationlab.entity.TheoreticalCourseCollect; -import com.huoran.occupationlab.entity.req.EntrepreneurshipActivityListrReq; -import com.huoran.occupationlab.entity.resp.PageTheoreticalCourseByNakadaiResp; -import com.huoran.occupationlab.entity.vo.EntrepreneurialActivityVO; -import com.huoran.occupationlab.mapper.AssessmentMapper; -import com.huoran.occupationlab.mapper.EntrepreneurialActivityCollectMapper; -import com.huoran.occupationlab.mapper.EntrepreneurialActivityMapper; -import com.huoran.occupationlab.service.EntrepreneurialActivityService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -/** - *

- * 创业活动管理表 服务实现类 - *

- * - * @author lr - * @since 2023-04-26 - */ -@Service -public class EntrepreneurialActivityServiceImpl extends ServiceImpl implements EntrepreneurialActivityService { - - - @Autowired - private EntrepreneurialActivityCollectMapper collectMapper; - - @Override - public R activityList(EntrepreneurshipActivityListrReq req) { - //学校超管能看到教师以及学生发布的,教师能看到老师自己的和学生的(学生的:已发布的且未被学生禁用的(教师禁用学生的要展示) - Page page = new Page(req.getPageNum(), req.getPageSize()); - IPage iPage = null; - //当前所属平台(0:中台,1:职站教师 2职站学生) - switch (req.getPlatformSource()) { - case 1: - if (req.getIsAdmin() == 1) { - //为1表示该觉得为超管 能看到全校发布的 - iPage = baseMapper.theOverpipeOfTheActivityList(page, req); - break; - } - //展示教师当前发布的 - iPage = baseMapper.activityListForTeachers(page, req); - break; - } - return R.ok().put("data", iPage); - } - - @Override - public R schoolActivities(EntrepreneurshipActivityListrReq req) { - Page page = new Page(req.getPageNum(), req.getPageSize()); - IPage iPage = baseMapper.schoolActivities(page, req); - - - for (EntrepreneurialActivityVO resp : iPage.getRecords()) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("account_id", req.getAccountId()); - queryWrapper.eq("activity_id", resp.getId()); - EntrepreneurialActivityCollect activityCollect = collectMapper.selectOne(queryWrapper); - resp.setCollectorsNum(collectMapper.countTheNumberOfCollectors(resp.getId())); - //是否收藏:(state = 1收藏,0取消收藏) - if (activityCollect != null) { - //收藏过 - resp.setCollectionStatus(1); - } else { - resp.setCollectionStatus(0); - } - } - - - return R.ok().put("data", iPage); - } - - @Override - public R myActivities(EntrepreneurshipActivityListrReq req) { - Page page = new Page(req.getPageNum(), req.getPageSize()); - IPage iPage = baseMapper.myActivities(page, req); - - for (EntrepreneurialActivityVO resp : iPage.getRecords()) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("account_id", req.getAccountId()); - queryWrapper.eq("activity_id", resp.getId()); - EntrepreneurialActivityCollect activityCollect = collectMapper.selectOne(queryWrapper); - resp.setCollectorsNum(collectMapper.countTheNumberOfCollectors(resp.getId())); - //是否收藏:(state = 1收藏,0取消收藏) - if (activityCollect != null) { - //收藏过 - resp.setCollectionStatus(1); - } else { - resp.setCollectionStatus(0); - } - } - return R.ok().put("data", iPage); - } - - @Override - public R concernedActivity(EntrepreneurshipActivityListrReq req) { - Page page = new Page(req.getPageNum(), req.getPageSize()); - IPage iPage = baseMapper.concernedActivity(page, req); - - for (EntrepreneurialActivityVO resp : iPage.getRecords()) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("activity_id", resp.getId()); - queryWrapper.eq("account_id", req.getAccountId()); - EntrepreneurialActivityCollect activityCollect = collectMapper.selectOne(queryWrapper); - resp.setCollectorsNum(collectMapper.countTheNumberOfCollectors(resp.getId())); - //是否收藏:(state = 1收藏,0取消收藏) - if (activityCollect != null) { - //收藏过 - resp.setCollectionStatus(1); - } else { - resp.setCollectionStatus(0); - } - } - return R.ok().put("data", iPage); - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/EvaluationFractionServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/EvaluationFractionServiceImpl.java deleted file mode 100644 index 2d73934..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/EvaluationFractionServiceImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.huoran.occupationlab.entity.EvaluationFraction; -import com.huoran.occupationlab.mapper.EvaluationFractionMapper; -import com.huoran.occupationlab.service.EvaluationFractionService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -/** - *

- * 记录用户能力测评的总分数 服务实现类 - *

- * - * @author lr - * @since 2021-09-26 - */ -@Service -public class EvaluationFractionServiceImpl extends ServiceImpl implements EvaluationFractionService { - - @Override - public void insertRecord(EvaluationFraction fraction) { - baseMapper.insert(fraction); - } - - @Override - public Integer queryExerciseRecord(Integer accountId) { - Integer score = baseMapper.queryExerciseRecord(accountId); - return score; - } - - @Override - public Integer queryTeachingRecord(Integer accountId) { - Integer score = baseMapper.queryTeachingRecord(accountId); - return score; - } - - @Override - public Integer queryScore(Integer accountId, Integer type) { - Integer id = baseMapper.queryScore(accountId, type); - return id; - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/EvaluationQuestionServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/EvaluationQuestionServiceImpl.java deleted file mode 100644 index 158e4aa..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/EvaluationQuestionServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.huoran.occupationlab.entity.EvaluationQuestion; -import com.huoran.occupationlab.mapper.EvaluationQuestionMapper; -import com.huoran.occupationlab.service.EvaluationQuestionService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -/** - *

- * 测评试题表,记录每次测评的试题,与测评记录表相关联 服务实现类 - *

- * - * @author lr - * @since 2021-09-26 - */ -@Service -public class EvaluationQuestionServiceImpl extends ServiceImpl implements EvaluationQuestionService { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/EvaluationRecordServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/EvaluationRecordServiceImpl.java deleted file mode 100644 index bc769c9..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/EvaluationRecordServiceImpl.java +++ /dev/null @@ -1,347 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.occupationlab.entity.EvaluationQuestion; -import com.huoran.occupationlab.entity.EvaluationRecord; -import com.huoran.occupationlab.entity.vo.*; -import com.huoran.occupationlab.mapper.EvaluationQuestionMapper; -import com.huoran.occupationlab.mapper.EvaluationRecordMapper; -import com.huoran.occupationlab.service.EvaluationQuestionService; -import com.huoran.occupationlab.service.EvaluationRecordService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.huoran.occupationlab.service.QuestionsService; -import com.huoran.occupationlab.utils.Constant; -import com.huoran.occupationlab.utils.poi.CommonCode; -import com.huoran.occupationlab.utils.poi.ExceptionCast; -import org.apache.commons.lang.StringUtils; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.text.NumberFormat; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Date; -import java.util.List; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.stream.Collectors; - -/** - * @Description: 测评管理 - * 从 - * @auther: Rong - * @date: 2021/9/26 16:24 - */ -@Service("evaluationRecordService") -public class EvaluationRecordServiceImpl extends ServiceImpl implements EvaluationRecordService { - - @Autowired - QuestionsService questionsService; - - @Autowired - EvaluationQuestionService evaluationQuestionService; - - @Autowired - EvaluationQuestionMapper evaluationQuestionDao; - - @Resource - StringRedisTemplate stringRedisTemplate; - - @Autowired - ThreadPoolExecutor executor; - - private String REMAINING_TINE_KEY = "REMAINING_TINE"; - - /** - * 平均分配分值 - * - * @param number 判分点数量 - * @return - */ - private List averageValue(Integer number) { - if (number == null || number == 0) { - ExceptionCast.cast(CommonCode.EVALUATION_QUESTION_NUM_INVALID); - } - Integer score = 100 / number; - List list = new ArrayList<>(); - if (100 % number == 0) { - for (int i = 0; i < number; i++) { - list.add(score); - } - } else { - int n; - for (int i = 0; i < number; i++) { - list.add(score); - } - for (int i = 100 % number; i > 0; i--) { - n = score + 1; - list.set(i, n); - } - } - return list; - } - - @Override - public TMSEvaluationRecordVO startEvaluation(Integer accountId,Integer schoolId) { - //TODO 接口幂等性处理 - //根据用户id和是否提交,查询测评记录信息 - EvaluationRecord one = this.getOne(new QueryWrapper().eq("account_id", accountId) - .eq("evaluation_status", Constant.Submit.NOT_SUBMIT.getType())); - - //查询是否有过测评记录 为空则随机抽取题目 - if (one == null) { - //随机抽取试题数据 - EvaluationVO evaluation = questionsService.randomQuestions(schoolId); - - //保存测评记录 - EvaluationRecord evaluationRecord = new EvaluationRecord(); - evaluationRecord.setAccountId(accountId); - evaluationRecord.setEvaluationStatus(Constant.Submit.NOT_SUBMIT.getType()); - evaluationRecord.setTotalQuestionNum(evaluation.getQuestionNum()); - evaluationRecord.setCurrentQuestionSortNo(1); - evaluationRecord.setStartTime(new Date()); - this.save(evaluationRecord); - - List evaluationQuestionList = evaluation.getQuestions().stream().map(question -> { - EvaluationQuestion evaluationQuestionEntity = new EvaluationQuestion(); - evaluationQuestionEntity.setEvaluationRecordId(evaluationRecord.getId()); - evaluationQuestionEntity.setQuestionId(Integer.valueOf(question)); - return evaluationQuestionEntity; - }).collect(Collectors.toList()); - - List list = averageValue(evaluation.getQuestionNum()); - for (int i = 0; i < list.size(); i++) { - evaluationQuestionList.get(i).setQuestionSortNo(i + 1); - evaluationQuestionList.get(i).setQuestionPoints(list.get(i)); - } - evaluationQuestionService.saveBatch(evaluationQuestionList); - - one = evaluationRecord; - } - - TMSEvaluationRecordVO evaluationRecordVO = baseMapper.selectVOByInfo(one.getId(), one.getCurrentQuestionSortNo()); - evaluationRecordVO.setQuestionTypeName(getQuestionTypeName(evaluationRecordVO.getQuestionType())); - return evaluationRecordVO; - } - - private String getQuestionTypeName(String questionType) { - String questionTypeName = ""; - //处理试题类型 - if (questionType.equals(Constant.QuestionType.SINGLE_CHOICE.getType())) { - //单选题 - questionTypeName = Constant.QuestionType.SINGLE_CHOICE.getDesc(); - } else if (questionType.equals(Constant.QuestionType.MULTIPLE_CHOICE.getType())) { - //多选题 - questionTypeName = Constant.QuestionType.MULTIPLE_CHOICE.getDesc(); - } else if (questionType.equals(Constant.QuestionType.TRUE_OR_FALSE.getType())) { - //判断题 - questionTypeName = Constant.QuestionType.TRUE_OR_FALSE.getDesc(); - } else { - ExceptionCast.cast(CommonCode.QUESTIONTYPE_INVALID); - } - return questionTypeName; - } - - @Override - public TMSEvaluationRecordVO convertQuestion(Integer evaluationRecordId, Integer currentQuestionSortNo, String userAnswer, Integer changeSortNo) throws ExecutionException, InterruptedException { - if (currentQuestionSortNo < 1 - || currentQuestionSortNo > this.getById(evaluationRecordId).getTotalQuestionNum() - || changeSortNo < 1 - || changeSortNo > this.getById(evaluationRecordId).getTotalQuestionNum()) { - ExceptionCast.cast(CommonCode.INVALID_PARAM); - } - //提交当前试题信息 - submitCurrentQuestion(evaluationRecordId, currentQuestionSortNo, userAnswer); - //修改测评记录表当前题目顺序号 - updateCurrentSortNo(changeSortNo, evaluationRecordId); - TMSEvaluationRecordVO evaluationRecordVO = baseMapper.selectVOByInfo(evaluationRecordId, changeSortNo); - - //查询下一题信息 - evaluationRecordVO.setQuestionTypeName(getQuestionTypeName(evaluationRecordVO.getQuestionType())); - return evaluationRecordVO; - } - - - //提交当前试题,并修改当前测评记录表 - private void submitCurrentQuestion(Integer evaluationRecordId, - Integer currentQuestionSortNo, - String userAnswer) { - //1、根据当前传递的evaluationRecordId和currentQuestionSortNo查询当前试题 - EvaluationQuestionVO evaluationQuestionVO = evaluationQuestionDao.selectByInfo(evaluationRecordId, currentQuestionSortNo); - - if (evaluationQuestionVO == null) { - ExceptionCast.cast(CommonCode.INVALID_PARAM); - } - // 题目分值 - Integer questionPoints = evaluationQuestionVO.getQuestionPoints(); - //正确答案 - String answer = evaluationQuestionVO.getAnswer(); - - String userString = ""; - String answerString = ""; - char[] arr = userAnswer.toCharArray(); - Arrays.sort(arr); - for (char a : arr) { - userString = userString + String.valueOf(a); - } - char[] array = answer.toCharArray(); - Arrays.sort(array); - for (char b : array) { - answerString = answerString + String.valueOf(b); - } - //修改当前试题状态 - //记录用户的答案 - //判断当前试题正误 - //记录试题得分 - EvaluationQuestion evaluationQuestion = new EvaluationQuestion(); - evaluationQuestion.setId(evaluationQuestionVO.getId()); - evaluationQuestion.setUserAnswer(userAnswer); - //如果用户答案为空,则设置状态为未作,设为错,得分设为0 -// if (StringUtils.isEmpty(userAnswer)) { - if (StringUtils.isEmpty(userString)) { - evaluationQuestion.setQuestionStatus(Constant.QuestionStatus.NOT_MADE.getType()); - evaluationQuestion.setIsTure(Constant.QuestionIsTure.FALSE.getType()); - evaluationQuestion.setQuestionScore(0); - } else { - evaluationQuestion.setQuestionStatus(Constant.QuestionStatus.MADE.getType()); - if (!answerString.equals(userString)) { - evaluationQuestion.setIsTure(Constant.QuestionIsTure.FALSE.getType()); - evaluationQuestion.setQuestionScore(0); - } else { - evaluationQuestion.setIsTure(Constant.QuestionIsTure.TRUE.getType()); - evaluationQuestion.setQuestionScore(questionPoints); - } - } - evaluationQuestionDao.updateById(evaluationQuestion); - - } - - private void updateCurrentSortNo(Integer changeSortNo, Integer evaluationRecordId) { - //修改测评记录表 - EvaluationRecord evaluationRecordEntity = new EvaluationRecord(); - evaluationRecordEntity.setCurrentQuestionSortNo(changeSortNo); - evaluationRecordEntity.setId(evaluationRecordId); - this.updateById(evaluationRecordEntity); - } - - @Override - public EvaluationRecordSubmitVO submitEvaluation(Integer evaluationRecordId, Integer currentQuestionSortNo, String userAnswer, Integer accountId) throws ExecutionException, InterruptedException { - //清除redis中的倒计时 - CompletableFuture deleteKeyFuture = CompletableFuture.runAsync(() -> { - String key = REMAINING_TINE_KEY + accountId; - stringRedisTemplate.delete(key); - }, executor); - -// CompletableFuture submitCurrentQuestionFuture = CompletableFuture.runAsync(() -// -> submitCurrentQuestion(evaluationRecordId, currentQuestionSortNo, userAnswer), executor); -// 2020.09.30 清除上面异步操作,需先提交并统计最后一题的结果 - submitCurrentQuestion(evaluationRecordId, currentQuestionSortNo, userAnswer); - - //修改提交时间和测评记录状态 - CompletableFuture updateEvaluationFuture = CompletableFuture.runAsync(() -> { - EvaluationRecord entity = new EvaluationRecord(); - entity.setId(evaluationRecordId); - entity.setEvaluationStatus(Constant.Submit.SUBMIT.getType()); - entity.setSubmitTime(new Date()); - this.updateById(entity); - }, executor); - - EvaluationRecordSubmitVO submitVO = new EvaluationRecordSubmitVO(); - - //查询总成绩 - CompletableFuture sumScoreFuture = CompletableFuture.runAsync(() -> { - int sumScore = evaluationQuestionDao.sumScore(evaluationRecordId); - //得分 - submitVO.setTotalScore(sumScore); - //是否通过 -// submitVO.setIsPassed(sumScore > Constant.PASSING_SCORE ? Constant.EVALUATIONN_PASSED : Constant.EVALUATIONN_NOT_PASSED); - //成绩大于等于60分通过 - submitVO.setIsPassed(sumScore >= Constant.PASSING_SCORE ? Constant.EVALUATIONN_PASSED : Constant.EVALUATIONN_NOT_PASSED); - }, executor); - - CompletableFuture getByIdFuture = CompletableFuture.supplyAsync(() -> { - EvaluationRecord evaluationRecord = this.getById(evaluationRecordId); - BeanUtils.copyProperties(evaluationRecord, submitVO); - return evaluationRecord; - }, executor); - - CompletableFuture countFuture = getByIdFuture.thenAcceptAsync((res) -> { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("evaluation_record_id", evaluationRecordId) - .eq("is_ture", Constant.QuestionIsTure.TRUE.getType()); - //查询答对几题 - int count = evaluationQuestionService.count(queryWrapper); - //答对几道 - submitVO.setCorrectQuestionNum(count); - //正确率 - // 创建一个数值格式化对象 - NumberFormat numberFormat = NumberFormat.getInstance(); - // 设置精确到小数点后2位 - numberFormat.setMaximumFractionDigits(2); - submitVO.setCorrectRate(numberFormat.format((float) count / (float) res.getTotalQuestionNum() * 100) + "%"); - - }, executor); - CompletableFuture.allOf(deleteKeyFuture, updateEvaluationFuture, - sumScoreFuture, getByIdFuture, countFuture).get(); - - return submitVO; - } - - @Override - public EvaluationRecordDetailVO evaluationDetail(Integer evaluationRecordId) throws ExecutionException, InterruptedException { - EvaluationRecordDetailVO evaluationRecordDetailVO = new EvaluationRecordDetailVO(); - - CompletableFuture sumScoreFuture = CompletableFuture.runAsync(() -> { - //查询总成绩 - int sumScore = evaluationQuestionDao.sumScore(evaluationRecordId); - evaluationRecordDetailVO.setTotalScore(sumScore); - }, executor); - - CompletableFuture evaluationDetailVOSFuture = CompletableFuture.runAsync(() -> { - List evaluationDetailVOS = evaluationQuestionDao.selectDetailByInfo(evaluationRecordId); - evaluationRecordDetailVO.setEvaluationDetailVOS(evaluationDetailVOS); - }, executor); - - CompletableFuture.allOf(sumScoreFuture, evaluationDetailVOSFuture).get(); - return evaluationRecordDetailVO; - } - - @Override - public String selectNotMade(Integer evaluationRecordId) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("evaluation_record_id", evaluationRecordId) - .eq("question_status", Constant.QuestionStatus.NOT_MADE.getType()); - - List list = evaluationQuestionService.list(queryWrapper); - List collect = list.stream().map(EvaluationQuestion::getQuestionSortNo).collect(Collectors.toList()); - if (collect.size() == 0) { - return "已完成全部题目"; - } - return "还有以下题目未完成" + collect.toString(); - } - - @Override - public void cleanRemainingTime(Integer accountId) { - //清除redis中的倒计时 - String key = REMAINING_TINE_KEY + accountId; - stringRedisTemplate.delete(key); - - } - - @Override - public boolean isOpenExperiment(Integer accountId) { - List list = evaluationQuestionDao.sumScoreListByUserId(accountId); - if (list != null && list.size() > 0) { - for (Integer integer : list) { - if (integer > Constant.PASSING_SCORE) { - return true; - } - } - } - return false; - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/EvaluationRulesServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/EvaluationRulesServiceImpl.java deleted file mode 100644 index 2594b52..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/EvaluationRulesServiceImpl.java +++ /dev/null @@ -1,152 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.common.exception.CustomException; -import com.huoran.common.exception.ExceptionEnum; -import com.huoran.occupationlab.entity.EvaluationRules; -import com.huoran.occupationlab.entity.Questions; -import com.huoran.occupationlab.entity.vo.EvaluationRulesVO; -import com.huoran.occupationlab.mapper.EvaluationRulesMapper; -import com.huoran.occupationlab.mapper.QuestionsMapper; -import com.huoran.occupationlab.service.EvaluationRulesService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.huoran.occupationlab.service.QuestionsService; -import com.huoran.occupationlab.utils.Constant; -import com.huoran.occupationlab.utils.poi.CommonCode; -import com.huoran.occupationlab.utils.poi.ExceptionCast; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; - -/** - *

- * 测评规则信息记录,只记录一条信息 服务实现类 - *

- * - * @author lr - * @since 2021-08-12 - */ -@Service -public class EvaluationRulesServiceImpl extends ServiceImpl implements EvaluationRulesService { - @Resource - QuestionsService questionsService; - @Autowired - private QuestionsMapper questionsMapper; - - @Override - public EvaluationRulesVO getEvaluationRules(Integer schoolId) { - EvaluationRulesVO evaluationRulesVO = new EvaluationRulesVO(); - - //根据学校id查询测评规则 - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("school_id", schoolId); - EvaluationRules evaluationRules = baseMapper.selectOne(wrapper); - - if (evaluationRules.getEvaluationType().equals(Constant.RulesType.CUSTOMIZE.getType())) {//自定义 - - int totalNum = 0; - if (evaluationRules.getIsSingleEnable().equals(Constant.IsEnable.ENABLE.getType())) {//启用 - totalNum += evaluationRules.getSingleNum(); - } - if (evaluationRules.getIsMultipleEnable().equals(Constant.IsEnable.ENABLE.getType())) {//启用 - totalNum += evaluationRules.getMultipleNum(); - } - if (evaluationRules.getIsJudgmentEnable().equals(Constant.IsEnable.ENABLE.getType())) {//启用 - totalNum += evaluationRules.getJudgmentNum(); - } - - //类型为自定义,测评试题数量是各个参与测评的试题类型数量之和 - evaluationRules.setQuestionNum(totalNum); - } - - BeanUtils.copyProperties(evaluationRules, evaluationRulesVO); - - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("is_del", Constant.IsDel.NOT_DEL.getType()) //未删除 - .eq("is_enable", Constant.IsEnable.ENABLE.getType())//启用 - .eq("school_id", schoolId) - ; - - evaluationRulesVO.setTotalQuestionNum(questionsService.count(queryWrapper));//总题数 - int totalSingleNum = questionsService.count(queryWrapper.eq("question_type", - Constant.QuestionType.SINGLE_CHOICE.getType()));//单选题总数 - int totalMultipleNum = questionsMapper.countTotalMultipleNum(evaluationRules.getSchoolId()); - int totalJudgmentNum = questionsMapper.countTotalJudgmentNum(evaluationRules.getSchoolId()); - - evaluationRulesVO.setTotalSingleNum(totalSingleNum); - evaluationRulesVO.setTotalMultipleNum(totalMultipleNum); - evaluationRulesVO.setTotalJudgmentNum(totalJudgmentNum); - - return evaluationRulesVO; - } - - @Override - public boolean updateEvaluationRulesById(EvaluationRules evaluationRules) { - //控制测评题数不能超过100道 - if (evaluationRules == null - || evaluationRules.getQuestionNum() == null - || evaluationRules.getQuestionNum() > 100 - || evaluationRules.getQuestionNum() < 0) { - //ExceptionCast.cast(CommonCode.QUESTION_NUM_INVALID); - throw new CustomException(ExceptionEnum.QUESTION_NUM_INVALID); - } - - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("is_del", Constant.IsDel.NOT_DEL.getType()) //未删除 - .eq("is_enable", Constant.IsEnable.ENABLE.getType())//启用 - .eq("school_id", evaluationRules.getSchoolId()) - ; - //查询总题数 - int count = questionsService.count(queryWrapper);//总题数 - - //判断题目是否超出范围 - //判断类型 - Integer evaluationType = evaluationRules.getEvaluationType(); - if (evaluationType.equals(Constant.RulesType.RANDOM.getType())) {//随机 - Integer questionNum = evaluationRules.getQuestionNum(); - - numIncalid(questionNum, count); - - } else if (evaluationType.equals(Constant.RulesType.CUSTOMIZE.getType())) {//自定义 - if (evaluationRules.getIsSingleEnable().equals(Constant.IsEnable.ENABLE.getType())) {//启用 - int singleNum = evaluationRules.getSingleNum(); - int totalSingleNum = questionsService.count(queryWrapper.eq("question_type", - Constant.QuestionType.SINGLE_CHOICE.getType()).eq("school_id", evaluationRules.getSchoolId()));//单选题总数 - numIncalid(singleNum, totalSingleNum); - } - if (evaluationRules.getIsMultipleEnable().equals(Constant.IsEnable.ENABLE.getType())) {//启用 - int multipleNum = evaluationRules.getMultipleNum(); - int totalMultipleNum = questionsMapper.countTotalMultiplenum(evaluationRules.getSchoolId()); - numIncalid(multipleNum, totalMultipleNum); - } - if (evaluationRules.getIsJudgmentEnable().equals(Constant.IsEnable.ENABLE.getType())) {//启用 - int judgmentNum = evaluationRules.getJudgmentNum(); - int totalJudgmentNum = questionsMapper.countTotalJudgmentnum(evaluationRules.getSchoolId()); - numIncalid(judgmentNum, totalJudgmentNum); - } - - } - - return this.updateById(evaluationRules); - } - - @Override - public boolean copyEvaluationRules(Integer schoolId) { - //查询内置学校id为0的测评规则 - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("school_id", 0); - EvaluationRules evaluationRules = baseMapper.selectOne(wrapper); - evaluationRules.setSchoolId(schoolId); - Integer ret = baseMapper.insert(evaluationRules); - return ret > 0; - } - - private void numIncalid(int num, int totalNum) { - if (num < 0 || num > totalNum) { - //ExceptionCast.cast(CommonCode.QUESTION_NUM_INVALID); - throw new CustomException(ExceptionEnum.QUESTION_NUM_INVALID); - } - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ExperimentalReportServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ExperimentalReportServiceImpl.java deleted file mode 100644 index 866f894..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ExperimentalReportServiceImpl.java +++ /dev/null @@ -1,1046 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import cn.afterturn.easypoi.excel.ExcelExportUtil; -import cn.afterturn.easypoi.excel.entity.ExportParams; -import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; -import cn.hutool.core.util.StrUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.huoran.api.NakadaiClient; -import com.huoran.api.UserClient; -import com.huoran.common.constant.DelConstant; -import com.huoran.common.constant.PlatformConstant; -import com.huoran.common.constant.PointConstant; -import com.huoran.common.entity.BcJudgmentPoint; -import com.huoran.common.entity.LcRuleRecord; -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.Class; -import com.huoran.occupationlab.entity.*; -import com.huoran.occupationlab.entity.req.*; -import com.huoran.occupationlab.entity.resp.*; -import com.huoran.occupationlab.entity.vo.ActivityDerivationVO; -import com.huoran.occupationlab.entity.vo.PerformanceManagementPracticeActivityVO; -import com.huoran.occupationlab.entity.vo.PracticeTheHighestScoreListVO; -import com.huoran.occupationlab.entity.vo.ProductClassInformationVO; -import com.huoran.occupationlab.mapper.*; -import com.huoran.occupationlab.service.ExperimentalReportService; -import com.huoran.occupationlab.utils.SemesterDateUtils; -import com.huoran.occupationlab.utils.poi.ExcelStyleUtil; -import org.apache.commons.lang3.ObjectUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.poi.ss.usermodel.Workbook; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.math.BigDecimal; -import java.net.URLEncoder; -import java.util.*; - -import static java.math.BigDecimal.ROUND_HALF_DOWN; - -/** - *

- * 存储各子系统的实验报告 服务实现类 - *

- * - * @author lr - * @since 2021-09-08 - */ -@Service -public class ExperimentalReportServiceImpl extends ServiceImpl implements ExperimentalReportService { - - @Autowired - private ProjectHiddenMapper projectHiddenMapper; - - @Autowired - private ProjectManageMapper projectManageMapper; - - @Autowired - private ClassMapper classMapper; - - @Autowired - private ExperimentalReportMapper experimentalReportMapper; - - @Autowired - private PlayRecordMapper playRecordMapper; - - @Autowired - private UserScoreMapper userScoreMapper; - - @Autowired - private PythonRunCodeMapper runCodeMapper; - -// @Autowired -// private JudgmentPointClient judgmentPointClient; - @Autowired - private NakadaiClient nakadaiClient; - - @Autowired - private ArchitectureMapper architectureMapper; - - @Autowired - private AssessmentMapper assessmentMapper; - - @Autowired - private StudentMapper studentMapper; - - /** - * @Description: 学生端-实验记录-实验概览 - * @auther: Rong - * @date: 2021/9/8 17:43 - */ - @Override - public R getExperimentOverview(Integer accountId) { - ExperimentOverviewResp resp = baseMapper.getExperimentOverview(accountId); - double avgScore = ((double) resp.getSumScore() / resp.getExperimentalNum()); - if (Double.isNaN(avgScore)) { - avgScore = 0.0; - } - resp.setAvgScore(avgScore); - return R.ok().put("data", resp); - } - - @Override - public R queryAssessmentByStudent(PageAchievementByStuReq req) { - Page page = new Page(req.getPageNum(), req.getPageSize()); - IPage iPage = baseMapper.queryAssessmentByStudent(page, req); - return R.ok().put("page", iPage); - } - - @Override - public R queryPracticeByStudent(PageAchievementByStuReq req) { - Page page = new Page(req.getPageNum(), req.getPageSize()); - IPage iPage = baseMapper.queryPracticeByStudent(page, req); - return R.ok().put("page", iPage); - } - - @Autowired - private UserClient userClient; - - public static String getPercentage(Integer a, Integer b) { - int v = (int) ((new BigDecimal((float) a / b).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()) * 100); - String str = v + "%"; //用字符串做拼接,得到想要的%形式 - System.out.println(str); - return str; - } - - @Override - public R getAchievementInfo(PageAchievementByTeacherReq req) { - if (req.getCurriculumId().equals("")) { - String ids = nakadaiClient.getSchoolCourse(req.getSchoolId()); - req.setCurriculumIds(ids); - } - - req.setIsAdmin(0); - - String roleName = userClient.getUserAllRole(req.getAccountId() + "", PlatformConstant.POST_STATION); - if (roleName.contains("超级管理员") || roleName.contains("管理员")) { - //依据角色查询本校内的项目(超管管理员角色、管理员角色能看到全部考核列表 其它角色只能看到自己发布的) - req.setIsAdmin(1); - } else { - List accountIdList = userClient.getAccountIdsBySchoolId(req.getSchoolId(), PlatformConstant.POST_STATION); - //为满足非超管、管理员的角色情况下能看到本人及超管、管理员角色发布的项目 由此将当前用户的账号id赋值进去List - accountIdList.add(req.getAccountId()); - req.setAccountIdList(accountIdList); - } - - //成绩管理,老师应该看到内置+管理员(含超管)+自己创建的项目/发布考核的成绩,看不到别的老师的项目的练习或考核成绩 - switch (req.getPermissions()) { - case 0://练习 - req.setPageNum((req.getPageNum() - 1) * req.getPageSize()); - req.setPageSize(req.getPageSize()); - if (req.getCurriculumId().equals("")) { - String getCourse = nakadaiClient.getSchoolCourse(req.getSchoolId()); - req.setCurriculumId(getCourse); - } - return R.ok().put("page", baseMapper.getPracticeForTeacher(req)).put("total", baseMapper.getPracticeForTeacherNum(req).size()); - case 1://考核 - - Page page = new Page(req.getPageNum(), req.getPageSize()); - IPage iPage = baseMapper.getAssessmentForTeacher(page, req); - - for (AchievementResp resp : iPage.getRecords()) { - List classList = new ArrayList<>(); - for (String classId : resp.getClassId().split(",")) { - Class classInfo = classMapper.selectById(classId); - classList.add(classInfo); - } - resp.setClassList(classList); - } - return R.ok().put("page", iPage); - } - - return null; - } - - @Override - public R getPracticeDetail(Integer projectId, Integer pageNum, Integer pageSize, Integer schoolId, Integer classId, String keyWord, Integer mallId) { - Page page = new Page(pageNum, pageSize); - IPage iPage = baseMapper.getPracticeDetail(page, projectId, schoolId, classId, keyWord, mallId); - - //获取各个分数段人数 - FractionalSegmentResp getFractionalSegmentNum = baseMapper.getFractionalSegmentByPractice(projectId, schoolId, classId, mallId); - //获取平均分和总人数 - FractionalSegmentResp getAvgScoreAndPeople = baseMapper.getAvgScoreAndPeopleByPractice(projectId, schoolId, classId, mallId); - - //统计当前参加练习的人数 非有实验报告的总数(人数去重) - Integer peopleNum = baseMapper.countTheTotalNumberOfExercisers(projectId, schoolId, classId, mallId); - - com.huoran.common.entity.ProjectManage projectManage = projectManageMapper.undeletedAndDeletedItemDetails(projectId); - Integer sysType = baseMapper.selectSystemType(projectManage.getSystemId()); - //获取项目下的全部判分点(不同系统查询不同) - List scoringPointList = null; - if (sysType == PointConstant.PROGRAMMING) { - scoringPointList = baseMapper.errorRateAnalysis(projectId, schoolId, classId, mallId); - } else { - scoringPointList = baseMapper.errorRateAnalysisByLc(projectId, schoolId, classId, mallId); - } - - for (ScorePointsUnderTheItemResp scorePoint : scoringPointList) { -// Integer countError = baseMapper.countError(projectId, schoolId, scorePoint.getJudgmentId()); - //当前判分点做错的人数总数 -// scorePoint.setErrorTotal(countError); - scorePoint.setPeopleNum(getAvgScoreAndPeople.getPeopleNum()); - //设置错误率 - BigDecimal errorBigDecimal = new BigDecimal(0); - //除数非0校验 - if (getAvgScoreAndPeople.getPeopleNum() != 0) { - errorBigDecimal = new BigDecimal(scorePoint.getErrorTotal()).divide(new BigDecimal(getAvgScoreAndPeople.getPeopleNum()), 2, ROUND_HALF_DOWN); - } - scorePoint.setErrorRate(errorBigDecimal.multiply(new BigDecimal(100)) + ""); - } - - - ErrorRateAnalysisResp errorRateAnalysisResp = new ErrorRateAnalysisResp(); - errorRateAnalysisResp.setScoringPointList(scoringPointList); - - ScorePointsUnderTheItemResp max = null; - ScorePointsUnderTheItemResp min = null; - if (scoringPointList.size() > 0) { - max = Collections.max(scoringPointList, new Comparator() { - @Override - public int compare(ScorePointsUnderTheItemResp u1, ScorePointsUnderTheItemResp u2) { - double diff = Double.valueOf(u1.getErrorRate()) - Double.valueOf(u2.getErrorRate()); - if (diff > 0) { - return 1; - } else if (diff < 0) { - return -1; - } - return 0; //相等为0 - } - }); -// System.out.println("最大值" + max.toString()); - - - min = Collections.min(scoringPointList, new Comparator() { - @Override - public int compare(ScorePointsUnderTheItemResp u1, ScorePointsUnderTheItemResp u2) { - double diff = Double.valueOf(u1.getErrorRate()) - Double.valueOf(u2.getErrorRate()); - if (diff > 0) { - return 1; - } else if (diff < 0) { - return -1; - } - return 0; //相等为0 - } - }); -// System.out.println("最小值" + min.toString()); - } - - - return R.ok().put("page", iPage).put("peopleNum", peopleNum).put("avgScore", getAvgScoreAndPeople.getAvgScore()).put("maxScore", getAvgScoreAndPeople.getMaxScore()).put("minScore", getAvgScoreAndPeople.getMinScore()).put("getFractionalSegmentNum", getFractionalSegmentNum).put("errorAnalysis", errorRateAnalysisResp).put("highestErrorRate", max).put("minimumErrorRate", min); - } - - @Override - public R getAssessmentDetail(Integer assessmentId, Integer classId, Integer pageNum, Integer pageSize, String keyword) { - Page page = new Page(pageNum, pageSize); - IPage iPage = baseMapper.getAssessmentDetail(page, assessmentId, classId, keyword); - //获取各个分数段人数 - FractionalSegmentResp getFractionalSegmentNum = baseMapper.getFractionalSegmentByAssessment(assessmentId, classId); - //获取平均分和总人数 - FractionalSegmentResp getAvgScoreAndPeople = baseMapper.getAvgScoreAndPeopleByAssessment(assessmentId, classId); - Assessment assessment = assessmentMapper.selectById(assessmentId); - //获取考核下的全部判分点 -// List scoringPointList = baseMapper.errorRateAnalysisForAssessment(assessment.getProjectId(), assessment.getSchoolId(), assessmentId); - com.huoran.common.entity.ProjectManage projectManage = projectManageMapper.undeletedAndDeletedItemDetails(assessment.getProjectId()); - Integer sysType = baseMapper.selectSystemType(projectManage.getSystemId()); - //获取项目下的全部判分点(不同系统查询不同) - List scoringPointList = null; - if (sysType == PointConstant.PROGRAMMING) { - //编程类 - scoringPointList = baseMapper.errorRateAnalysisForAssessment(assessment.getProjectId(), assessment.getSchoolId(), assessmentId, classId); - } else { - //流程类 - scoringPointList = baseMapper.errorRateAnalysisForAssessmentByLc(assessment.getProjectId(), assessment.getSchoolId(), assessmentId); - } - - - for (ScorePointsUnderTheItemResp scorePoint : scoringPointList) { - //当前判分点做错的人数总数 - scorePoint.setPeopleNum(getAvgScoreAndPeople.getPeopleNum()); - //设置错误率 - BigDecimal errorBigDecimal = new BigDecimal(0); - //除数非0校验 - if (getAvgScoreAndPeople.getPeopleNum() != 0) { - errorBigDecimal = new BigDecimal(scorePoint.getErrorTotal()).divide(new BigDecimal(getAvgScoreAndPeople.getPeopleNum()), 2, ROUND_HALF_DOWN); - } - scorePoint.setErrorRate(errorBigDecimal.multiply(new BigDecimal(100)) + ""); - } - - - ErrorRateAnalysisResp errorRateAnalysisResp = new ErrorRateAnalysisResp(); - errorRateAnalysisResp.setScoringPointList(scoringPointList); - - - ScorePointsUnderTheItemResp max = null; - ScorePointsUnderTheItemResp min = null; - if (scoringPointList.size() > 0) { - - - max = Collections.max(scoringPointList, new Comparator() { - @Override - public int compare(ScorePointsUnderTheItemResp u1, ScorePointsUnderTheItemResp u2) { - double diff = Double.valueOf(u1.getErrorRate()) - Double.valueOf(u2.getErrorRate()); - if (diff > 0) { - return 1; - } else if (diff < 0) { - return -1; - } - return 0; //相等为0 - } - }); - System.out.println("最大值" + max.toString()); - - min = Collections.min(scoringPointList, new Comparator() { - @Override - public int compare(ScorePointsUnderTheItemResp u1, ScorePointsUnderTheItemResp u2) { - double diff = Double.valueOf(u1.getErrorRate()) - Double.valueOf(u2.getErrorRate()); - if (diff > 0) { - return 1; - } else if (diff < 0) { - return -1; - } - return 0; //相等为0 - } - }); - System.out.println("最小值" + min.toString()); - } - - return R.ok().put("page", iPage).put("peopleNum", getAvgScoreAndPeople.getPeopleNum()).put("avgScore", getAvgScoreAndPeople.getAvgScore()).put("maxScore", getAvgScoreAndPeople.getMaxScore()).put("minScore", getAvgScoreAndPeople.getMinScore()).put("getFractionalSegmentNum", getFractionalSegmentNum).put("errorAnalysis", errorRateAnalysisResp).put("highestErrorRate", max).put("minimumErrorRate", min); - } - - @Override - public void exportPracticeInfo(String ids, HttpServletResponse response, Integer schoolId, Integer projectId, Integer mallId) throws Exception { - List retList = baseMapper.exportPracticeInfo(ids, schoolId, projectId, mallId); - - // 告诉浏览器用什么软件可以打开此文件 - response.setHeader("content-Type", "application/vnd.ms-excel"); - // 下载文件的默认名称 - response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("练习实验成绩", "UTF-8") + ".xls"); - //编码 - response.setCharacterEncoding("UTF-8"); - Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), ExportPracticeByTeacherResp.class, retList); - ExportParams exportParams = new ExportParams(null, "delivery", ExcelType.XSSF); - exportParams.setStyle(ExcelStyleUtil.class); - workbook.write(response.getOutputStream()); - } - - @Override - public void exportAssessmentInfo(String ids, HttpServletResponse response, Integer schoolId, Integer assessmentId, Integer classId) throws Exception { - List retList = baseMapper.exportAssessmentInfo(ids, schoolId, assessmentId, classId); - - response.setHeader("content-Type", "application/vnd.ms-excel"); - response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("考核实验成绩", "UTF-8") + ".xls"); - response.setCharacterEncoding("UTF-8"); - Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), ExportAssessmentByTeacherResp.class, retList); - ExportParams exportParams = new ExportParams(null, "delivery", ExcelType.XSSF); - exportParams.setStyle(ExcelStyleUtil.class); - workbook.write(response.getOutputStream()); - } - - /** - * @param projectIds 要删除的 - * @param projectPermissions 项目权限(0、练习 1、考核 2、竞赛) - * @param ids - * @return - */ - @Override - public R deleteReportById(List projectIds, Integer projectPermissions, List ids) { - ProjectHidden projectHidden = new ProjectHidden(); - - switch (projectPermissions) { - - //将实验报告中使用该项目的实验报告删除 - case 0: - projectIds.stream().forEach(projectId -> { - projectHidden.setProjectId(projectId).setIsHidden(1); - projectHiddenMapper.insert(projectHidden); - UpdateWrapper updateWrapper = new UpdateWrapper<>(); - updateWrapper.set("is_del", DelConstant.IS_DEL); - updateWrapper.eq("project_id", projectId); - baseMapper.update(new com.huoran.common.entity.ExperimentalReport(), updateWrapper); - }); - - case 1: - ids.stream().forEach(id -> { - projectHidden.setTeachId(id).setIsHidden(1); - projectHiddenMapper.insert(projectHidden); - UpdateWrapper updateWrapper = new UpdateWrapper<>(); - updateWrapper.set("is_del", DelConstant.IS_DEL); - updateWrapper.eq("assessment_id", id); - baseMapper.update(new com.huoran.common.entity.ExperimentalReport(), updateWrapper); - }); - - default: - R.error("请传入正确的项目权限"); - } - - return R.ok(); - } - - @Override - public void exportAssessmentByStudent(Integer accountId, Integer curriculumId, String ids, HttpServletResponse response) throws Exception { - List retList = baseMapper.exportAssessmentByStudent(ids, accountId, curriculumId); - // 告诉浏览器用什么软件可以打开此文件 - response.setHeader("content-Type", "application/vnd.ms-excel"); - // 下载文件的默认名称 - response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("学生考核实验成绩", "UTF-8") + ".xls"); - //编码 - response.setCharacterEncoding("UTF-8"); - Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), ExportAssessmentByStuResp.class, retList); - ExportParams exportParams = new ExportParams(null, "delivery", ExcelType.XSSF); - exportParams.setStyle(ExcelStyleUtil.class); - workbook.write(response.getOutputStream()); - } - - @Override - public void exportPracticeByStudent(Integer curriculumId, Integer accountId, HttpServletResponse response) throws Exception { - List retList = baseMapper.exportPracticeByStudent(curriculumId, accountId); - // 告诉浏览器用什么软件可以打开此文件 - response.setHeader("content-Type", "application/vnd.ms-excel"); - // 下载文件的默认名称 - response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("学生练习实验成绩", "UTF-8") + ".xls"); - //编码 - response.setCharacterEncoding("UTF-8"); - Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), ExportByStudentResp.class, retList); - ExportParams exportParams = new ExportParams(null, "delivery", ExcelType.XSSF); - exportParams.setStyle(ExcelStyleUtil.class); - workbook.write(response.getOutputStream()); - } - - @Override - public R practiceByStudentDetail(Integer curriculumId, Integer projectId, Integer accountId, Integer pageNum, Integer pageSize) { - Page page = new Page(pageNum, pageSize); - return R.ok().put("data", baseMapper.practiceByStudentDetail(page, curriculumId, projectId, accountId)); - } - - @Override - public void exportPracticeByStudentDetail(String ids, Integer projectId, Integer accountId, HttpServletResponse response) throws Exception { - List retList = baseMapper.exportPracticeByStudentDetail(ids, projectId, accountId); - // 告诉浏览器用什么软件可以打开此文件 - response.setHeader("content-Type", "application/vnd.ms-excel"); - // 下载文件的默认名称 - response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("实验记录明细", "UTF-8") + ".xls"); - //编码 - response.setCharacterEncoding("UTF-8"); - Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), StuExportAchievementResp.class, retList); - ExportParams exportParams = new ExportParams(null, "delivery", ExcelType.XSSF); - exportParams.setStyle(ExcelStyleUtil.class); - workbook.write(response.getOutputStream()); - } - - @Override - public R reportDetail(Integer reportId) { - - com.huoran.common.entity.ExperimentalReport report = experimentalReportMapper.selectById(reportId); - if (ObjectUtils.isEmpty(report.getAccountId())) { - return R.error("账号不存在!"); - } - //班级id不为空 - /*if (report.getClassId() != null) { - if (StrUtil.isNotEmpty(report.getClassId().toString())) { - Class aClass = classMapper.selectById(report.getClassId()); - report.setClassName(aClass.getClassName()); - } - }*/ - - //实验报告班级读取学生管理学生所在班级 - StudentInfoResp getStudentClass = studentMapper.getStudentInfoByAccountId(report.getAccountId()); - - //班级增加判断 判断老师或者超管情况是没有班级的 - if (getStudentClass != null) { - if (getStudentClass.getClassId().equals("1")) { - report.setClassName(null); - } else { - if (StringUtils.isEmpty(report.getClassName())) { - //当实验报告自改班级名称为空时候默认读取学生管理所在的班级 - report.setClassName(getStudentClass.getClassName()); - } - } - } - - - //查询指导老师,客户实验报告为空,查询用户为空 - if (report.getAssessmentId() != null) { - - if (StrUtil.isNotEmpty(report.getAssessmentId().toString())) { - String name = experimentalReportMapper.selectTeacherName(report.getAssessmentId()); - report.setTeacherName(name); - } - } - HashMap map = experimentalReportMapper.queryUserInfo(report.getAccountId()); - if (!ObjectUtils.isEmpty(map)) { - report.setUserName(map.get("userName")); - report.setWorkNumber(map.get("workNumber")); - } - - if (ObjectUtils.isEmpty(report)) { - return R.error("实验报告查询失败!"); - } - if (ObjectUtils.isEmpty(report.getProjectId())) { - return R.error("项目id不存在!"); - } - -// 根据系统查询判分点类型 -// List userScores = userScoreMapper.selectList(new QueryWrapper().eq("report_id", reportId)); - - List userScores = userScoreMapper.selectScoreList(reportId); - if (projectManageMapper.selectSystemType(userScores.get(0).getSystemId()) == 0) { - for (UserScore userScore : userScores) { - BcJudgmentPoint point = userScoreMapper.selectJudgmentNameByBcId(userScore.getJudgmentId()); - userScore.setJudgmentName(point.getName()); - userScore.setReferenceAnswer(point.getExperimentCode()); - - PythonRunCode pythonRunCode = new PythonRunCode(); - pythonRunCode.setReportId(reportId); - pythonRunCode.setJudgmentPointsId(userScore.getJudgmentId()); - - String userCode = runCodeMapper.getRunCode(pythonRunCode); - - - String runPhotoUrl = runCodeMapper.getRunPhotoUrlString(reportId, userScore.getJudgmentId()); - if (runPhotoUrl != null) { - //runThePictureList:储存处理好转换集合的 - List runThePictureList = new ArrayList<>(); - for (String url : runPhotoUrl.split(",")) { - if (url.equals("")) { - continue; - } - runThePictureList.add(url); - } - userScore.setRunThePictureList(runThePictureList);//用户运行的图片集合 - userScore.setRunThePicture(runPhotoUrl);//分割前的 - } - - //UserScore userAnswer = userScoreMapper.selectById(userScore.getId()); - - userScore.setAnswer(userCode);//用户答案(这里的答案只是的用户输入的代码,并非运行出来的结果) - - } - } else { - //流程类 - for (UserScore userScore : userScores) { - if (userScore.getSystemId() == 19) { - List lcRuleRecord = baseMapper.getStRuleRecord(userScore.getAnswer()); - - for (LcRuleRecord ruleRecord : lcRuleRecord) { - //选择题型,根据id查询选择名称 - if (StringUtils.isNotEmpty(ruleRecord.getType()) && "1".equals(ruleRecord.getType())) { - /* //为id查询数据库 - String options = baseMapper.getStItemOptions(ruleRecord.getRuleAnswer()); - ruleRecord.setRuleAnswer(options);*/ - - //为id查询数据库 -// if (isNumeric(ruleRecord.getRuleAnswer())) { - String options = baseMapper.getStItemOptions(ruleRecord.getRuleAnswer()); - ruleRecord.setRuleAnswer(options); -// } -// if (isNumeric(ruleRecord.getUserAnswer())) { - String userAnswer = baseMapper.getStItemOptions(ruleRecord.getUserAnswer()); - ruleRecord.setUserAnswer(userAnswer); -// } - } - - } - - - userScore.setLcRuleRecords(lcRuleRecord); - String judgmentName = userScoreMapper.selectJudgmentNameById(userScore.getJudgmentId()); - userScore.setJudgmentName(judgmentName); - } else { - List lcRuleRecord = baseMapper.getLcRuleRecord(userScore.getAnswer()); - for (LcRuleRecord ruleRecord : lcRuleRecord) { - //选择题型,根据id查询选择名称 - if (StringUtils.isNotEmpty(ruleRecord.getType()) && "1".equals(ruleRecord.getType())) { - //为id查询数据库 - if (isNumeric(ruleRecord.getRuleAnswer())) { - String options = baseMapper.getItemOptions(ruleRecord.getRuleAnswer()); - ruleRecord.setRuleAnswer(options); - } - if (isNumeric(ruleRecord.getUserAnswer())) { - String options = baseMapper.getItemOptions(ruleRecord.getUserAnswer()); - ruleRecord.setUserAnswer(options); - } - } - } - userScore.setLcRuleRecords(lcRuleRecord); - String judgmentName = userScoreMapper.selectJudgmentNameById(userScore.getJudgmentId()); - userScore.setJudgmentName(judgmentName); - } - } - } - - return R.ok().put("report", report).put("userScores", userScores); - } - - public static boolean isNumeric(String str) { - return str.matches("-?\\d+(\\.\\d+)?"); - } - - @Override - public R practiceActivity(Integer projectId, Integer pageNum, Integer pageSize, Integer schoolId, Integer classId, String keyWord, Integer mallId) { - - - Page page = new Page(pageNum, pageSize); - IPage iPage = baseMapper.practiceActivity(page, projectId, schoolId, classId, keyWord, mallId); - return R.ok(iPage); - } - - @Override - public void exportDataInBatches(List list, HttpServletResponse response) throws Exception { - // 告诉浏览器用什么软件可以打开此文件 - response.setHeader("content-Type", "application/vnd.ms-excel"); - // 下载文件的默认名称 - response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("活跃度列表", "UTF-8") + ".xls"); - //编码 - response.setCharacterEncoding("UTF-8"); - Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), ActivityDerivationVO.class, list); - ExportParams exportParams = new ExportParams(null, "delivery", ExcelType.XSSF); - exportParams.setStyle(ExcelStyleUtil.class); - workbook.write(response.getOutputStream()); - } - - @Override - public void exportAllData(Integer projectId, Integer schoolId, HttpServletResponse response, Integer mallId) throws Exception { - Page page = new Page(1, 10000); - IPage list = baseMapper.exportAllData(page, projectId, schoolId, mallId); - // 告诉浏览器用什么软件可以打开此文件 - response.setHeader("content-Type", "application/vnd.ms-excel"); - // 下载文件的默认名称 - response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("活跃度列表", "UTF-8") + ".xls"); - //编码 - response.setCharacterEncoding("UTF-8"); - Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), ActivityDerivationVO.class, list.getRecords()); - ExportParams exportParams = new ExportParams(null, "delivery", ExcelType.XSSF); - exportParams.setStyle(ExcelStyleUtil.class); - workbook.write(response.getOutputStream()); - - } - - @Override - public R maximumPracticeScoreList(Integer projectId, Integer pageNum, Integer pageSize, Integer schoolId, Integer mallId) { - Page page = new Page(pageNum, pageSize); - IPage iPage = baseMapper.maximumPracticeScoreList(page, projectId, schoolId, mallId); - return R.ok(iPage); - } - - @Override - public R getTheMostUsedCoursesInOurSchool(Integer schoolId) { - return R.ok().put("data", experimentalReportMapper.getTheMostUsedCoursesInOurSchool(schoolId)); - } - - @Override - public R academicLeadersRanking(Integer schoolId, PageReq req) { - Page page = new Page(req.getPageNum(), req.getPageSize()); - return R.ok().put("data", experimentalReportMapper.academicLeadersRanking(page, schoolId)); - } - - /** - * @param schoolId - * @param choose 筛选为本月/本日 - * @return - */ - @Override - public R examStatistics(Integer schoolId, Integer choose) { - ExamStatisticsResp resp = experimentalReportMapper.examStatistics(schoolId, choose); - String examPassRate = "0%"; - //合格人数÷考试总人数×100%=合格率 - if (resp.getNumberOfPeoplePassed() != 0) { - examPassRate = getPercentage(resp.getNumberOfPeoplePassed(), resp.getReferenceNumber()); - } - resp.setExamPassRate(examPassRate);//通过率 - return R.ok().put("data", resp); - } - - - @Override - public R studentGradeDistribution(Integer schoolId, List req) { - //上学期统计的时间为2月1日-8月30日,下学期为9月1日到1月30。 - - - List retList = new ArrayList<>(); - - for (StudentPerformanceAnalysisReq forReq : req) { - StudentPerformanceAnalysisResp analysisResp = experimentalReportMapper.studentGradeDistribution(schoolId, forReq.getStartTime(), forReq.getEndTime()); - if (analysisResp != null) { - Integer getYear = Integer.valueOf(SemesterDateUtils.getYear(forReq.getStartTime())); - Integer getMonth = Integer.valueOf(SemesterDateUtils.getMonth(forReq.getStartTime())); - - String appendTime = ""; - if (getMonth >= 1 && getMonth <= 6) { - appendTime = getYear + "上半年"; - } else { - appendTime = getYear + "下半年"; - } - analysisResp.setTime(appendTime); - retList.add(analysisResp); - } - - } - - - return R.ok().put("data", retList); - } - - @Override - public R studentAssessSchievement(Integer schoolId, List req) { - List retList = new ArrayList<>(); - - for (StudentPerformanceAnalysisReq forReq : req) { - List analysisResp = experimentalReportMapper.studentAssessSchievement(schoolId, forReq.getStartTime(), forReq.getEndTime(), forReq.getCids()); - if (analysisResp != null) { - Integer getYear = Integer.valueOf(SemesterDateUtils.getYear(forReq.getStartTime())); - Integer getMonth = Integer.valueOf(SemesterDateUtils.getMonth(forReq.getStartTime())); - - String appendTime = ""; - if (getMonth >= 1 && getMonth <= 6) { - appendTime = getYear + "上半年"; - } else { - appendTime = getYear + "下半年"; - } - StuAssessmentScoreResp scoreResp = new StuAssessmentScoreResp(); - scoreResp.setTime(appendTime); - scoreResp.setAssesScoreRespList(analysisResp); - retList.add(scoreResp); - } - - } - - - return R.ok().put("data", retList); - } - - @Override - public R overviewOfOurSchoolData(Integer schoolId) { - OverviewOfStudentExperimentDataResp dataResp = experimentalReportMapper.overviewOfOurSchoolData(schoolId); - dataResp.setCumulativeExperimentTime(turnDayHourMinuteString(Integer.valueOf(dataResp.getCumulativeExperimentTime()))); - dataResp.setCourseStudyTime(turnDayHourMinuteString(Integer.valueOf(dataResp.getCourseStudyTime()))); - return R.ok().put("data", dataResp); - } - - @Override - public R monthlyAverageOnlineTime(Integer schoolId, List req) { - - List retList = new ArrayList<>(); - - for (StudentPerformanceAnalysisReq forReq : req) { - MonthlyOnlineStudyHoursResp resp = playRecordMapper.monthlyAverageOnlineTime(schoolId, forReq.getStartTime(), forReq.getEndTime()); - if (resp != null) { - Integer getYear = Integer.valueOf(SemesterDateUtils.getYear(forReq.getStartTime())); - Integer getMonth = Integer.valueOf(SemesterDateUtils.getMonth(forReq.getStartTime())); - - - if (resp.getAverageDuration().trim().equals("0E-8")) { - BigDecimal bigDecimal1 = new BigDecimal(resp.getAverageDuration()); - resp.setAverageDuration(bigDecimal1 + ""); - } - resp.setTime(getYear + "年" + getMonth + ""); - retList.add(resp); - - } - - } - - - return R.ok().put("data", retList); - } - - @Override - public R courseRankings(Integer schoolId) { - - List list = playRecordMapper.courseRankings(schoolId); - - return R.ok().put("data", list); - } - - /** - * 活跃度排行榜 - * - * @param schoolId - * @return - */ - @Override - public R activityRanking(Integer schoolId) { - if (schoolId == -1) { - List list = baseMapper.schoolActivityRanking(); - return R.ok(list); - } - - - //循环查询出来本校实验报告,并且附带了练习的班级(一个人可同时存在多个班级,这时则练习算在每个班级练习了一次) - List list = baseMapper.activityRanking(schoolId); - - Set classSet = new HashSet<>(); - for (ActiveLeaderboardtResp studentinfo : list) { - if (studentinfo.getClassIds().contains(",")) { - for (String id : studentinfo.getClassIds().split(",")) { - classSet.add(Integer.valueOf(id)); - } - } else { - classSet.add(Integer.valueOf(studentinfo.getClassIds())); - } - } - - - List retList = new ArrayList<>(); - //classSet 获取到本校参与练习的全部班级id - if (classSet.size() > 0) { - for (Integer classId : classSet) { - - Class checkClassExist = classMapper.selectById(classId); - if (checkClassExist != null) { - ReturnActiveRankingResp returnActiveRankingResp = new ReturnActiveRankingResp(); - returnActiveRankingResp.setClassId(classId); - - //班级统计 - BigDecimal classPracticeTimes = new BigDecimal(baseMapper.classPracticeTimes(schoolId, classId).getClassPracticeTimes()); - returnActiveRankingResp.setClassPracticeTimes(classPracticeTimes + ""); - - - //班级总人数 - BigDecimal totalClassSize = new BigDecimal(baseMapper.classPracticeTimes(schoolId, classId).getTotalClassSize()); - returnActiveRankingResp.setTotalClassSize(totalClassSize + ""); - - //活跃指数 - returnActiveRankingResp.setActivityIndex(classPracticeTimes.divide(totalClassSize, 2, ROUND_HALF_DOWN)); - retList.add(returnActiveRankingResp); - } - } - } - - for (ReturnActiveRankingResp cla : retList) { - //拿到班级的上级年级以及上上级专业 - - if (cla.getClassId() != 1) { - - Class c = classMapper.selectById(cla.getClassId()); - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("id", c.getArchitectureId()); - Architecture getGrade = architectureMapper.selectOne(wrapper); - //根据年级拿到专业信息 - QueryWrapper wrapper1 = new QueryWrapper<>(); - wrapper1.eq("id", getGrade.getParentId()); - Architecture getProfessional = architectureMapper.selectOne(wrapper1); - cla.setClassName(getProfessional.getOrganizationName() + "/" + getGrade.getOrganizationName() + "/" + c.getClassName()); - cla.setSchoolId(getProfessional.getSchoolId()); - cla.setSchoolName(nakadaiClient.getTheSchoolNameBySchoolId(getProfessional.getSchoolId()).getSchoolName()); - } - } - - //降序排序 - retList.sort(Comparator.comparing(ReturnActiveRankingResp::getActivityIndex).reversed()); - //取值取前十 - if (retList.size() > 10) { - retList = retList.subList(0, 10); - } - - - return R.ok(retList); - } - - @Override - public List getProduct(Integer schoolId) { - return baseMapper.getProduct(schoolId); - } - - @Override - public R productReadScore(PerformanceUnderProductReq req) { - - //获取练习的各个分数段人数 - FractionalSegmentResp stageNumber = baseMapper.productPracticeStageScoreData(req); - Page page = new Page(req.getPageNum(), req.getPageSize()); - //筛选类型(0、练习 1、考核 2、竞赛) - switch (req.getPermissions()) { - case 0: - //练习板块数据 - PerformanceUnderProductResp exerciseBlockData = baseMapper.practicePlateDataUnderProduct(req); - //错误率分析 - List projectErrorRateAnalysisUnderProduct = baseMapper.projectErrorRateAnalysisUnderProduct(req); - //用户成绩列表 - IPage userScoreList = baseMapper.listOfProjectResultsUnderTheProduct(page, req); - - - Integer totalNumberOfSchoolPracticeProjects = 0;//学校练习项目总数 - Integer builtInTotalNumberOfExercises = 0;//内置的练习项目总数 - builtInTotalNumberOfExercises = projectManageMapper.getCurriculumCountByType(req.getCid(), 0); - totalNumberOfSchoolPracticeProjects = projectManageMapper.projectCreatedUnderProduct(req.getMallId(), 0, req.getSchoolId()); - - //拼接练习项目数量+全部练习项目总数 - Integer numberOfExercises = builtInTotalNumberOfExercises + totalNumberOfSchoolPracticeProjects; - for (PracticeProjectsUnderTheProductResp resp : userScoreList.getRecords()) { - resp.setTotalNumberOfPractices(resp.getTotalNumberOfPractices() + "/" + numberOfExercises); - } - - - return R.ok().put("experimentalStatistics", exerciseBlockData).put("stageNumber", stageNumber).put("projectErrorRateAnalysisUnderProduct", projectErrorRateAnalysisUnderProduct).put("userScoreList", userScoreList); - case 1: - //用户考核成绩列表 - IPage listOfAssessmentResults = baseMapper.listOfAssessmentResultsUnderTheProduct(page, req); - //考核板块数据 - PerformanceUnderProductResp assessmentData = baseMapper.assessPlateDataUnderProduct(req); - - for (AssessProjectsUnderTheProductResp resp : listOfAssessmentResults.getRecords()) { - resp.setTotalNumberOfParticipants(resp.getTotalNumberOfParticipants() + "/" + resp.getTotalAssessment()); - } - //考核项目错误率 - List testErrorRateUnderProduct = baseMapper.testErrorRateUnderProduct(req); - return R.ok().put("experimentalStatistics", assessmentData).put("testErrorRateUnderProduct", testErrorRateUnderProduct).put("stageNumber", stageNumber).put("listOfAssessmentResults", listOfAssessmentResults); - - } - - - return null; - } - - @Override - public R productReadGradeDetails(PerformanceUnderProductReq req) { - //筛选类型(0、练习 1、考核 2、竞赛) - switch (req.getPermissions()) { - case 0: - Page exercisePage = new Page(req.getPageNum(), req.getPageSize()); - IPage userPracticeScoreDetails = baseMapper.userPracticeScoreDetails(exercisePage, req); - return R.ok().put("data", userPracticeScoreDetails); - case 1: - Page assessPage = new Page(req.getPageNum(), req.getPageSize()); - IPage userAssessScoreDetails = baseMapper.userAssessScoreDetails(assessPage, req); - return R.ok().put("data", userAssessScoreDetails); - } - - - return null; - } - - /** - * 导出某生的全部该产品下的练习成绩 - * - * @param req - * @param response - * @param request - * @throws IOException - */ - @Override - public void exportDetailsOfStudentPracticeScores(PerformanceUnderProductReq req, HttpServletResponse response, HttpServletRequest request) throws IOException { - - Page page = new Page(1, 10000); - IPage userPracticeScoreDetails = baseMapper.userPracticeScoreDetails(page, req); - String userName = ""; - for (PracticeScoreDetailsUnderProductResp resp : userPracticeScoreDetails.getRecords()) { - if (resp.getUserName() != null) { - userName = resp.getUserName(); - } - -// resp.setGoodsName(req.getGoodsName()); - } - - // 告诉浏览器用什么软件可以打开此文件 - response.setHeader("content-Type", "application/vnd.ms-excel"); - // 下载文件的默认名称 - response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(userName + "_练习成绩详情", "UTF-8") + ".xls"); - //编码 - response.setCharacterEncoding("UTF-8"); - Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), PracticeScoreDetailsUnderProductResp.class, userPracticeScoreDetails.getRecords()); - ExportParams exportParams = new ExportParams(null, "delivery", ExcelType.XSSF); - exportParams.setStyle(ExcelStyleUtil.class); - workbook.write(response.getOutputStream()); - - } - - @Override - public void exportDetailsOfStudentAssessmentResults(PerformanceUnderProductReq req, HttpServletResponse response, HttpServletRequest request) throws IOException { - Page page = new Page(1, 10000); - IPage userAssessScoreDetails = baseMapper.userAssessScoreDetails(page, req); - String userName = ""; - for (AssessScoreDetailsUnderProductResp resp : userAssessScoreDetails.getRecords()) { - if (resp.getUserName() != null) { - userName = resp.getUserName(); - } - } - - // 告诉浏览器用什么软件可以打开此文件 - response.setHeader("content-Type", "application/vnd.ms-excel"); - // 下载文件的默认名称 - response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(userName + "_考核成绩详情", "UTF-8") + ".xls"); - //编码 - response.setCharacterEncoding("UTF-8"); - Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), AssessScoreDetailsUnderProductResp.class, userAssessScoreDetails.getRecords()); - ExportParams exportParams = new ExportParams(null, userName + "考核成绩详情", ExcelType.XSSF); - exportParams.setStyle(ExcelStyleUtil.class); - workbook.write(response.getOutputStream()); - } - - @Override - public void exportProductPracticeResults(List list, HttpServletResponse response) throws IOException { - // 告诉浏览器用什么软件可以打开此文件 - response.setHeader("content-Type", "application/vnd.ms-excel"); - - // 下载文件的默认名称 - response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("练习成绩列表", "UTF-8") + ".xls"); - //编码 - response.setCharacterEncoding("UTF-8"); - - Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), PracticeProjectsUnderTheProductResp.class, list); - ExportParams exportParams = new ExportParams(null, "练习成绩列表", ExcelType.XSSF); - exportParams.setStyle(ExcelStyleUtil.class); - workbook.write(response.getOutputStream()); - - } - - @Override - public void exportProductAssessResults(List list, HttpServletResponse response) throws IOException { - // 告诉浏览器用什么软件可以打开此文件 - response.setHeader("content-Type", "application/vnd.ms-excel"); - // 下载文件的默认名称 - response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("考核成绩列表", "UTF-8") + ".xls"); - //编码 - //编码 - response.setCharacterEncoding("UTF-8"); - Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), AssessProjectsUnderTheProductResp.class, list); - ExportParams exportParams = new ExportParams(null, "考核成绩列表", ExcelType.XSSF); - exportParams.setStyle(ExcelStyleUtil.class); - workbook.write(response.getOutputStream()); - - } - - @Override - public List experimentalReportDataProcessing() { - return baseMapper.experimentalReportDataProcessing(); - } - - - public static String turnDayHourMinuteString(int m) { - if (m > 0) { - BigDecimal roundThreeCalc = new BigDecimal(m); - BigDecimal hours = (roundThreeCalc.divide(new BigDecimal("60"), 2, ROUND_HALF_DOWN)); - return hours + "h"; - } - return "0h"; - } - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/LogServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/LogServiceImpl.java deleted file mode 100644 index 6e64ba5..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/LogServiceImpl.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.huoran.occupationlab.entity.SysLog; -import com.huoran.occupationlab.mapper.SysLogMapper; -import com.huoran.occupationlab.service.LogService; -import org.springframework.stereotype.Service; - -/** - * 系统日志 - * - * @author cheney - * @version V1.0 - * @date 2022年7月28日 - */ -@Service -public class LogServiceImpl extends ServiceImpl implements LogService { -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/OSSFileServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/OSSFileServiceImpl.java deleted file mode 100644 index 59d66b1..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/OSSFileServiceImpl.java +++ /dev/null @@ -1,163 +0,0 @@ -package com.huoran.occupationlab.service.impl; - - -import com.aliyuncs.DefaultAcsClient; -import com.aliyuncs.exceptions.ClientException; -import com.aliyuncs.vod.model.v20170321.DeleteVideoRequest; -import com.aliyuncs.vod.model.v20170321.DeleteVideoResponse; -import com.aliyuncs.vod.model.v20170321.GetVideoPlayAuthRequest; -import com.aliyuncs.vod.model.v20170321.GetVideoPlayAuthResponse; -import com.huoran.common.entity.FilesResult; -import com.huoran.common.utils.ConstantPropertiesUtil; -import com.huoran.common.utils.VideoUtil; -import com.huoran.occupationlab.service.OSSFileService; -import com.huoran.occupationlab.utils.oss.AliyunOssUtil; -import com.huoran.occupationlab.utils.oss.AliyunVodSDKUtil; -import com.huoran.occupationlab.utils.poi.CustomException; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; -import org.springframework.web.multipart.MultipartFile; - -import java.io.IOException; -import java.io.InputStream; -import java.util.List; - -/** - * @Author chen - * @DATE 2020/10/1 22:01 - * @Version 1.0 - */ -@Slf4j -@Service -public class OSSFileServiceImpl implements OSSFileService { - - - @Override - public FilesResult upload(MultipartFile file, String tableName) throws IOException { - //判断文件是否为视频 - String fileName = tableName+".xls"; - //String fileName = file.getOriginalFilename(); - assert fileName != null; - String suffix = fileName.substring(fileName.lastIndexOf(".") + 1); - boolean isVideo = VideoUtil.isVideo(suffix); - if (isVideo) return vodUpload(file); - return fileupload(file,fileName); - } - - /** - * 文件删除 - * - * @param keys 完整文件名 - * @return 返回成功删除文件名 - */ - @Override - public List fileDeletion(List keys) { - return AliyunOssUtil.deleteFiles(keys); - } - - /** - * 文件上传 - * - * @param file 上传文件 - * @return 返回文件信息 - * @throws IOException IO异常 - */ - @Override - public FilesResult fileupload(MultipartFile file, String tableName) throws IOException { - return AliyunOssUtil.uploadFile(file,tableName); - } - - /** - * 视频上传 - * - * @param file 视频文件 - * @return 返回文件信息 - * @throws IOException IO异常 - */ - @Override - public FilesResult vodUpload(MultipartFile file) throws IOException { - FilesResult filesResult = new FilesResult(); - //获取文件流 - InputStream inputStream = file.getInputStream(); - String originalFilename = file.getOriginalFilename(); - assert originalFilename != null; - String title = originalFilename.substring(0, originalFilename.lastIndexOf(".")); - // 获取文件尾缀 - String fileType = originalFilename.substring(originalFilename.lastIndexOf(".") + 1); - // 文件类型 - filesResult.setFileType(fileType); - - //上传流请求 -// UploadStreamRequest request = new UploadStreamRequest(ConstantPropertiesUtil.ACCESS_KEY_ID, ConstantPropertiesUtil.ACCESS_KEY_SECRET, title, originalFilename, inputStream); -// -// -// UploadVideoImpl uploader = new UploadVideoImpl(); -// UploadStreamResponse response = uploader.uploadStream(request); - - //如果设置回调URL无效,不影响视频上传,可以返回VideoId同时会返回错误码。 - // 其他情况上传失败时,VideoId为空,此时需要根据返回错误码分析具体错误原因 -// String videoId = response.getVideoId(); -// if (!response.isSuccess()) { -// String errorMessage = "阿里云视频上传错误:" + "code:" + response.getCode() + ", message:" + response.getMessage(); -// log.error(errorMessage); -// if (StringUtils.isEmpty(videoId)) { -// throw new CustomException(201, errorMessage); -// } -// } -// filesResult.setFileId(videoId); - return filesResult; - } - - /** - * 根据视频id删除视频 - * - * @param videoId 视频id - */ - @Override - public void removeVideo(String videoId) throws ClientException { - - DefaultAcsClient client = AliyunVodSDKUtil.initVodClient(ConstantPropertiesUtil.ACCESS_KEY_ID, ConstantPropertiesUtil.ACCESS_KEY_SECRET); - - DeleteVideoRequest request = new DeleteVideoRequest(); - request.setVideoIds(videoId); - DeleteVideoResponse response = client.getAcsResponse(request); - System.out.print("RequestId = " + response.getRequestId() + "\n"); - } - - /** - * 根据视频id批量删除视频 - * - * @param videoIdList 视频id - */ - @Override - public void removeMoreVideo(List videoIdList) throws ClientException { - DefaultAcsClient client = AliyunVodSDKUtil.initVodClient(ConstantPropertiesUtil.ACCESS_KEY_ID, ConstantPropertiesUtil.ACCESS_KEY_SECRET); - DeleteVideoRequest request = new DeleteVideoRequest(); - //使用工具类将集合转化成指定的字符串 - String videos = StringUtils.join(videoIdList, ","); - request.setVideoIds(videos); - DeleteVideoResponse response = client.getAcsResponse(request); - System.out.print("RequestId = " + response.getRequestId() + "\n"); - } - - /** - * 根据视频id获取播放凭证 - * - * @param videoId 视频id - * @return 返回凭证 - */ - @Override - public String getPlayAuth(String videoId) throws ClientException { - - DefaultAcsClient client = AliyunVodSDKUtil.initVodClient(ConstantPropertiesUtil.ACCESS_KEY_ID, ConstantPropertiesUtil.ACCESS_KEY_SECRET); - - GetVideoPlayAuthRequest request = new GetVideoPlayAuthRequest(); - - request.setVideoId(videoId); - - GetVideoPlayAuthResponse response = client.getAcsResponse(request); - //得到播放凭证并返回 - return response.getPlayAuth(); - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/PermissionServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/PermissionServiceImpl.java deleted file mode 100644 index 5543e8d..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/PermissionServiceImpl.java +++ /dev/null @@ -1,222 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.huoran.occupationlab.entity.*; -import com.huoran.occupationlab.entity.vo.PermissionVO; -import com.huoran.occupationlab.helper.MemuHelper; -import com.huoran.occupationlab.helper.PermissionHelper; -import com.huoran.occupationlab.mapper.PermissionMapper; -import com.huoran.occupationlab.service.PermissionService; -import com.huoran.occupationlab.service.RolePermissionService; -import com.huoran.occupationlab.service.UserInfoService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.util.StringUtils; - -import java.util.ArrayList; -import java.util.List; - -/** - * 权限 服务实现类 - */ -@Service -public class PermissionServiceImpl extends ServiceImpl implements PermissionService { - - @Autowired - private RolePermissionService rolePermissionService; - - @Autowired - private UserInfoService userInfoService; - - - //获取全部权限菜单 - @Override - public List queryAllMenu() { - - QueryWrapper wrapper = new QueryWrapper<>(); - List permissionList = baseMapper.selectList(wrapper); - List result = bulid(permissionList); - - return result; - } - - //获取管理端权限菜单 - @Override - public List queryManagementAllMenu() { - - QueryWrapper wrapper = new QueryWrapper<>(); - List permissionList = baseMapper.selectList(wrapper); - List result = managementBulid(permissionList); - - return result; - } - - //根据角色获取菜单 - @Override - public List selectAllMenu(String roleId, Integer isPort) { - List allPermissionList = baseMapper.selectList(new QueryWrapper().orderByAsc("CAST(id AS SIGNED)")); - - //根据角色id获取角色权限 - List rolePermissionList = rolePermissionService.list(new QueryWrapper().eq("role_id", roleId).eq("is_port", isPort)); - //转换给角色id与角色权限对应Map对象 - for (int i = 0; i < allPermissionList.size(); i++) { - AclPermission permission = allPermissionList.get(i); - for (int m = 0; m < rolePermissionList.size(); m++) { - AclRolePermission rolePermission = rolePermissionList.get(m); - if (rolePermission.getPermissionId().equals(permission.getId())) { - permission.setSelect(true); - } - } - } - if (isPort == 1) { - List permissionList = bulid(allPermissionList); - return permissionList; - } else { - List permissionList = managementBulid(allPermissionList); - return permissionList; - } - } - - //给角色分配权限 - @Override - public void saveRolePermissionRelationShip(PermissionVO permissionVO) { - String roleId = permissionVO.getRoleId(); - Integer isPort = permissionVO.getIsPort(); - - rolePermissionService.remove(new QueryWrapper().eq("role_id", roleId).eq("is_port", isPort)); - - List rolePermissionList = new ArrayList<>(); - for (String permissionId : permissionVO.getPermissionId()) { - if (StringUtils.isEmpty(permissionId)) continue; - AclRolePermission rolePermission = new AclRolePermission(); - rolePermission.setRoleId(roleId); - rolePermission.setPermissionId(permissionId); - rolePermission.setIsPort(isPort); - rolePermissionList.add(rolePermission); - } - rolePermissionService.saveBatch(rolePermissionList); - } - - //递归删除菜单 - @Override - public void removeChildById(String id) { - List idList = new ArrayList<>(); - this.selectChildListById(id, idList); - - idList.add(id); - baseMapper.deleteBatchIds(idList); - } - - // 根据用户id获取用户菜单 - @Override - public List selectPermissionValueByUserId(String id) { - - List selectPermissionValueList = null; - if (this.isSysAdmin(id)) { - //如果是系统管理员,获取所有权限 - selectPermissionValueList = baseMapper.selectAllPermissionValue(); - } else { - selectPermissionValueList = baseMapper.selectPermissionValueByUserId(id); - } - return selectPermissionValueList; - } - - @Override - public List selectRoleMenu(String roleId) { - - // //查询所有的菜单 - // List permissions = baseMapper.selectList(new QueryWrapper().select("id,name")); - - //根据角色id,查询角色的菜单 - List rolePermissions = rolePermissionService.list(new QueryWrapper().eq("role_id", roleId).select("permission_id")); - List list = new ArrayList<>(); - rolePermissions.forEach(rolePermission -> { - String permissionId = rolePermission.getPermissionId(); - list.add(permissionId); - }); - return list; - } - - @Override - public List selectPermissionByUserId(String userId) { - List selectPermissionList = null; - if (this.isSysAdmin(userId)) { - //如果是超级管理员,获取所有菜单 - selectPermissionList = baseMapper.selectList(null); - } else { - selectPermissionList = baseMapper.selectPermissionByUserId(userId); - } - - List permissionList = PermissionHelper.bulid(selectPermissionList); - List result = MemuHelper.bulid(permissionList); - return result; - } - - /** - * 判断账户是否超级管理员 - */ - private boolean isSysAdmin(String userId) { - HrUserInfo user = userInfoService.getById(userId); - return null != user && "admin".equals(user.getAccount()); - } - - /** - * 递归获取子节点 - */ - private void selectChildListById(String id, List idList) { - List childList = baseMapper.selectList(new QueryWrapper().eq("pid", id).select("id")); - childList.stream().forEach(item -> { - idList.add(item.getId()); - this.selectChildListById(item.getId(), idList); - }); - } - - /** - * 使用递归方法构建权限菜单 - */ - private static List bulid(List treeNodes) { - List trees = new ArrayList<>(); - for (AclPermission treeNode : treeNodes) { - if ("0".equals(treeNode.getPid())) { - treeNode.setLevel(1); - trees.add(findChildren(treeNode, treeNodes)); - } - } - return trees; - } - - /** - * 使用递归方法构建权限菜单 - */ - private static List managementBulid(List treeNodes) { - List trees = new ArrayList<>(); - for (AclPermission treeNode : treeNodes) { - if ("00".equals(treeNode.getPid())) { - treeNode.setLevel(1); - trees.add(findChildren(treeNode, treeNodes)); - } - } - return trees; - } - - /** - * 递归查找子节点 - */ - private static AclPermission findChildren(AclPermission treeNode, List treeNodes) { - treeNode.setChildren(new ArrayList()); - - for (AclPermission it : treeNodes) { - if (treeNode.getId().equals(it.getPid())) { - int level = treeNode.getLevel() + 1; - it.setLevel(level); - if (treeNode.getChildren() == null) { - treeNode.setChildren(new ArrayList<>()); - } - treeNode.getChildren().add(findChildren(it, treeNodes)); - } - } - return treeNode; - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/PlayRecordServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/PlayRecordServiceImpl.java deleted file mode 100644 index 4159e7b..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/PlayRecordServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.huoran.occupationlab.entity.PlayRecord; -import com.huoran.occupationlab.mapper.PlayRecordMapper; -import com.huoran.occupationlab.service.PlayRecordService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -/** - *

- * 资源播放记录表 服务实现类 - *

- * - * @author lr - * @since 2022-09-09 - */ -@Service -public class PlayRecordServiceImpl extends ServiceImpl implements PlayRecordService { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ProjectHiddenServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ProjectHiddenServiceImpl.java deleted file mode 100644 index 6653410..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ProjectHiddenServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.huoran.occupationlab.entity.ProjectHidden; -import com.huoran.occupationlab.mapper.ProjectHiddenMapper; -import com.huoran.occupationlab.service.ProjectHiddenService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -/** - *

- * 此表是在教师端成绩管理,虚仿以及教学列表展示中使用到 服务实现类 - *

- * - * @author lr - * @since 2021-09-23 - */ -@Service -public class ProjectHiddenServiceImpl extends ServiceImpl implements ProjectHiddenService { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ProjectJudgmentServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ProjectJudgmentServiceImpl.java deleted file mode 100644 index 68bdd79..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ProjectJudgmentServiceImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.huoran.common.entity.ProjectManage; -import com.huoran.occupationlab.entity.ProjectJudgment; -import com.huoran.occupationlab.mapper.ProjectJudgmentMapper; -import com.huoran.occupationlab.mapper.ProjectManageMapper; -import com.huoran.occupationlab.service.ProjectJudgmentService; -import com.huoran.occupationlab.utils.CollectionUtil; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.ObjectUtils; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -/** - *

- * 项目管理判分点绑定表 服务实现类 - *

- * - * @author Mr.JK - * @since 2021-08-26 - */ -@Service -public class ProjectJudgmentServiceImpl extends ServiceImpl implements ProjectJudgmentService { - - @Autowired - private ProjectJudgmentMapper projectJudgmentMapper; - - @Autowired - private ProjectManageMapper projectManageMapper; - -// @Autowired -// private JudgmentPointClient judgmentPointClient; - - @Override - public Integer getJudgmentScore(Integer projectId, Integer judgmentId) { - ProjectJudgment projectJudgment = projectJudgmentMapper.selectOne(new QueryWrapper() - .eq("project_id", projectId).eq("judgment_id", judgmentId)); - if (ObjectUtils.isEmpty(projectJudgment)) { - return null; - } - return projectJudgment.getScore(); - } - - @Override - @Transactional(rollbackFor = RuntimeException.class) - public Integer updateProjectJudgment(Integer projectId, List projectJudgments) { - //编辑排序,不影响原本判分点顺序,存在添加绑定关系,不存在解除绑定 - ArrayList before = new ArrayList<>(); - ArrayList after = new ArrayList<>(); - - //查询项目修改前判分点 - QueryWrapper queryWrapper = new QueryWrapper().eq("project_id", projectId); - - List oldJudgmentList = projectJudgmentMapper.selectList(queryWrapper); - for (ProjectJudgment projectJudgment : oldJudgmentList) { - before.add(projectJudgment.getId()); - } - - //更新判分点内容 - ProjectManage projectManage = projectManageMapper.selectById(projectId); - for (ProjectJudgment judgment : projectJudgments) { - //id为空新增 - if (ObjectUtils.isEmpty(judgment.getId())) { - projectJudgmentMapper.insert(judgment); - } else { - projectJudgmentMapper.updateJudgment(judgment.getId(), judgment.getScore(), judgment.getSort()); - after.add(judgment.getId()); - } - } - - //长度变化,表示有删减 - if (before.size() != after.size()) { - Collection differentNoDuplicate = CollectionUtil.getDifferentNoDuplicate(before, after); - differentNoDuplicate.forEach(i -> { - //删除项目中的判分点 - projectJudgmentMapper.deleteById((Integer) i); - - //解绑 -// if (projectManage.getSystemId() <= 10) { -// judgmentPointClient.bcBandingProject((Integer) i, projectId, 0); -// } else { -// judgmentPointClient.lcBandingProject((Integer) i, projectId, 0); -// } - }); - } - - - return 1; - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ProjectManageDisableServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ProjectManageDisableServiceImpl.java deleted file mode 100644 index c0bfafc..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ProjectManageDisableServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.huoran.occupationlab.entity.ProjectManageDisable; -import com.huoran.occupationlab.mapper.ProjectManageDisableMapper; -import com.huoran.occupationlab.service.ProjectManageDisableService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -/** - *

- * 记录项目学校端的禁用记录 服务实现类 - *

- * - * @author lr - * @since 2022-01-12 - */ -@Service -public class ProjectManageDisableServiceImpl extends ServiceImpl implements ProjectManageDisableService { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ProjectManageServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ProjectManageServiceImpl.java deleted file mode 100644 index f7394ed..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ProjectManageServiceImpl.java +++ /dev/null @@ -1,754 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.huoran.api.NakadaiClient; -import com.huoran.api.UserClient; -import com.huoran.common.constant.DelConstant; -import com.huoran.common.constant.PlatformConstant; -import com.huoran.common.entity.BcJudgmentPoint; -import com.huoran.common.entity.LcJudgmentPoint; -import com.huoran.common.entity.ProjectJudgmentVo; -import com.huoran.common.entity.ProjectManage; -import com.huoran.common.entity.to.JudgmentPointDataTo; -import com.huoran.common.entity.to.ProjectDataTo; -import com.huoran.common.exception.CustomException; -import com.huoran.common.exception.ExceptionEnum; -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.ProjectJudgment; -import com.huoran.occupationlab.entity.ProjectManageDisable; -import com.huoran.occupationlab.entity.SchoolProjectHintOpen; -import com.huoran.occupationlab.entity.req.PageAssessmentForProjectReq; -import com.huoran.occupationlab.entity.req.ProjectManageReq; -import com.huoran.occupationlab.entity.vo.ProjectVo; -import com.huoran.occupationlab.mapper.ProjectJudgmentMapper; -import com.huoran.occupationlab.mapper.ProjectManageDisableMapper; -import com.huoran.occupationlab.mapper.ProjectManageMapper; -import com.huoran.occupationlab.mapper.SchoolProjectHintOpenMapper; -import com.huoran.occupationlab.service.ProjectManageService; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.ObjectUtils; -import org.springframework.util.StringUtils; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - -/** - *

- * 项目管理表 服务实现类 - *

- * - * @author Mr.JK - * @since 2021-08-26 - */ -@Service -public class ProjectManageServiceImpl extends ServiceImpl implements ProjectManageService { - - @Autowired - private ProjectManageMapper projectManageMapper; - - @Autowired - private ProjectJudgmentMapper projectJudgmentMapper; - - @Autowired - private SchoolProjectHintOpenMapper schoolProjectHintOpenMapper; - -// @Autowired -// private JudgmentPointClient judgmentPointClient; - - @Autowired - private NakadaiClient nakadaiClient; - - @Autowired - private UserClient userClient; - - @Autowired - private ProjectManageDisableMapper disableMapper; - - @Override - @Transactional - public R addProjectManage(ProjectVo projectVo) { - - ProjectManage projectManage = projectVo.getProjectManage(); - if (projectManage.getState() == 0) { - projectManage.setIsOpen(1); - } - if (projectManage.getSchoolId().equals("0")) { - projectManage.setFounder(1);//创建人角色(0、系统 1、老师) - } - - //新增项目管理 - int ret = projectManageMapper.insert(projectManage); - if (ret < 1) { - throw new CustomException(ExceptionEnum.INSERT_PROJECT_MANAGE_FAIL); - } - - //新增项目管理判分点中间表 - for (ProjectJudgment projectJudgment : projectVo.getProjectJudgmentList()) { - projectJudgment.setProjectId(projectManage.getProjectId()); - projectJudgmentMapper.insert(projectJudgment); - } - - //绑定判分点 - Integer result = this.bindProjectJudgment(projectManage.getSystemId(), - projectManage.getProjectId(), projectVo.getProjectJudgmentList()); - if (result == 0) { - return R.error("判分点绑定失败!"); - } - return R.ok(); - } - - @Override - @Transactional - public R updateProjectManage(ProjectVo projectVo) { - - ProjectManage projectManage = projectVo.getProjectManage(); - int ret = projectManageMapper.updateById(projectManage); - if (ret < 1) { - throw new CustomException(ExceptionEnum.UPDATE_PROJECT_MANAGE_FAIL); - } - return R.ok(); - } - - private Integer bindProjectJudgment(Integer systemId, Integer projectId, List projectJudgmentList) { - int result = 1; -// 根据系统查询判分点类型 - Integer type = baseMapper.selectSystemType(systemId); - for (ProjectJudgment projectJudgment : projectJudgmentList) { - - //判分点绑定--根据系统 11为流程类 -// if (type == 0) { -// result = judgmentPointClient -// .bcBandingProject(projectJudgment.getJudgmentId(), projectId, 1); -// } else { -// result = judgmentPointClient -// .lcBandingProject(projectJudgment.getJudgmentId(), projectId, 1); -// } - if (result == 0) { - return 0; - } - } - return 1; - } - - @Override - @Transactional - public R deleteProjectManage(List projectIds, Integer platformId) { - - //职站 - if (platformId.equals(PlatformConstant.POST_STATION)) { - - for (Integer projectId : projectIds) { - ProjectManage projectManage = projectManageMapper.selectById(projectId); - - QueryWrapper wrapper = new QueryWrapper() - .eq("project_id", projectId); - - //解绑判分点绑定的项目管理 - List projectJudgments = projectJudgmentMapper.selectList(wrapper); - -// for (ProjectJudgment judgment : projectJudgments) { -// if (projectManage.getSystemId() <= 10) { -// judgmentPointClient.bcBandingProject(judgment.getJudgmentId(), projectId, 0); -// } else { -// judgmentPointClient.lcBandingProject(judgment.getJudgmentId(), projectId, 0); -// } -// } - - //删除 中间表 - projectJudgmentMapper.delete(wrapper); - } - projectManageMapper.deleteBatchIds(projectIds); - - } - //中台 - if (platformId.equals(PlatformConstant.NAKADAI)) { - ProjectManage projectManage = new ProjectManage(); - projectManage.setZtDel(DelConstant.IS_DEL); - for (Integer projectId : projectIds) { - projectManage.setProjectId(projectId); - projectManageMapper.updateById(projectManage); - } - } - return R.ok(); - } - - @Override - public R getProjectDetail(Integer projectId, Integer stuAssessent, Integer schoolId) { - - ProjectManage projectManage = projectManageMapper.selectById(projectId); - if (projectManage.getFounder() == 0) { - QueryWrapper openQueryWrapper = new QueryWrapper<>(); - openQueryWrapper.eq("school_id", schoolId); - openQueryWrapper.eq("project_id", projectId); - SchoolProjectHintOpen schoolProjectHintOpen = schoolProjectHintOpenMapper.selectOne(openQueryWrapper); - if (ObjectUtil.isNotNull(schoolProjectHintOpen)) { - projectManage.setHintOpenBySchool(schoolProjectHintOpen.getHintOpen()); - } else { - projectManage.setHintOpenBySchool(0); - } - } - - //查询中间关系表 --排序字段 - List projectJudgmentList = projectJudgmentMapper - .selectList(new QueryWrapper().eq("project_id", projectId) - .orderByAsc("sort")); - -// 根据系统查询判分点类型 - Integer type = baseMapper.selectSystemType(projectManage.getSystemId()); - List projectJudgmentVos = new ArrayList<>(); - for (ProjectJudgment projectJudgment : projectJudgmentList) { - BcJudgmentPoint judgmentPoint = null; - //根据系统id获取判分点名称、要求 -// if (type == 0) { -// -// judgmentPoint = judgmentPointClient -// .queryBcJudgmentByBcId(projectJudgment.getJudgmentId(), DelConstant.IS_OPEN); -// if (stuAssessent != null) { -// judgmentPoint = judgmentPointClient -// .queryBcJudgmentByBcId(projectJudgment.getJudgmentId(), null); -// -// } -// -// if (judgmentPoint != null) { -// if (projectManage.getPermissions() == 1) { -// ProjectJudgmentVo projectJudgmentVo = new ProjectJudgmentVo(); -// projectJudgmentVo.setId(projectJudgment.getId()); -// projectJudgmentVo.setScore(projectJudgment.getScore()); -// projectJudgmentVo.setProjectId(projectJudgment.getProjectId().toString()); -// projectJudgmentVo.setJudgmentId(projectJudgment.getJudgmentId()); -// projectJudgmentVo.setName(judgmentPoint.getName()); -// projectJudgmentVo.setExperimentalRequirements(judgmentPoint.getExperimentalRequirements()); -// projectJudgmentVo.setExperimentCodeType(judgmentPoint.getExperimentCodeType()); -// projectJudgmentVo.setExperimentalRequirementsType(judgmentPoint.getExperimentalRequirementsType()); -// projectJudgmentVos.add(projectJudgmentVo); -// } else { -// if (judgmentPoint.getIsOpen() == 0) { -// ProjectJudgmentVo projectJudgmentVo = new ProjectJudgmentVo(); -// projectJudgmentVo.setId(projectJudgment.getId()); -// projectJudgmentVo.setScore(projectJudgment.getScore()); -// projectJudgmentVo.setProjectId(projectJudgment.getProjectId().toString()); -// projectJudgmentVo.setJudgmentId(projectJudgment.getJudgmentId()); -// projectJudgmentVo.setName(judgmentPoint.getName()); -// projectJudgmentVo.setExperimentalRequirements(judgmentPoint.getExperimentalRequirements()); -// projectJudgmentVo.setExperimentCodeType(judgmentPoint.getExperimentCodeType()); -// projectJudgmentVo.setExperimentalRequirementsType(judgmentPoint.getExperimentalRequirementsType()); -// projectJudgmentVos.add(projectJudgmentVo); -// -// } -// } -// } -// -// } else { -// LcJudgmentPoint lcJudgmentPoint = null; -// lcJudgmentPoint = judgmentPointClient -// .queryLcJudgmentByLcId(projectJudgment.getJudgmentId(), DelConstant.IS_OPEN); -// if (stuAssessent != null) { -// lcJudgmentPoint = judgmentPointClient -// .queryLcJudgmentByLcId(projectJudgment.getJudgmentId(), null); -// } -// -// if (ObjectUtil.isNotNull(lcJudgmentPoint)) { -// if (projectManage.getPermissions() == 1) { -// -// ProjectJudgmentVo projectJudgmentVo = new ProjectJudgmentVo(); -// projectJudgmentVo.setId(projectJudgment.getId()); -// projectJudgmentVo.setScore(projectJudgment.getScore()); -// projectJudgmentVo.setProjectId(projectJudgment.getProjectId().toString()); -// projectJudgmentVo.setJudgmentId(projectJudgment.getJudgmentId()); -// projectJudgmentVo.setName(lcJudgmentPoint.getName()); -// projectJudgmentVo.setExperimentalRequirements(lcJudgmentPoint.getExperimentalRequirements()); -// projectJudgmentVos.add(projectJudgmentVo); -// } else { -// if (lcJudgmentPoint.getIsOpen() == 0) { -// ProjectJudgmentVo projectJudgmentVo = new ProjectJudgmentVo(); -// projectJudgmentVo.setId(projectJudgment.getId()); -// projectJudgmentVo.setScore(projectJudgment.getScore()); -// projectJudgmentVo.setProjectId(projectJudgment.getProjectId().toString()); -// projectJudgmentVo.setJudgmentId(projectJudgment.getJudgmentId()); -// projectJudgmentVo.setName(lcJudgmentPoint.getName()); -// projectJudgmentVo.setExperimentalRequirements(lcJudgmentPoint.getExperimentalRequirements()); -// projectJudgmentVos.add(projectJudgmentVo); -// } -// } -// } -// -// } - - } - return R.ok().put("projectManage", projectManage).put("projectJudgmentVos", projectJudgmentVos); - - } - - @Override - public Integer queryNameIsExist(ProjectManage projectManage) { - - Integer projectId = ObjectUtils.isEmpty(projectManage.getProjectId()) ? 0 : projectManage.getProjectId(); - - if (StringUtils.isEmpty(projectManage.getProjectName())) { - return 0; - } - - QueryWrapper wrapper = new QueryWrapper().eq("project_name", projectManage.getProjectName()); - wrapper.eq("is_del", DelConstant.NOT_DEL); - wrapper.eq("zt_del", DelConstant.NOT_DEL); - /*switch (projectManage.getFounder()) { - case 1: - wrapper.eq("school_id", projectManage.getSchoolId()); - break; - }*/ - - ProjectManage newProjectManage = projectManageMapper.selectOne(wrapper); - if (!ObjectUtils.isEmpty(newProjectManage) && !newProjectManage.getProjectId().equals(projectId)) { - return 0; - } - - return 1; - } - - @Override - public R avgValues(Integer number) { - final Integer HUNDRED = 100; - Integer score = HUNDRED / number; - List list = new ArrayList(); - if (HUNDRED % number == 0) { - for (int i = 0; i < number; i++) { - list.add(score); - } - } else { - for (int i = 0; i < number; i++) { - list.add(score); - } - for (int i = HUNDRED % number; i > 0; i--) { - list.set(i, score + 1); - } - } - return R.ok().put("data", list); - } - - @Override - public R getProjectBySystemId(String systemId, String accountId, Integer permissions, Integer cId, Integer mallId) { - - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - - //查询学校在产品下创建的练习项目 - List projectManages = projectManageMapper - .selectList(new QueryWrapper() - .eq("school_id", schoolId) - .eq("permissions", permissions) - .eq("zt_del", DelConstant.NOT_DEL) - .eq("is_del", DelConstant.NOT_DEL) - .eq("zt_open", 0) - .eq("is_open", 0) - .eq("mall_id", mallId).last(" AND FIND_IN_SET( system_id, '" + systemId + "' )") - ); - - //课程排序优于老师创建的项目 - List projectManageList = new ArrayList<>(); - List projectIds = projectManageMapper.selectCurriculumProject(schoolId, systemId, permissions, cId); - - for (Integer projectId : projectIds) { - ProjectManage manage = projectManageMapper.selectById(projectId); - projectManageList.add(manage); - } - projectManageList.addAll(projectManages); - - return R.ok().put("projects", projectManageList).put("projectSize", projectIds.size()); - } - - - @Override - public List getProjectBySystemIdRemoteCall(String systemId, String accountId, Integer permissions, Integer cId, Integer mallId) { - - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - - List projectManages = projectManageMapper - .selectList(new QueryWrapper() - .eq("school_id", schoolId) - .eq("permissions", permissions) - .eq("zt_del", DelConstant.NOT_DEL) - .eq("is_del", DelConstant.NOT_DEL) - .eq("zt_open", 0) - .eq("is_open", 0).eq("mall_id", mallId) - .last(" AND FIND_IN_SET( system_id, '" + systemId + "' )") - ); - - //课程排序优于老师创建的项目 - List projectManageList = new ArrayList<>(); - List projectIds = projectManageMapper.selectCurriculumProject(schoolId, systemId, permissions, cId); - - for (Integer projectId : projectIds) { - ProjectManage manage = projectManageMapper.selectById(projectId); - projectManageList.add(manage); - } - projectManageList.addAll(projectManages); - - return projectManageList; - } - - - @Override - public R copyProjectManage(ProjectVo projectVo) { - - //循环匹配名称 - ProjectManage projectManage = projectVo.getProjectManage(); - String projectName = projectManage.getProjectName(); - for (int i = 1; i < Integer.MAX_VALUE; i++) { - //传进名称无重复 - if (this.queryNameIsExist(projectManage) == 1) { - break; - } - projectManage.setProjectName(projectName + "(" + i + ")"); - Integer ret = this.queryNameIsExist(projectManage); - if (ret == 1) { - //不重复则塞回原对象 - projectVo.getProjectManage().setProjectName(projectName + "(" + i + ")"); - break; - } - } - - //排序赋值 - List newProjectJudgment = new ArrayList<>(); - for (int i = 0; i < projectVo.getProjectJudgmentList().size(); i++) { - ProjectJudgment projectJudgment = projectVo.getProjectJudgmentList().get(i); - projectJudgment.setSort(i + 1); - newProjectJudgment.add(projectJudgment); - } - projectVo.setProjectJudgmentList(newProjectJudgment); - - if (projectVo.getProjectManage().getAccountId() == 1) { - projectVo.getProjectManage().setFounder(0); - } - return this.addProjectManage(projectVo); - } - - @Override - public List getInternalProjectBySystemId(List systemId, Integer permissions) { - String id = ""; - for (Integer sysId : systemId) { - id += sysId + ","; - } - String systemIds = id.substring(0, id.length() - 1); - return baseMapper.selectProjectList(systemIds, permissions); - } - - @Override - public R getSystemIdBySchool(Integer schoolId) { - Integer customerId = nakadaiClient.getCustomerBySchoolId(schoolId); - if (customerId == -1) { - return R.error("查询客户失败!"); - } - List systemIds = nakadaiClient.getSystemIdByCustomerId(customerId); - if (ObjectUtils.isEmpty(systemIds)) { - return R.error("暂无订单,请下单后再查看!"); - } - ArrayList> systemObject = new ArrayList<>(); - for (Integer systemId : systemIds) { - String systemName = nakadaiClient.getSystemNameBySystemId(systemId); - HashMap map = new HashMap<>(); - map.put("id", systemId); - map.put("label", systemName); - systemObject.add(map); - } - return R.ok().put("data", systemObject); - } - - @Override - public void updateIsOpen(Integer projectId, Integer isOpen, Integer platformId, Integer schoolId) { - - if (platformId.equals(PlatformConstant.POST_STATION)) { - //职站(经过职站禁用的项目 添加一条禁用记录至ol_project_manage_disable表) - - //查询项目是否是中台内置还是本校发布的 - ProjectManage manage = baseMapper.selectById(projectId); - switch (manage.getFounder()) { //创建人角色(0、系统 1、老师) - case 0: - switch (isOpen) {//是否开启(0开启 1禁用 默认0) - case 1: - //禁用 增加禁用表记录 - ProjectManageDisable disable = new ProjectManageDisable(); - disable.setSchoolId(schoolId); - disable.setProjectId(projectId); - disableMapper.insert(disable); - break; - case 0: - //启用 删除禁用表记录 - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("school_id", schoolId); - queryWrapper.eq("project_id", projectId); - disableMapper.delete(queryWrapper); - } - break; - case 1: - //对本校的项目进行禁用启用 不对项目禁用表操作!! - projectManageMapper.updateIsOpenZz(projectId, isOpen); - break; - } - - } else { - //中台 - projectManageMapper.updateIsOpenZt(projectId, isOpen); - } - - //新需求 开启时默认发布 - if (isOpen == 0) { - projectManageMapper.updateState(projectId); - } - - } - - @Override - public R queryProjectManageByNakadai(ProjectManageReq projectManageReq) { - /** - * 中台列表需求: - * 从中台进入实验项目管理: - * 系统筛选条件:默认展示内置的项目信息 - * 教师筛选条件:默认展示全部学校发布的项目信息 - * 全部筛选条件:默认展示内置项目信息 以及展示全部学校发布的项目 - */ - Page page = new Page(projectManageReq.getPageNum(), projectManageReq.getPageSize()); - IPage iPage = null; - /* - - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("system_id", projectManageReq.getSystemId()); - - if (projectManageReq.getProjectName() != null) { - queryWrapper.like("project_name", projectManageReq.getProjectName()); - } - - if (projectManageReq.getPermissions() != null) { - queryWrapper.eq("permissions", projectManageReq.getPermissions()); - } - - if (projectManageReq.getState() != null) { - queryWrapper.eq("state", projectManageReq.getState()); - }*/ - - switch (projectManageReq.getFounder()) { - - case 0://0:系统 -// queryWrapper.eq("zt_del", DelConstant.NOT_DEL).eq("founder", projectManageReq.getFounder()).orderByDesc("update_time"); - - //中台——>系统筛选 -// iPage = baseMapper.selectPage(page, queryWrapper); - iPage = baseMapper.nakadaiProjectListBySystem(page, projectManageReq); - return R.ok().put("data", iPage); - case 1://1:老师 - iPage = baseMapper.nakadaiProjectListByTeacher(page, projectManageReq); - return R.ok().put("data", iPage); - case 2: //2:全部 - //中台:查询中台全部数据以及学校发布的全部数据 - iPage = baseMapper.queryNakadaiProjectList(page, projectManageReq); - return R.ok().put("data", iPage); - - } - /*iPage = baseMapper.selectPage(page, queryWrapper); - return R.ok().put("data", iPage);*/ - return R.ok(); - } - - @Override - public R queryProjectManageByOccupationlab(ProjectManageReq projectManageReq) { - /** - *需求: - * 从职站进入实验项目管理: - * 系统筛选条件:默认展示由该校购买的订单下包含的课程下的项目 - * 教师筛选条件:默认展示本校发布的项目信息(同时依据本校角色展示超管、管理员可查看该校全部,其它角色只可看本人发布的) - * 全部筛选条件:默认展示由该校购买的订单下包含的课程下的项目以及默认展示本校发布的项目信息(同时依据本校角色展示超管、管理员可查看该校全部,其它角色只可看本人发布的) - */ - Page page = new Page(projectManageReq.getPageNum(), projectManageReq.getPageSize()); - IPage iPage = null; - - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("school_id", projectManageReq.getSchoolId()); - List disables = disableMapper.selectList(queryWrapper); - if (disables.size() > 0) { - projectManageReq.setOccupationlabDel(1); - } - switch (projectManageReq.getFounder()) { - //0:系统 - case 0: - if (projectManageReq.getPlatformId() == PlatformConstant.POST_STATION) { - //当平台为职站时候查询根据课程绑定的项目(只查询购买订单下课程所绑定启用且未删除的项目) - String cid = nakadaiClient.getSchoolCourse(projectManageReq.getSchoolId()); -// projectManageReq.setCid(cid); - projectManageReq.setCid(projectManageReq.getCid()); - iPage = baseMapper.queryProjectManage(page, projectManageReq); - for (ProjectManage record : iPage.getRecords()) { - QueryWrapper openQueryWrapper = new QueryWrapper<>(); - openQueryWrapper.eq("school_id", projectManageReq.getSchoolId()); - openQueryWrapper.eq("project_id", record.getProjectId()); - SchoolProjectHintOpen schoolProjectHintOpen = schoolProjectHintOpenMapper.selectOne(openQueryWrapper); - if (ObjectUtil.isNotNull(schoolProjectHintOpen)) { - record.setHintOpenBySchool(schoolProjectHintOpen.getHintOpen()); - } else { - record.setHintOpenBySchool(0); - } - } - return R.ok().put("data", iPage); - } - case 1: - //1:老师 - if (projectManageReq.getPlatformId() == PlatformConstant.POST_STATION) { - //依据角色查询本校内的项目 - String roleName = userClient.getUserAllRole(projectManageReq.getAccountId() + "", 1); - projectManageReq.setIsAdmin(0); - //依据角色查询本校内的项目(超管、管理员角色能看到本校内发布的全部项目、其它角色只能看到自己发布的以及超管、管理员、系统内置发布的项目) - if (roleName.contains("超级管理员") || roleName.contains("管理员")) { - projectManageReq.setIsAdmin(1); - } else { - List accountIdList = userClient.getAccountIdsBySchoolId(projectManageReq.getSchoolId(), PlatformConstant.POST_STATION); - //为满足非超管、管理员的角色情况下能看到本人及超管、管理员角色发布的项目 由此将当前用户的账号id赋值进去List - accountIdList.add(projectManageReq.getAccountId()); - projectManageReq.setAccountIdList(accountIdList); - } - iPage = baseMapper.queryProjectManageByTeacher(page, projectManageReq); - for (ProjectManage record : iPage.getRecords()) { - if (record.getFounder() == 0) { - QueryWrapper openQueryWrapper = new QueryWrapper<>(); - openQueryWrapper.eq("school_id", projectManageReq.getSchoolId()); - openQueryWrapper.eq("project_id", record.getProjectId()); - SchoolProjectHintOpen schoolProjectHintOpen = schoolProjectHintOpenMapper.selectOne(openQueryWrapper); - if (ObjectUtil.isNotNull(schoolProjectHintOpen)) { - record.setHintOpenBySchool(schoolProjectHintOpen.getHintOpen()); - } else { - record.setHintOpenBySchool(0); - } - } - } - return R.ok().put("data", iPage); - } - case 2: {//全部 - //查询购买的课程下的项目以及根据角色查询本校内的项目 - String cid = nakadaiClient.getSchoolCourse(projectManageReq.getSchoolId()); -// projectManageReq.setCid(cid); - projectManageReq.setCid(projectManageReq.getCid()); - //依据角色查询本校内的项目(超管管理员角色能看到本校内发布的全部项目、其它角色只能看到自己发布的以及超管管理员发布的项目) - String roleName = userClient.getUserAllRole(projectManageReq.getAccountId() + "", 1); - projectManageReq.setIsAdmin(0); - - if (roleName.contains("超级管理员") || roleName.contains("管理员")) { - projectManageReq.setIsAdmin(1); - } else { - List accountIdList = userClient.getAccountIdsBySchoolId(projectManageReq.getSchoolId(), PlatformConstant.POST_STATION); - //为满足非超管、管理员的角色情况下能看到本人及超管、管理员角色发布的项目 由此将当前用户的账号id赋值进去List - accountIdList.add(projectManageReq.getAccountId()); - projectManageReq.setAccountIdList(accountIdList); - } - iPage = baseMapper.queryOccupationlabProjectList(page, projectManageReq); - for (ProjectManage record : iPage.getRecords()) { - if (record.getFounder() == 0) { - QueryWrapper openQueryWrapper = new QueryWrapper<>(); - openQueryWrapper.eq("school_id", projectManageReq.getSchoolId()); - openQueryWrapper.eq("project_id", record.getProjectId()); - SchoolProjectHintOpen schoolProjectHintOpen = schoolProjectHintOpenMapper.selectOne(openQueryWrapper); - if (ObjectUtil.isNotNull(schoolProjectHintOpen)) { - record.setHintOpenBySchool(schoolProjectHintOpen.getHintOpen()); - } else { - record.setHintOpenBySchool(0); - } - } - } - return R.ok().put("data", iPage); - } - - } - - return R.ok(); - } - - @Override - public R getSchoolProjectByAssessent(PageAssessmentForProjectReq req) { - Page page = new Page(req.getPageNum(), req.getPageSize()); - IPage iPage = null; - - ProjectManageReq projectManageReq = new ProjectManageReq(); - projectManageReq.setSystemId(req.getSystemId()); - BeanUtils.copyProperties(req, projectManageReq); - projectManageReq.setPermissions(req.getPermissions()); - //依据角色查询本校内的项目(超管管理员角色能看到本校内发布的全部项目、其它角色只能看到自己发布的以及超管管理员发布的项目) - String roleName = userClient.getUserAllRole(projectManageReq.getAccountId() + "", 1); - projectManageReq.setIsAdmin(0); - if (roleName.contains("超级管理员") || roleName.contains("管理员")) { - projectManageReq.setIsAdmin(1); - } else { - List accountIdList = userClient.getAccountIdsBySchoolId(projectManageReq.getSchoolId(), PlatformConstant.POST_STATION); - //为满足非超管、管理员的角色情况下能看到本人及超管、管理员角色发布的项目 由此将当前用户的账号id赋值进去List - accountIdList.add(projectManageReq.getAccountId()); - projectManageReq.setAccountIdList(accountIdList); - } - iPage = baseMapper.queryOccupationlabProjectList(page, projectManageReq); - - return R.ok().put("data", iPage); - } - - @Override - public R getProjectAssessmentByCompetition(PageAssessmentForProjectReq req) { - Page page = new Page(req.getPageNum(), req.getPageSize()); - IPage iPage = null; - - ProjectManageReq projectManageReq = new ProjectManageReq(); - projectManageReq.setSystemId(req.getSystemId()); - BeanUtils.copyProperties(req, projectManageReq); - projectManageReq.setPermissions(2); - iPage = baseMapper.selectProjectAssessmentByCompetition(page, projectManageReq); - - if (req.getSchoolId() != null) { - //教师端创建的竞赛类项目 - List projectManages = projectManageMapper - .selectList(new QueryWrapper() -// .eq("system_id", systemId) - .eq("school_id", req.getSchoolId()) - .eq("permissions", 2) - .eq("zt_del", DelConstant.NOT_DEL) - .eq("is_del", DelConstant.NOT_DEL) - .eq("zt_open", 0) - .eq("is_open", 0).in("system_id", req.getSystemId()) - ); - for (ProjectManage projectManage : projectManages) { - String name = baseMapper.selectSystemName(projectManage.getSystemId()); - projectManage.setSystemName(name); - } - iPage.getRecords().addAll(projectManages); - } - - return R.ok().put("data", iPage); - } - - @Override - public Integer getCurriculumCountByType(Integer cid,Integer permissions) { - return baseMapper.getCurriculumCountByType(cid, permissions); - } - - @Override - public Integer projectCreatedUnderProduct(Integer mallId, Integer permissions, Integer schoolId) { - return baseMapper.projectCreatedUnderProduct(mallId, permissions, schoolId); - } - - @Override - public JudgmentPointDataTo getProjectPoints(ProjectDataTo projectDataTo) { - - if (projectManageMapper.selectSystemType(projectDataTo.getSystemId()) == 0) { - //查询编程判分点 - ArrayList judgmentIds = projectJudgmentMapper.selectBcJudgmentIdList(projectDataTo.getSet(), projectDataTo.getName()); - JudgmentPointDataTo judgmentPointDataTo = new JudgmentPointDataTo(); - judgmentPointDataTo.setJudgmentIds(judgmentIds); - return judgmentPointDataTo; - } else { - //查询流程判分点 - ArrayList judgmentIds = projectJudgmentMapper.selectLcJudgmentIdList(projectDataTo.getSet(), projectDataTo.getName()); - JudgmentPointDataTo judgmentPointDataTo = new JudgmentPointDataTo(); - judgmentPointDataTo.setJudgmentIds(judgmentIds); - return judgmentPointDataTo; - } - } - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ProvinceServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ProvinceServiceImpl.java deleted file mode 100644 index d7511e0..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ProvinceServiceImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.huoran.occupationlab.entity.Province; -import com.huoran.occupationlab.mapper.ProvinceMapper; -import com.huoran.occupationlab.service.ProvinceService; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - *

- * 省份表 服务实现类 - *

- * - * @author Ning - * @since 2020-10-27 - */ -@Service -public class ProvinceServiceImpl extends ServiceImpl implements ProvinceService { - - @Override - public List queryProvince() { - QueryWrapper chapterWrapper = new QueryWrapper<>(); - chapterWrapper.select("*"); - return baseMapper.selectList(chapterWrapper); - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/PythonFileDataServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/PythonFileDataServiceImpl.java deleted file mode 100644 index 697c342..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/PythonFileDataServiceImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.ProjectManage; -import com.huoran.occupationlab.entity.PythonFileData; -import com.huoran.occupationlab.mapper.PythonFileDataMapper; -import com.huoran.occupationlab.service.PythonFileDataService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - *

- * 服务实现类 - *

- * - * @author lr - * @since 2022-04-06 - */ -@Service -public class PythonFileDataServiceImpl extends ServiceImpl implements PythonFileDataService { - - @Override - public R myData(PythonFileData fileData) { - Page page = new Page(fileData.getPageNum(), fileData.getPageSize()); - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("account_id", fileData.getAccountId()); - queryWrapper.eq("school_id", fileData.getSchoolId()); - if (!fileData.getFileName().equals("")) { - queryWrapper.like("file_name", fileData.getFileName()); - } - queryWrapper.orderByDesc("id"); - IPage list = baseMapper.selectPage(page, queryWrapper); - return R.ok().put("data", list); - } - - @Override - public Double statistics(Integer accountId, Integer schoolId) { - return baseMapper.statistics(accountId, schoolId); - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/PythonRunCodeServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/PythonRunCodeServiceImpl.java deleted file mode 100644 index 26b4f91..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/PythonRunCodeServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.huoran.occupationlab.entity.PythonRunCode; -import com.huoran.occupationlab.mapper.PythonRunCodeMapper; -import com.huoran.occupationlab.service.PythonRunCodeService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -/** - *

- * python储存实验运行记录 服务实现类 - *

- * - * @author lr - * @since 2021-12-22 - */ -@Service -public class PythonRunCodeServiceImpl extends ServiceImpl implements PythonRunCodeService { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/PythonSystemServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/PythonSystemServiceImpl.java deleted file mode 100644 index 937adc3..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/PythonSystemServiceImpl.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.huoran.occupationlab.entity.PythonSystem; -import com.huoran.occupationlab.entity.vo.AssessmentVO; -import com.huoran.occupationlab.mapper.PythonSystemMapper; -import com.huoran.occupationlab.service.PythonSystemService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - *

- * python系统记录表 服务实现类 - *

- * - * @author lr - * @since 2021-08-19 - */ -@Service -public class PythonSystemServiceImpl extends ServiceImpl implements PythonSystemService { - - @Autowired - private PythonSystemMapper pythonSystemMapper; - - @Override - public List getCourseTitle(Integer accountId,Integer schoolId) { - return pythonSystemMapper.getCourseTitle(accountId,schoolId); - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/PythonTableDataServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/PythonTableDataServiceImpl.java deleted file mode 100644 index 627c9b7..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/PythonTableDataServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.huoran.occupationlab.entity.PythonTableData; -import com.huoran.occupationlab.mapper.PythonTableDataMapper; -import com.huoran.occupationlab.service.PythonTableDataService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -/** - *

- * 储存全部python表数据表导出Excel路径 服务实现类 - *

- * - * @author lr - * @since 2022-08-12 - */ -@Service -public class PythonTableDataServiceImpl extends ServiceImpl implements PythonTableDataService { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/QuestionsServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/QuestionsServiceImpl.java deleted file mode 100644 index ed3cbf0..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/QuestionsServiceImpl.java +++ /dev/null @@ -1,672 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import cn.hutool.core.date.DateUtil; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.TypeReference; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.huoran.common.constant.DelConstant; -import com.huoran.common.exception.CustomException; -import com.huoran.common.exception.ExceptionEnum; -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.EvaluationRules; -import com.huoran.occupationlab.entity.Questions; -import com.huoran.occupationlab.entity.req.ExcelImpQuestionReq; -import com.huoran.occupationlab.entity.req.QuestionsAddReq; -import com.huoran.occupationlab.entity.req.QuestionsQueryReq; -import com.huoran.occupationlab.entity.req.QuestionsUpdateReq; -import com.huoran.occupationlab.entity.vo.*; -import com.huoran.occupationlab.mapper.QuestionsMapper; -import com.huoran.occupationlab.service.EvaluationRulesService; -import com.huoran.occupationlab.service.QuestionsService; -import com.huoran.occupationlab.utils.Constant; -import com.huoran.occupationlab.utils.ExcelImportHelper; -import com.huoran.occupationlab.utils.poi.CommonCode; -import com.huoran.occupationlab.utils.poi.ExcelExportUtil; -import com.huoran.occupationlab.utils.poi.ExceptionCast; -import org.apache.commons.lang.StringUtils; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.core.io.ClassPathResource; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.data.redis.core.ValueOperations; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.InputStream; -import java.util.*; -import java.util.concurrent.TimeUnit; -import java.util.stream.Collectors; - -/** - *

- * 测评管理-题库记录表 服务实现类 - *

- * - * @author lr - * @since 2021-08-12 - */ -@Service -public class QuestionsServiceImpl extends ServiceImpl implements QuestionsService { - - @Autowired - private QuestionsMapper mapper; - - @Resource - StringRedisTemplate stringRedisTemplate; - - @Autowired - private EvaluationRulesService evaluationRulesService; - - private String REMAINING_TINE_KEY = "REMAINING_TINE"; - private String FAILURE_IMPORT_KEY = "FAILURE_IMPORT"; - - private String getQuestionTypeName(String questionType) { - String questionTypeName = ""; - //处理试题类型 - if (questionType.equals(Constant.QuestionType.SINGLE_CHOICE.getType())) { - //单选题 - questionTypeName = Constant.QuestionType.SINGLE_CHOICE.getDesc(); - } else if (questionType.equals(Constant.QuestionType.MULTIPLE_CHOICE.getType())) { - //多选题 - questionTypeName = Constant.QuestionType.MULTIPLE_CHOICE.getDesc(); - } else if (questionType.equals(Constant.QuestionType.TRUE_OR_FALSE.getType())) { - //判断题 - questionTypeName = Constant.QuestionType.TRUE_OR_FALSE.getDesc(); - } else { - ExceptionCast.cast(CommonCode.QUESTION_TYPE_INVALID); - } - return questionTypeName; - } - - /** - * 判断题型是够存在 - * - * @param type - */ - private void checkType(String type) { - boolean include = false; - for (Constant.QuestionType value : Constant.QuestionType.values()) { - if (value.getType().equals(type)) { - include = true; - } - } - if (!include) {//题型不在枚举类中,不正确 - ExceptionCast.cast(CommonCode.QUESTION_TYPE_INVALID); - } - } - - /** - * 构造根据内容查询试题数量的Wrapper - * - * @param questions - * @return - */ - private QueryWrapper constructDistinctWrapper(Questions questions) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("is_del", Constant.IsDel.NOT_DEL.getType()) - .eq("question_stem", questions.getQuestionStem()) - .eq("school_id", questions.getSchoolId()) - ; - if (StringUtils.isNotEmpty(questions.getOptionA())) { - queryWrapper.eq("option_a", questions.getOptionA()); - } - if (StringUtils.isNotEmpty(questions.getOptionB())) { - queryWrapper.eq("option_b", questions.getOptionB()); - } - if (StringUtils.isNotEmpty(questions.getOptionC())) { - queryWrapper.eq("option_c", questions.getOptionC()); - } - if (StringUtils.isNotEmpty(questions.getOptionD())) { - queryWrapper.eq("option_d", questions.getOptionD()); - } - if (StringUtils.isNotEmpty(questions.getOptionE())) { - queryWrapper.eq("option_e", questions.getOptionE()); - } - if (StringUtils.isNotEmpty(questions.getOptionF())) { - queryWrapper.eq("option_f", questions.getOptionF()); - } - return queryWrapper; - } - - @Override - public IPage getQuestionsList(QuestionsQueryReq request) { - Page page = new Page(request.getPageNum(), request.getPageSize()); - - // 请求包装类 - QueryWrapper queryWrapper = new QueryWrapper(); - - // 只查询未被删除的试题 - queryWrapper.eq("is_del", DelConstant.NOT_DEL); - queryWrapper.eq("school_id", request.getSchoolId()); - - // 判断请求体是否为空 - if (request != null) { - // 题干:判断题干是否为空,不为空则加入搜索条件 - if (request.getQuestionStem() != null) { - queryWrapper.like("question_stem", request.getQuestionStem()); - } - // 题型:判断题型是否为空,不为空则加入搜索条件 - if (request.getQuestionType() != null) { - queryWrapper.eq("question_type", request.getQuestionType()); - } - //扩展其他搜索条件... - queryWrapper.orderByDesc("id"); - } - IPage records = mapper.selectPage(page, queryWrapper); - - return records; - - } - - /** - * 保存题库 - * - * @param questions - * @return - */ - @Override - @Transactional - public boolean saveQuestion(QuestionsAddReq questions) { - //试题对象为空或题干内容为空,抛出参数不合法异常 - if (questions == null - || StringUtils.isEmpty(questions.getQuestionStem()) - || questions.getQuestionType() == null) { - ExceptionCast.cast(CommonCode.INVALID_PARAM); - } - - //校验题型是否正确 - checkType(questions.getQuestionType() + ""); - - // 校验重复,不仅要校验题干,还要校验选项 - Questions questionsEntity = new Questions(); - questionsEntity.setQuestionType(questions.getQuestionType() + ""); - BeanUtils.copyProperties(questions, questionsEntity); - - //构造根据内容查询试题数量的Wrapper - QueryWrapper queryWrapper = constructDistinctWrapper(questionsEntity); - - int count = this.count(queryWrapper); - if (count > 0) {//说明已存在 - //抛出题目已存在异常 - ExceptionCast.cast(CommonCode.QUESTION_EXISTS); - } - // 将传入的对象内容拷贝到QuestionsEntity并返回 - questionsEntity.setCreateTime(new Date()); - questionsEntity.setUpdateTime(new Date()); - - return this.save(questionsEntity); - } - - /** - * 根据试题id修改试题信息 - * - * @param questions - * @return - */ - @Override - @Transactional - public boolean updateQuestionById(QuestionsUpdateReq questions) { - if (questions == null - || questions.getId() == null - || StringUtils.isEmpty(questions.getQuestionStem())) { - ExceptionCast.cast(CommonCode.INVALID_PARAM); - } - - // 判断id是否存在 - if (this.getById(questions.getId()) == null) { - ExceptionCast.cast(CommonCode.INVALID_PARAM); - } - - //校验题型是否正确 - checkType(questions.getQuestionType() + ""); - - //校验题干和内容重复 - Questions questionsEntity = new Questions(); - BeanUtils.copyProperties(questions, questionsEntity); - //构造根据内容查询试题数量的Wrapper - QueryWrapper queryWrapper = constructDistinctWrapper(questionsEntity); - - queryWrapper.notIn("id", questions.getId()); - - int count = this.count(queryWrapper); - if (count > 0) {//说明除了本题之外题干已存在 - //抛出题目已存在异常 - ExceptionCast.cast(CommonCode.QUESTION_EXISTS); - } - - questionsEntity.setUpdateTime(new Date()); - //TODO 设置修改者。。。 - - return this.updateById(questionsEntity); - } - - /** - * 根据主键删除 - * - * @param ids - * @return - */ - @Override - @Transactional - public boolean deleteByIds(List ids) { - List collect = ids.stream().map(item -> { - Questions questionsEntity = new Questions(); - questionsEntity.setId(item); - questionsEntity.setIsDel(Constant.IsDel.DEL.getType()); - return questionsEntity; - }).collect(Collectors.toList()); - - return updateBatchById(collect); - } - - /** - * 是否禁用 - * - * @param id - * @return - */ - @Override - public R isDisable(Integer id, Integer schoolId) { - Questions questionsEntity = new Questions(); - questionsEntity.setId(id); - Questions byId = mapper.selectById(id); - EvaluationRules questions = mapper.queryNumberOfQuestions(schoolId); - if (byId.getIsEnable().equals(Constant.IsEnable.ENABLE.getType())) { -// Integer types = rules.getTypes(); - String types = byId.getQuestionType(); - EvaluationRules rule = mapper.queryNumberOfTatolQuestions(schoolId); - Integer num = mapper.queryQuestionNumber(types, schoolId); - String questionTypes = null; - int rulesNumber = 0; - switch (types) { - case "1": - questionTypes = "单选题的"; - rulesNumber = questions.getSingleNum(); - break; - case "2": - questionTypes = "多选题的"; - rulesNumber = questions.getMultipleNum(); - break; - case "3": - questionTypes = "判断题的"; - rulesNumber = questions.getJudgmentNum(); - break; - } - if (num <= rulesNumber) { - return R.error(400, questionTypes+"试题数量不能少于测评设置对应题的数量!"); - } else { - questionsEntity.setIsEnable(Constant.IsEnable.NOT_ENABLE.getType()); - } - - } else if (byId.getIsEnable().equals(Constant.IsEnable.NOT_ENABLE.getType())) { - questionsEntity.setIsEnable(Constant.IsEnable.ENABLE.getType()); - } else { - ExceptionCast.cast(CommonCode.INVALID_PARAM); - } - - int i = mapper.updateById(questionsEntity); - - if (i == 1) { - return R.ok(); - } else { - return R.error(); - } - } - - @Override - public QuestionsDetailVO getQuestionDetailById(Integer id) { - QuestionsDetailVO questionsDetailVO = new QuestionsDetailVO(); - //查询试题信息 - Questions questionsEntity = this.getById(id); - BeanUtils.copyProperties(questionsEntity, questionsDetailVO); - //处理试题类型 - String questionTypeName = getQuestionTypeName(questionsEntity.getQuestionType()); - questionsDetailVO.setQuestionTypeName(questionTypeName); - - //处理每个选项是否为被设置为答案 - String answer = questionsEntity.getAnswer(); - - if (answer.contains(Constant.A)) { - questionsDetailVO.setAIsTrue(true); - } - if (answer.contains(Constant.B)) { - questionsDetailVO.setBIsTrue(true); - } - if (answer.contains(Constant.C)) { - questionsDetailVO.setCIsTrue(true); - } - if (answer.contains(Constant.D)) { - questionsDetailVO.setDIsTrue(true); - } - if (answer.contains(Constant.E)) { - questionsDetailVO.setEIsTrue(true); - } - if (answer.contains(Constant.F)) { - questionsDetailVO.setFIsTrue(true); - } - return questionsDetailVO; - } - - @Override - public Map upload(MultipartFile file, Integer schoolId, Integer accountId) throws IOException { - List impQuestionReqList = ExcelImportHelper.readQuestionManagement(file); - if (impQuestionReqList.size() <= 0) { - //小于等于0为上传空模板的情况下 抛出异常 - throw new CustomException(ExceptionEnum.EXCEL_FILE_FORMAT_ERROR); - } - int count = 0; - List failVo1 = new ArrayList<>(); - // 参数合法性校验,只能上传.xlsx后缀的文件 - if (org.apache.commons.lang3.StringUtils.isBlank(file.getOriginalFilename()) - || !file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")).equals(".xlsx")) { - ExceptionCast.cast(CommonCode.EXCEL_FILE_INVALID); - } - int size = impQuestionReqList.size(); - Map map = new HashMap<>(); - Long ii = 1L;//用于记录序列号 - Integer countNum = 0;//用于失败原因排序 eg:1、XXXXX 2、XXXXXXX - try { - Integer countSuccess = 0;//统计成功次数 - Integer countError = 0;//统计失败次数 - - for (int i = 0; i < impQuestionReqList.size(); i++) { - boolean ret = true; - ++ii; - ExcelImpQuestionReq req = impQuestionReqList.get(i); - - String errMsg = ""; - //去除Excel中的全角半角空格 - String questionStem = req.getQuestionStem().replaceAll("\\u00A0", "").trim();//题干 - String questionTypeName = req.getQuestionType().replaceAll("\\u00A0", "").trim();//题型 - String optionA = req.getOptionA().replaceAll("\\u00A0", "").trim();//选项A - String optionB = req.getOptionB().replaceAll("\\u00A0", "").trim();//选项B - String optionC = req.getOptionC().replaceAll("\\u00A0", "").trim();//选项C - String optionD = req.getOptionD().replaceAll("\\u00A0", "").trim();//选项D - String optionE = req.getOptionE().replaceAll("\\u00A0", "").trim();//选项E - String optionF = req.getOptionF().replaceAll("\\u00A0", "").trim();//选项F - String answer = req.getAnswer().replaceAll("\\u00A0", "").trim();//正确答案 - String answerAnalysis = req.getAnswerAnalysis().replaceAll("\\u00A0", "").trim();//答案解析 - - QuestionImportFailureVo vo1 = new QuestionImportFailureVo(); - vo1.setIndex(ii); - //检验题干 - if (req.getQuestionStem().equals("")) { - ++countNum; - vo1.setQuestionStem(questionStem + " *必填项:(题干不能为空) "); - errMsg += countNum + "必填项:(题干不能为空)"; - ret = false; - } else { - vo1.setQuestionStem(questionStem); - //ret = true; - } - - if (questionTypeName.equals("")) { - ++countNum; - vo1.setQuestionTypeName(questionTypeName + " *必填项:(题型不能为空)"); - errMsg += countNum + " *必填项:(题型不能为空)"; - ret = false; - } else { - Integer typeName = 0;//题型:1、单选题,2、多选题,3、判断题 - switch (questionTypeName.trim()) { - case "单选题": - typeName = 1; - break; - case "多选题": - typeName = 2; - break; - case "判断题": - typeName = 3; - break; - default: - ++countNum; - vo1.setQuestionTypeName(questionTypeName + " *必填项:(请输入正确的题型)"); - errMsg += countNum + " *必填项:(请输入正确的题型)"; - ret = false; - - } - req.setQuestionType(typeName + ""); - vo1.setQuestionTypeName(typeName + ""); - //ret = true; - } - - if (optionA.equals("")) { - ++countNum; - vo1.setOptionA(optionA + " *必填项:(选项A不能为空)"); - errMsg += countNum + " *必填项:(选项A不能为空)"; - ret = false; - } else { - vo1.setOptionA(optionA); - } - - if (optionB.equals("")) { - ++countNum; - vo1.setOptionB(optionB + " *必填项:(选项B不能为空)"); - errMsg += countNum + " *必填项:(选项B不能为空)"; - ret = false; - } else { - vo1.setOptionB(optionB); - } - - if (answer.equals("")) { - ++countNum; - vo1.setAnswer(answer + " *必填项:(正确答案不能为空)"); - errMsg += countNum + " *必填项:(正确答案不能为空)"; - ret = false; - } else { - vo1.setAnswer(answer); - } - - vo1.setOptionC(optionC); - vo1.setOptionD(optionD); - vo1.setOptionE(optionE); - vo1.setOptionF(optionF); - vo1.setAnswerAnalysis(answerAnalysis); - - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("is_del", DelConstant.NOT_DEL); - queryWrapper.eq("question_stem", questionStem); - List checkQuestionStem = mapper.selectList(queryWrapper); - if (checkQuestionStem.size() > 0) { - ++countNum; - vo1.setQuestionStem(questionStem + " (*错误原因:题库中已存在重复的题干!)"); - errMsg += countNum + " *题库中已存在重复的题干"; - ret = false; - } else { - vo1.setAnswerAnalysis(answerAnalysis); - } - - vo1.setFailureMsg(errMsg); - countNum = 0; - - failVo1.add(vo1); - - Questions questions = new Questions(); - //questions.setQuestionType(Integer.valueOf(req.getQuestionTypeName())); - BeanUtils.copyProperties(req, questions); - - //ret判断 新增成功的插入到数据库 否则则不新增至数据库 - if (ret) { - //执行新增操作 - questions.setAccountId(accountId); - questions.setSchoolId(schoolId); - baseMapper.insert(questions); - //countSuccess:统计累计成功次数 - countSuccess++; - } else { - //countError:累计失败次数 - countError++; - } - } - String exportCode = ""; - - // 有导入失败的数据,才会存入redis - if (countError > 0) { - //生成token - exportCode = "FAILURE_IMPORT" + UUID.randomUUID().toString().replace("-", ""); - ValueOperations ops = stringRedisTemplate.opsForValue(); - String failureVOJson = JSON.toJSONString(failVo1); - ops.set(exportCode, failureVOJson, 30 * 60, TimeUnit.SECONDS); - } - map.put("exportCode", exportCode);//返回导出code - map.put("successNum", countSuccess + "");//本次新增成功数量 - map.put("failureNum", countError + "");//本次新增失败数量 - return map; - } catch (RuntimeException e) { - throw new RuntimeException(); - } - - } - - @Override - public void exportFailureRecord(HttpServletResponse response, String token) throws Exception { - if (org.apache.commons.lang3.StringUtils.isEmpty(token)) { - return; - } - ValueOperations ops = stringRedisTemplate.opsForValue(); - //获取数据 - String record = ops.get(token); - if (org.apache.commons.lang3.StringUtils.isEmpty(record)) { - return; - } - List parse = JSON.parseObject(record, new TypeReference>() { - }); - - parse.sort(Comparator.comparing(QuestionsImportFailureVO::getIndex)); - - ClassPathResource classPathResource = new ClassPathResource("excel-template/试题导入失败数据导出模板.xlsx"); - InputStream inputStream = classPathResource.getInputStream(); - - //3、通过工具类下载文件 - new ExcelExportUtil(QuestionsImportFailureVO.class, Constant.ROW_INDEX, Constant.STYLE_INDEX). - export(response, inputStream, parse, "导入失败数据表.xlsx"); - - if (inputStream != null) { - inputStream.close(); - } - } - - @Override - public String getEvaluationRemainingTime(Integer accountId, Integer schoolId) { - //时长转成秒来计算 - //先查询该用户有没有开始考试,既redis中有没有跟该用户id相关联的key - //如果没有,表示是开始测评,向redis中插入一条数据,key是前缀加用户id,value是当前时间,过期时间是测评时长加三十秒 - //如果有,则得到value,既开始测评的时间,用当前时间和开始测评时间做差,测评时长减去该差值 - //TODO 提交测评时删除redis中的该条数据 - //得到总时长,单位:分 - EvaluationRulesVO evaluationRules = evaluationRulesService.getEvaluationRules(schoolId); - Integer duration = evaluationRules.getDuration(); - ValueOperations ops = stringRedisTemplate.opsForValue(); - String key = REMAINING_TINE_KEY + accountId; - String startTime = ops.get(key); - // 剩余时间,单位:秒 - int remainingTime = duration * 60; - if (StringUtils.isEmpty(startTime)) { - //如果没有,表示是开始测评,向redis中插入一条数据,key是前缀加用户id,value是当前时间,过期时间是测评时长加十秒 - ops.set(key, String.valueOf(System.currentTimeMillis()), duration * 60 + 10, TimeUnit.SECONDS); - } else { - // 当前时间与开始时间得时间差,单位:毫秒 - long difference = System.currentTimeMillis() - Long.parseLong(startTime); - remainingTime = (duration * 60) - (new Long(difference).intValue() / 1000); - if (remainingTime < 0) { - ExceptionCast.cast(CommonCode.EVALUATION_TIME_INVALID); - } - } - return DateUtil.secondToTime(remainingTime); - } - - private Set getRandomList(int len, List list) { - Set set = new HashSet<>(); - Random random = new Random(); - int i; - while (true) { - i = random.nextInt(list.size()); - set.add(list.get(i)); - if (set.size() >= len) { - break; - } - } - return set; - } - - @Override - public EvaluationVO randomQuestions(Integer schoolId) { - // 查询测评规则类型 - EvaluationRulesVO evaluationRules = evaluationRulesService.getEvaluationRules(schoolId); - EvaluationVO evaluation = new EvaluationVO(); - BeanUtils.copyProperties(evaluationRules, evaluation); - Set set = new HashSet<>(); - //根据测评规则的类型不同(测评类型:1:随机类型,0:自定义类型) - Integer evaluationType = evaluationRules.getEvaluationType(); - if (evaluationType.equals(Constant.RulesType.RANDOM.getType())) {//随机 - // 类型为随机,直接用题目数量 - Integer questionNum = evaluationRules.getQuestionNum(); - if (questionNum == null || questionNum == 0) { - ExceptionCast.cast(CommonCode.EVALUATION_QUESTION_NUM_INVALID); - } - // 查询题库所有未删除,未禁用的题目id - List ids = baseMapper.selectIds(null,schoolId); - set = getRandomList(questionNum, ids); - } else if (evaluationType.equals(Constant.RulesType.CUSTOMIZE.getType())) {//自定义 - // 单选题数量 - int singleNum = 0; - // 多选题数量 - int multipleNum = 0; - // 判断题数量 - int judgmentNum = 0; - //判断各条目的题型是否启用 - if (evaluationRules.getIsSingleEnable().equals(Constant.IsEnable.ENABLE.getType())) { - singleNum = evaluationRules.getSingleNum(); - if (singleNum == 0) { - ExceptionCast.cast(CommonCode.EVALUATION_QUESTION_NUM_INVALID); - } - List ids = baseMapper.selectIds(Constant.QuestionType.SINGLE_CHOICE.getType(),schoolId); - set.addAll(getRandomList(singleNum, ids)); - } - if (evaluationRules.getIsMultipleEnable().equals(Constant.IsEnable.ENABLE.getType())) { - multipleNum = evaluationRules.getMultipleNum(); - if (multipleNum == 0) { - ExceptionCast.cast(CommonCode.EVALUATION_QUESTION_NUM_INVALID); - } - List ids = baseMapper.selectIds(Constant.QuestionType.MULTIPLE_CHOICE.getType(),schoolId); - set.addAll(getRandomList(multipleNum, ids)); - } - if (evaluationRules.getIsJudgmentEnable().equals(Constant.IsEnable.ENABLE.getType())) { - judgmentNum = evaluationRules.getJudgmentNum(); - if (judgmentNum == 0) { - ExceptionCast.cast(CommonCode.EVALUATION_QUESTION_NUM_INVALID); - } - List ids = baseMapper.selectIds(Constant.QuestionType.TRUE_OR_FALSE.getType(),schoolId); - set.addAll(getRandomList(judgmentNum, ids)); - } - // 总题数等于各类题目数量之和 - evaluation.setQuestionNum(singleNum + multipleNum + judgmentNum); - } - evaluation.setQuestions(set); - - return evaluation; - } - - @Override - public boolean copyQuestion(Integer schoolId, Integer accountId) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("school_id", 0);//0查询内置题库 - queryWrapper.eq("is_del", DelConstant.NOT_DEL); - List list = baseMapper.selectList(queryWrapper); - //复制题库 - list.stream().forEach(questions -> { - questions.setSchoolId(schoolId); - questions.setAccountId(accountId); - baseMapper.insert(questions); - }); - - return true; - } - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/RabbitServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/RabbitServiceImpl.java deleted file mode 100644 index 4a088dc..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/RabbitServiceImpl.java +++ /dev/null @@ -1,26 +0,0 @@ -/* -package com.huoran.occupationlab.service.impl; - -import com.huoran.common.constant.RabbitmqConstant; -import com.huoran.common.response.R; -import com.huoran.occupationlab.service.RabbitService; -import com.rabbitmq.client.Channel; -import org.springframework.amqp.core.Message; -import org.springframework.amqp.rabbit.annotation.RabbitListener; -import org.springframework.stereotype.Service; - -@Service -public class RabbitServiceImpl implements RabbitService { - - @RabbitListener(queues = RabbitmqConstant.COURSE_QUEUE) - public void receiveMessages(Message message, String messages, Channel channel) { - System.out.println(messages); - } - - @Override - public R receiveMessage() { -// String s = this.receiveMessages(null, null, null); - return R.ok(); - } -} -*/ diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/RolePermissionServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/RolePermissionServiceImpl.java deleted file mode 100644 index 049b559..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/RolePermissionServiceImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.huoran.occupationlab.service.impl; - - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.huoran.occupationlab.entity.AclRolePermission; -import com.huoran.occupationlab.mapper.RolePermissionMapper; -import com.huoran.occupationlab.service.RolePermissionService; -import org.springframework.stereotype.Service; - -/** - *

- * 角色权限 服务实现类 - *

- * - * @author testjava - * @since 2020-01-12 - */ -@Service -public class RolePermissionServiceImpl extends ServiceImpl implements RolePermissionService { - @Override - public void removeMenu(String roleId, Integer isPort) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("role_id", roleId).eq("is_port", isPort); - baseMapper.delete(wrapper); - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/RoleServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/RoleServiceImpl.java deleted file mode 100644 index 87de6ad..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/RoleServiceImpl.java +++ /dev/null @@ -1,109 +0,0 @@ -package com.huoran.occupationlab.service.impl; - - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.huoran.occupationlab.entity.AclRole; -import com.huoran.occupationlab.entity.AclUserRole; -import com.huoran.occupationlab.mapper.RoleMapper; -import com.huoran.occupationlab.service.RoleService; -import com.huoran.occupationlab.service.UserRoleService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.util.StringUtils; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** - *

- * 服务实现类 - *

- */ -@Service -public class RoleServiceImpl extends ServiceImpl implements RoleService { - - @Autowired - private UserRoleService userRoleService; - - - //根据用户获取角色数据 - @Override - public Map findRoleByUserId(String userId) { - //查询所有的角色 - List allRolesList = baseMapper.selectList(null); - - //根据用户id,查询用户拥有的角色id - List existUserRoleList = userRoleService.list(new QueryWrapper().eq("user_id", userId).select("role_id")); - - List existRoleList = existUserRoleList.stream().map(c -> c.getRoleId()).collect(Collectors.toList()); - - //对角色进行分类 - List assignRoles = new ArrayList(); - for (AclRole role : allRolesList) { - //已分配 - if (existRoleList.contains(role.getId())) { - assignRoles.add(role); - } - } - - Map roleMap = new HashMap<>(); - roleMap.put("assignRoles", assignRoles); - roleMap.put("allRolesList", allRolesList); - return roleMap; - } - - //根据用户分配角色 - @Override - public void saveUserRoleRelationShip(String userId, String[] roleIds) { - userRoleService.remove(new QueryWrapper().eq("user_id", userId)); - - List userRoleList = new ArrayList<>(); - for (String roleId : roleIds) { - if (StringUtils.isEmpty(roleId)) continue; - AclUserRole userRole = new AclUserRole(); - userRole.setUserId(userId); - userRole.setRoleId(roleId); - - userRoleList.add(userRole); - } - userRoleService.saveBatch(userRoleList); - } - - @Override - public List selectRoleByUserId(String id) { - //根据用户id拥有的角色id - List userRoleList = userRoleService.list(new QueryWrapper().eq("user_id", id).select("role_id")); - List roleIdList = userRoleList.stream().map(item -> item.getRoleId()).collect(Collectors.toList()); - List roleList = new ArrayList<>(); - if (roleIdList.size() > 0) { - roleList = baseMapper.selectBatchIds(roleIdList); - } - return roleList; - } - - @Override - public boolean repeat(AclRole role) { - QueryWrapper roleQueryWrapper = new QueryWrapper<>(); - roleQueryWrapper.eq("role_name", role.getRoleName()); - Integer count = baseMapper.selectCount(roleQueryWrapper); - return count > 0; - } - - @Override - public boolean removeRolePermission(String roleId) { - int size = baseMapper.removeRolePermission(roleId); - return size > 0; - } - - @Override - public boolean removeRolePermissions(List roleIds) { - for (String roleId : roleIds) { - baseMapper.removeRolePermission(roleId); - } - return true; - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/SchoolClassificationServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/SchoolClassificationServiceImpl.java deleted file mode 100644 index c5c1ede..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/SchoolClassificationServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.huoran.occupationlab.entity.SchoolClassification; -import com.huoran.occupationlab.mapper.SchoolClassificationMapper; -import com.huoran.occupationlab.service.SchoolClassificationService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -/** - *

- * 学校对应分类表 服务实现类 - *

- * - * @author lr - * @since 2021-09-09 - */ -@Service -public class SchoolClassificationServiceImpl extends ServiceImpl implements SchoolClassificationService { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/SchoolCourseServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/SchoolCourseServiceImpl.java deleted file mode 100644 index bf04cd5..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/SchoolCourseServiceImpl.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.huoran.occupationlab.service.impl; - - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.huoran.occupationlab.entity.SchoolClassification; -import com.huoran.occupationlab.entity.SchoolCourse; -import com.huoran.occupationlab.entity.vo.CourseVO; -import com.huoran.occupationlab.mapper.SchoolClassificationMapper; -import com.huoran.occupationlab.mapper.SchoolCourseMapper; -import com.huoran.occupationlab.service.SchoolClassificationService; -import com.huoran.occupationlab.service.SchoolCourseService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.Arrays; -import java.util.Date; -import java.util.HashMap; -import java.util.List; - -/** - *

- * 学校内置课程表 服务实现类 - *

- * - * @author Cheney - * @since 2020-11-30 - */ -@Service -public class SchoolCourseServiceImpl extends ServiceImpl implements SchoolCourseService { - - @Autowired - private SchoolClassificationMapper schoolClassificationMapper; - - @Override - public List coursePageConditionQuery(HashMap map) { - return baseMapper.selectCoursePageByCondition(map); - } - - @Override - public int coursePageConditionCount(HashMap map) { - return baseMapper.coursePageConditionCount(map); - } - - @Override - public List builtInCoursePageQuery(HashMap map) { - return baseMapper.builtInCoursePageQuery(map); - } - - @Override - public int builtInCoursePageCount(HashMap map) { - return baseMapper.builtInCoursePageCount(map); - } - - @Override - public boolean addBuiltInCourse(String schoolId, String courseIds, String classificationIds) { - String[] courseId = courseIds.split(","); - List courseIdList = Arrays.asList(courseId); - - String[] classificationId = classificationIds.split(","); - List classificationIdList = Arrays.asList(classificationId); - - - //先添加分类给对应学校 - if (classificationIdList.size() != 0) { - classificationIdList.forEach(id -> { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("school_id", schoolId).eq("classification_id", id); - Integer count = schoolClassificationMapper.selectCount(wrapper); - //学校没有该分类,则进行添加对应关系 - if (count == 0) { - SchoolClassification schoolClassification = new SchoolClassification(); - schoolClassification.setClassificationId(id); - schoolClassification.setSchoolId(schoolId); - schoolClassificationMapper.insert(schoolClassification); - } - }); - } - - //循环添加课程 - if (courseIdList.size() != 0) { - courseIdList.forEach(id -> { - SchoolCourse schoolCourse = new SchoolCourse(); - - schoolCourse.setGmtCreate(new Date()); - schoolCourse.setGmtModified(new Date()); - schoolCourse.setCourseId(id); - schoolCourse.setSchoolId(schoolId); - baseMapper.insert(schoolCourse); - }); - return true; - } - return false; - } - - @Override - public void removeClassificationId(String schoolId, String classificationId) { - int count = baseMapper.builtInCourseClassificationCount(schoolId, classificationId); - if (count == 1) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("school_id", schoolId).eq("classification_id", classificationId); - schoolClassificationMapper.delete(wrapper); - } - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/SchoolProjectHintOpenServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/SchoolProjectHintOpenServiceImpl.java deleted file mode 100644 index 14bde7c..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/SchoolProjectHintOpenServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.huoran.occupationlab.entity.SchoolProjectHintOpen; -import com.huoran.occupationlab.mapper.SchoolProjectHintOpenMapper; -import com.huoran.occupationlab.service.SchoolProjectHintOpenService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -/** - *

- * 学校项目实验提示管理表 服务实现类 - *

- * - * @author lr - * @since 2023-06-02 - */ -@Service -public class SchoolProjectHintOpenServiceImpl extends ServiceImpl implements SchoolProjectHintOpenService { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/SchoolServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/SchoolServiceImpl.java deleted file mode 100644 index 9c20d3c..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/SchoolServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.huoran.common.entity.School; -import com.huoran.occupationlab.mapper.SchoolMapper; -import com.huoran.occupationlab.service.SchoolService; -import org.springframework.stereotype.Service; - -/** - *

- * 学校表 服务实现类 - *

- * - * @author Ning - * @since 2020-10-27 - */ -@Service -public class SchoolServiceImpl extends ServiceImpl implements SchoolService { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/StaffGradeServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/StaffGradeServiceImpl.java deleted file mode 100644 index 164cba6..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/StaffGradeServiceImpl.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.common.constant.DelConstant; -import com.huoran.occupationlab.entity.StaffGrade; -import com.huoran.occupationlab.entity.StaffProfessionalArchitecture; -import com.huoran.occupationlab.mapper.StaffGradeMapper; -import com.huoran.occupationlab.service.StaffGradeService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - *

- * 员工年级表 服务实现类 - *

- * - * @author lr - * @since 2021-10-13 - */ -@Service -public class StaffGradeServiceImpl extends ServiceImpl implements StaffGradeService { - - @Override - public boolean repeat(StaffGrade staffGrade) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("grade_name", staffGrade.getGradeName()); - queryWrapper.eq("staff_architecture_id", staffGrade.getStaffArchitectureId()); - Integer count = baseMapper.selectCount(queryWrapper); - return count > 0; - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/StaffProfessionalArchitectureServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/StaffProfessionalArchitectureServiceImpl.java deleted file mode 100644 index b117232..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/StaffProfessionalArchitectureServiceImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.common.constant.DelConstant; -import com.huoran.occupationlab.entity.StaffProfessionalArchitecture; -import com.huoran.occupationlab.mapper.StaffProfessionalArchitectureMapper; -import com.huoran.occupationlab.service.StaffProfessionalArchitectureService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - *

- * 员工专业组织架构 服务实现类 - *

- * - * @author lr - * @since 2021-10-13 - */ -@Service -public class StaffProfessionalArchitectureServiceImpl extends ServiceImpl implements StaffProfessionalArchitectureService { - - @Override - public boolean repeat(StaffProfessionalArchitecture staffProfessionalArchitecture) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("staff_architecture_name", staffProfessionalArchitecture.getStaffArchitectureName()); - queryWrapper.eq("school_id", staffProfessionalArchitecture.getSchoolId()); - queryWrapper.eq("is_del", DelConstant.NOT_DEL); - - Integer count = baseMapper.selectCount(queryWrapper); - return count > 0; - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/StaffServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/StaffServiceImpl.java deleted file mode 100644 index 34b8c19..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/StaffServiceImpl.java +++ /dev/null @@ -1,639 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import cn.afterturn.easypoi.excel.ExcelExportUtil; -import cn.afterturn.easypoi.excel.entity.ExportParams; -import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.TypeReference; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.huoran.api.UserClient; -import com.huoran.common.constant.DelConstant; -import com.huoran.common.constant.PlatformConstant; -import com.huoran.common.entity.Role; -import com.huoran.common.entity.UserAccount; -import com.huoran.common.entity.UserInfo; -import com.huoran.common.exception.CustomException; -import com.huoran.common.exception.ExceptionEnum; -import com.huoran.common.response.R; -import com.huoran.common.utils.MD5; -import com.huoran.occupationlab.entity.*; -import com.huoran.occupationlab.entity.req.*; -import com.huoran.occupationlab.entity.resp.StaffResp; -import com.huoran.occupationlab.entity.vo.ImportStaffFailureVo; -import com.huoran.occupationlab.mapper.StaffGradeMapper; -import com.huoran.occupationlab.mapper.StaffMapper; -import com.huoran.occupationlab.mapper.StaffProfessionalArchitectureMapper; -import com.huoran.occupationlab.mapper.StudentMapper; -import com.huoran.occupationlab.service.StaffService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.huoran.common.utils.DateUtil; -import com.huoran.occupationlab.utils.ExcelImportHelper; -import com.huoran.occupationlab.utils.poi.CommonCode; -import com.huoran.occupationlab.utils.poi.ExcelStyleUtil; -import com.huoran.occupationlab.utils.poi.ExceptionCast; -import org.apache.poi.ss.usermodel.Workbook; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.data.redis.core.ValueOperations; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.net.URLEncoder; -import java.util.*; -import java.util.concurrent.TimeUnit; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.stream.Collectors; - -/** - *

- * 员工表 服务实现类 - *

- * - * @author lr - * @since 2021-10-13 - */ -@Service -public class StaffServiceImpl extends ServiceImpl implements StaffService { - - @Autowired - private UserClient userClient; - - @Autowired - public StudentMapper studentMapper;//引用新增账号 用户表新增操作 - - @Autowired - public StaffProfessionalArchitectureMapper professionalArchitectureMapper; - - @Autowired - public StaffGradeMapper gradeMapper; - - @Resource - StringRedisTemplate stringRedisTemplate; - - @Transactional - @Override - public R saveStaff(AddStaffReq req) throws Exception { - - try { - //用户相关信息表 - UserInfo userInfo = new UserInfo(); - BeanUtils.copyProperties(req, userInfo); - userInfo.setRoleId("0");//设置为0 表示该表角色id暂时无用 acl_user_role:用户角色表有账号所属角色 - int addUserInfo = studentMapper.addUserInfo(userInfo); - - //账户相关信息表 - UserAccount userAccount = new UserAccount(); - BeanUtils.copyProperties(req, userAccount); - userAccount.setPassword(MD5.encrypt("1122aa")); - userAccount.setUserId(userInfo.getUserId()); - userAccount.setType(PlatformConstant.TEACHER_SIDE);//平台端区分:0->教师端 1->学生端 2->无端 - userAccount.setPlatformId(PlatformConstant.POST_STATION + "");//1表示职站 - userAccount.setRoleId("0");//设置为0 表示该表角色id暂时无用 acl_user_role:用户角色表有账号所属角色 - userAccount.setPhone(null); - if (!req.getPhone().equals("")) { - userAccount.setPhoneBindingTime(DateUtil.currentDate()); - userAccount.setPhone(req.getPhone()); - } - - int addAccount = studentMapper.addUserAccount(userAccount); - - List roleIds = new ArrayList<>(); - //员工相关信息表 - int addStaff = 0; - // 此处由创建人选择几个角色则生成几条员工表记录 - for (AddStaffRoleReq staffRoleReq : req.getRoleAndDeptList()) { - Staff staff = new Staff(); - staff.setAccountId(userAccount.getId()); - staff.setRoleId(staffRoleReq.getRoleId());//新增角色 - staff.setStaffArchitectureId(staffRoleReq.getStaffArchitectureId()); - staff.setGradeId(staffRoleReq.getGradeId()); - staff.setSchoolId(req.getSchoolId()); - addStaff = baseMapper.insert(staff); - roleIds.add(staffRoleReq.getRoleId()); - - } - //账号赋予角色 - userClient.rolePermissionService(userAccount.getId(), roleIds,null); - return addUserInfo > 0 && addAccount > 0 && addStaff > 0 ? R.ok() : R.error(); - } catch (Exception e) { - return R.error(e.getMessage()); - } - - } - - @Override - public R pageStaffList(PageStaffListReq req) { - Page page = new Page(req.getPageNum(), req.getPageSize()); - IPage staffList = baseMapper.staffList(page, req); - return R.ok().put("page", staffList); - } - - @Override - public R staffDetail(Integer accountId) { - StaffResp resp = baseMapper.staffDetail(accountId); - resp.setRoleAndDeptList(baseMapper.getStaffInfoByAccountId(accountId)); - return R.ok().put("data", resp); - } - - @Override - public R modifyStaff(ModifyStaffReq req, Integer schoolId) { - - //根据账号id获取userId - Integer userId = studentMapper.getUserId(req.getAccountId()); - - //存角色列表 用于新增至用户角色表 - List roleIds = new ArrayList<>(); - - //编辑员工相关信息表 - if (req.getRoleAndDeptList() != null) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("account_id", req.getAccountId()); - queryWrapper.eq("is_del", DelConstant.NOT_DEL); - List getRoleInfo = baseMapper.selectList(queryWrapper); - - getRoleInfo.stream().forEach(roleInfo -> { - //删除该用户原有角色 - userClient.delRoleByAccountId(roleInfo.getRoleId(), req.getAccountId()); - }); - - //删除现有员工信息 - UpdateWrapper updateWrapper = new UpdateWrapper<>(); - updateWrapper.set("is_del", DelConstant.IS_DEL); - updateWrapper.eq("account_id", req.getAccountId()); - baseMapper.update(new Staff(), updateWrapper); - - //重新新增一级二级部门及角色数据 - for (AddStaffRoleReq modifyStaffReq : req.getRoleAndDeptList()) { - Staff addStaff = new Staff(); - addStaff.setAccountId(req.getAccountId()); - addStaff.setRoleId(modifyStaffReq.getRoleId());//新增角色 - addStaff.setStaffArchitectureId(modifyStaffReq.getStaffArchitectureId()); - addStaff.setGradeId(modifyStaffReq.getGradeId()); - addStaff.setSchoolId(schoolId); - baseMapper.insert(addStaff); - roleIds.add(modifyStaffReq.getRoleId()); - } - //账号赋予角色 - userClient.rolePermissionService(req.getAccountId(), roleIds,null); - } - - //编辑账户相关信息表 - UserAccount userAccount = new UserAccount(); - BeanUtils.copyProperties(req, userAccount); - userAccount.setId(req.getAccountId()); - boolean updateAccount = studentMapper.modifyUserAccount(userAccount); - - //编辑用户相关信息表 - UserInfo userInfo = new UserInfo(); - BeanUtils.copyProperties(req, userInfo); - userInfo.setUserId(userId); - boolean updateUserInfo = studentMapper.modifyUserInfo(userInfo); - return updateUserInfo && updateAccount ? R.ok() : R.error(); - - } - - @Override - public R delStaff(List ids) { - Integer ret = 0; - if (ids.size() > 0) { - for (Integer accountId : ids) { - - //删除账号、用户表数据 修改用户表逻辑删除状态 修改账号表逻辑删除状态 - userClient.delAccountAndUser(accountId); - - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("is_del", DelConstant.NOT_DEL); - queryWrapper.eq("account_id", accountId); - List roleList = baseMapper.selectList(queryWrapper); - roleList.stream().forEach(roleInfo -> { - //删除该用户原有角色 - userClient.delRoleByAccountId(roleInfo.getRoleId(), accountId); - }); - - //删除现有员工信息 - UpdateWrapper updateWrapper = new UpdateWrapper<>(); - updateWrapper.set("is_del", DelConstant.IS_DEL); - updateWrapper.eq("account_id", accountId); - ret = baseMapper.update(new Staff(), updateWrapper); - } - - } - return ret > 0 ? R.ok() : R.error(); - } - - @Transactional - @Override - public Map importStaff(MultipartFile file, Integer schoolId) throws IOException { - List impStaffReqList = ExcelImportHelper.readStaff(file); - if (impStaffReqList.size() <= 0) { - //小于等于0为上传空模板的情况下 抛出异常 - throw new CustomException(ExceptionEnum.EXCEL_FILE_FORMAT_ERROR); - } - int count = 0; - List failVo1 = new ArrayList(); - // 参数合法性校验,只能上传.xlsx后缀的文件 - if (org.apache.commons.lang3.StringUtils.isBlank(file.getOriginalFilename()) - || !file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")).equals(".xlsx")) { - ExceptionCast.cast(CommonCode.EXCEL_FILE_INVALID); - } - int size = impStaffReqList.size(); - Map map = new HashMap<>(); - Long ii = 1L;//用于记录序列号 - Integer countNum = 0;//用于失败原因排序 eg:1、XXXXX 2、XXXXXXX - try { - Integer countSuccess = 0;//统计成功次数 - Integer countError = 0;//统计失败次数 - - List workNumberList = new ArrayList<>();//用来储存新增前用户在excel中输入的所有工号用于excel中的数据判重 - List accountList = new ArrayList<>();//用来储存新增前用户在excel中输入的所有账号用于excel中的数据判重 - for (int i = 0; i < impStaffReqList.size(); i++) { - boolean ret = true; - ++ii; - ExcelImpStaffReq req = impStaffReqList.get(i); - - ImportStaffFailureVo vo1 = new ImportStaffFailureVo(); - - String errMsg = ""; - //去除Excel中的全角半角空格 - String getUserName = req.getUserName().replaceAll("\\u00A0", "").trim(); - // String getAccount = req.getAccount().replaceAll("\\u00A0", "").trim(); - String getRoleName = req.getRoleName().replaceAll("\\u00A0", "").trim(); - String getWorkNumber = req.getWorkNumber().replaceAll("\\u00A0", "").trim(); - String getFirstDept = req.getFirstDept().replaceAll("\\u00A0", "").trim(); - String getSecondDept = req.getSecondDept().replaceAll("\\u00A0", "").trim(); - String getPhone = req.getPhone().replaceAll("\\u00A0", "").trim(); - String getEmail = req.getEmail().replaceAll("\\u00A0", "").trim(); - - if (!workNumberList.contains(req.getWorkNumber())) { - workNumberList.add(req.getWorkNumber()); - } else { - - if (!getWorkNumber.equals("")) { - //包含excel数据中存在相同工号 - ++countNum; - vo1.setWorkNumber(getWorkNumber + " *必填项:(当前Excel数据中该工号已存在重复的!)"); - errMsg += countNum + " *必填项:(当前Excel数据中该工号已存在重复的)"; - ret = false; - } - - } - - /*if (!accountList.contains(req.getAccount())) { - accountList.add(req.getAccount()); - } else { - //包含excel数据中存在相同账号 - ++countNum; - vo1.setAccount(getAccount + " *必填项:(当前Excel数据中该账号已存在重复的)"); - errMsg += countNum + " *必填项:(当前Excel数据中该账号已存在重复的)"; - ret = false; - }*/ - - vo1.setIndex(ii); - //检验姓名 - if (getUserName.equals("")) { - ++countNum; - vo1.setUserName(getUserName + " *必填项:(姓名不能为空) "); - errMsg += countNum + "必填项:(姓名不能为空)"; - ret = false; - } else { - vo1.setUserName(getUserName); - } - - //检验账号 - /* if (getAccount.equals("")) { - ++countNum; - vo1.setAccount(getAccount + " *必填项:(账号不能为空)"); - errMsg += countNum + " *必填项:(账号不能为空)"; - ret = false; - } else { - UserAccount checkAccount = new UserAccount(); - checkAccount.setAccount(getAccount); - List checkUserAccount = studentMapper.checkUserAccount(checkAccount); - - if (checkUserAccount.size() > 0) { - ++countNum; - vo1.setAccount(getAccount + " *必填项:(账号已有重复的)"); - errMsg += countNum + " *必填项:(账号已有重复的)"; - ret = false; - } else { - vo1.setAccount(getAccount + ""); - } - }*/ - - //一级部门id - Integer saffArchitectureId = null; - //二级部门id - Integer gradeId = null; - //角色id - Integer roleId = null; - - //检验角色 - if (getRoleName.equals("")) { - ++countNum; - vo1.setRoleName(getRoleName + " *必填项:(角色不能为空)"); - errMsg += countNum + " *必填项:(角色不能为空)"; - ret = false; - } else if (!getRoleName.equals("")) { - // 不为空 则查询该角色是否存在 - Role checkRole = userClient.checkRoleIsExist(getRoleName, schoolId, 1); - if (checkRole != null && !checkRole.getRoleName().equals("超级管理员")) { - roleId = checkRole.getId(); - //存在 - vo1.setRoleName(getRoleName); - } else { - //不存在 - vo1.setRoleName(getRoleName + " *必填项:(请输入系统中存在的角色)"); - errMsg += countNum + " *必填项:(请输入系统中存在的角色)"; - ret = false; - } - - } - - //检验工号 - if (getWorkNumber.equals("")) { - ++countNum; - vo1.setWorkNumber(getWorkNumber + " *必填项:(工号不能为空)"); - errMsg += countNum + " *必填项:(工号不能为空)"; - ret = false; - } else if (!getWorkNumber.equals("")) { - UserAccount workNum = new UserAccount(); - workNum.setWorkNumber(getWorkNumber); - workNum.setSchoolId(schoolId); - workNum.setType(0); - workNum.setPlatformId("1"); - List checkUserWorkNum = studentMapper.checkUserAccount(workNum); - if (checkUserWorkNum.size() > 0) { - ++countNum; - vo1.setWorkNumber(getWorkNumber + " *必填项:(工号已经存在重复的)"); - errMsg += countNum + " *必填项:(工号已经存在重复的)"; - ret = false; - } else { - vo1.setWorkNumber(getWorkNumber + ""); - } - } - - //检验一二级部门 - if (getFirstDept.equals("") || getSecondDept.equals("")) { - ++countNum; - vo1.setFirstDept(getFirstDept + " *必填项:(请输入正确的员工架构!)"); - vo1.setSecondDept(getSecondDept + " *必填项:(请输入正确的员工架构!)"); - errMsg += countNum + " *必填项:(请输入正确的员工架构!)"; - ret = false; - } else { - // 检验输入的一二级部门是否存在 - //查询一级部门信息 - QueryWrapper queryWrapper1 = new QueryWrapper<>(); - queryWrapper1.eq("school_id", schoolId); - queryWrapper1.eq("is_del", DelConstant.NOT_DEL); - queryWrapper1.eq("staff_architecture_name", getFirstDept); - StaffProfessionalArchitecture architecture = professionalArchitectureMapper.selectOne(queryWrapper1); - if (architecture == null) { - //为空表示不存在该部门 - ++countNum; - vo1.setFirstDept(getFirstDept + " *必填项:(请输入正确的员工架构!)"); - vo1.setSecondDept(getSecondDept + " *必填项:(请输入正确的员工架构!)"); - errMsg += countNum + " *必填项:(请输入正确的员工架构!)"; - ret = false; - } else { - saffArchitectureId = architecture.getStaffArchitectureId(); - //查询二级部门信息 - QueryWrapper queryWrapper2 = new QueryWrapper<>(); - queryWrapper2.eq("staff_architecture_id", architecture.getStaffArchitectureId()); - queryWrapper2.eq("grade_name", getSecondDept); - StaffGrade grade = gradeMapper.selectOne(queryWrapper2); - vo1.setFirstDept(getFirstDept); - if (grade != null) { - gradeId = grade.getGradeId(); - vo1.setSecondDept(getSecondDept); - } else { - ++countNum; - vo1.setSecondDept(getSecondDept + " *必填项:(请输入正确的员工架构!)"); - errMsg += countNum + " *必填项:(请输入正确的员工架构!)"; - ret = false; - } - } - - } - - if (!getPhone.equals("")) { - //校验手机号格式 - if (validPhoneNum("0", getPhone) == false) { - ++countNum; - vo1.setPhone(getPhone + " *请输入正确的手机号!"); - errMsg += countNum + " *请输入正确的手机号!"; - ret = false; - } /*else { - //检验手机号 type 1为手机号 2为校验邮箱 - boolean checkPhone = userClient.checkPhoneOrEmailExist(getPhone, getEmail, 1); - if (checkPhone) { - ++countNum; - vo1.setPhone(getPhone + " *该手机号已被绑定!"); - errMsg += countNum + " *该手机号已被绑定!"; - ret = false; - } - vo1.setPhone(getPhone); - }*/ - - } else { - vo1.setPhone(getPhone); - } - - if (!getEmail.equals("")) { - //校验邮箱格式 - if (isValidEmail(getEmail) == false) { - ++countNum; - vo1.setEmail(getEmail + "*请输入正确的邮箱格式!"); - errMsg += countNum + " *请输入正确的邮箱格式!"; - ret = false; - } /*else { - //检验手机号 type 2为校验邮箱 - boolean checkEmail = userClient.checkPhoneOrEmailExist(getPhone, getEmail, 2); - if (checkEmail) { - ++countNum; - vo1.setEmail(getEmail + " *该邮箱已被绑定!"); - errMsg += countNum + " *该邮箱已被绑定!"; - ret = false; - } - vo1.setEmail(getEmail); - }*/ - - } else { - vo1.setEmail(getEmail); - } - - vo1.setFailureMsg(errMsg); - countNum = 0; - - failVo1.add(vo1); - - //ret判断 新增成功的插入到数据库 否则则不新增至数据库 - if (ret) { - //执行新增操作 - // 工号(本校内)——————账号(全平台)判重 ——————手机号、邮箱根据平台id判重 - UserInfo userInfo = new UserInfo(); - userInfo.setSchoolId(schoolId); - userInfo.setRoleId("0"); - userInfo.setUniqueIdentification(String.valueOf(System.currentTimeMillis())); - BeanUtils.copyProperties(req, userInfo); - studentMapper.addUserInfo(userInfo); - - UserAccount account = new UserAccount(); - account.setSchoolId(schoolId); - account.setPassword(MD5.encrypt("1122aa")); - account.setPlatformId(PlatformConstant.POST_STATION + "");//所属平台id 1.职站 - account.setType(PlatformConstant.TEACHER_SIDE);//平台端区分:0->教师端 1->学生端 2->无端 - account.setUserId(userInfo.getUserId()); - account.setRoleId("0"); - - //22.4.13补充: 账号组成条件:平台(职站/数据平台/中台)-端(教师、学生端、无端(数据平台的用户))-学校(学校id)-学号/工号(用户输入的工号学号) - - account.setAccount(PlatformConstant.POST_STATION + "-" + PlatformConstant - .TEACHER_SIDE + "-" + schoolId + "-" + req.getWorkNumber()); - BeanUtils.copyProperties(req, account); - - - account.setPhone(null); - if (getPhone != null && !getPhone.equals("")) { - account.setPhone(getPhone); - account.setPhoneBindingTime(DateUtil.currentDate()); - } - studentMapper.addUserAccount(account); - - // 新增至员工信息表 - Staff staff = new Staff().setSchoolId(schoolId) - .setStaffArchitectureId(saffArchitectureId) - .setAccountId(account.getId()) - .setRoleId(roleId) - .setGradeId(gradeId); - baseMapper.insert(staff); - - List roleIds = new ArrayList<>(); - roleIds.add(roleId); - // 同时新增至用户角色表 - //账号赋予角色 - userClient.rolePermissionService(account.getId(), roleIds,null); - - //countSuccess:统计累计成功次数 - countSuccess++; - } else { - //countError:累计失败次数 - countError++; - } - } - String exportCode = ""; - - // 有导入失败的数据,才会存入redis - if (countError > 0) { - //生成token - exportCode = "FAILURE_IMPORT" + UUID.randomUUID().toString().replace("-", ""); - ValueOperations ops = stringRedisTemplate.opsForValue(); - - List collect = failVo1.stream().filter(importStaffFailureVo -> { - return !importStaffFailureVo.getFailureMsg().equals(""); - }).collect(Collectors.toList()); - - String failureVOJson = JSON.toJSONString(collect); - ops.set(exportCode, failureVOJson, 30 * 60, TimeUnit.SECONDS); - } - map.put("exportCode", exportCode);//返回导出code - map.put("successNum", countSuccess + "");//本次新增成功数量 - map.put("failureNum", countError + "");//本次新增失败数量 - return map; - } catch (RuntimeException e) { - System.err.println(e.getMessage()); - throw new RuntimeException(); - } - } - - /** - * @Description : 校验邮箱 - * @Param email - * @Author Rong---2021/10/18 - */ - public static boolean isValidEmail(String email) { - if ((email != null) && (!email.isEmpty())) { - return Pattern.matches("^(\\w+([-.][A-Za-z0-9]+)*){3,18}@\\w+([-.][A-Za-z0-9]+)*\\.\\w+([-.][A-Za-z0-9]+)*$", email); - } - return false; - } - - public static void main(String[] args) { - //System.out.println(validPhoneNum("0", "13828811320")); - System.out.println(isValidEmail("13828811320@qq.com")); - } - - /** - * @Description : 校验手机号 - * @Param checkType 校验类型:0校验手机号码,1校验座机号码,2两者都校验满足其一就可 - * @Param phoneNum - * @Author Rong---2021/10/18 - */ - public static boolean validPhoneNum(String checkType, String phoneNum) { - boolean flag = false; - Pattern p1 = null; - Pattern p2 = null; - Matcher m = null; - p1 = Pattern.compile("^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1})|(17[0-9]{1}))+\\d{8})?$"); - p2 = Pattern.compile("^(0[0-9]{2,3}\\-)?([1-9][0-9]{6,7})$"); - if ("0".equals(checkType)) { - System.out.println(phoneNum.length()); - if (phoneNum.length() != 11) { - return false; - } else { - m = p1.matcher(phoneNum); - flag = m.matches(); - } - } else if ("1".equals(checkType)) { - if (phoneNum.length() < 11 || phoneNum.length() >= 16) { - return false; - } else { - m = p2.matcher(phoneNum); - flag = m.matches(); - } - } else if ("2".equals(checkType)) { - if (!((phoneNum.length() == 11 && p1.matcher(phoneNum).matches()) || (phoneNum.length() < 16 && p2.matcher(phoneNum).matches()))) { - return false; - } else { - flag = true; - } - } - return flag; - } - - @Override - public void exportFailureRecord(HttpServletResponse response, String token) throws Exception { - if (org.apache.commons.lang3.StringUtils.isEmpty(token)) { - return; - } - ValueOperations ops = stringRedisTemplate.opsForValue(); - //获取数据 - String record = ops.get(token); - if (org.apache.commons.lang3.StringUtils.isEmpty(record)) { - return; - } - List parse = JSON.parseObject(record, new TypeReference>() { - }); - - parse.sort(Comparator.comparing(ImportStaffFailureVo::getIndex)); - - // 告诉浏览器用什么软件可以打开此文件 - response.setHeader("content-Type", "application/vnd.ms-excel"); - // 下载文件的默认名称 - response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("员工导入失败数据表", "UTF-8") + ".xls"); - //编码 - response.setCharacterEncoding("UTF-8"); - Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), ImportStaffFailureVo.class, parse); - ExportParams exportParams = new ExportParams(null, "delivery", ExcelType.XSSF); - exportParams.setStyle(ExcelStyleUtil.class); - workbook.write(response.getOutputStream()); - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/StudentServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/StudentServiceImpl.java deleted file mode 100644 index 6adc9ea..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/StudentServiceImpl.java +++ /dev/null @@ -1,1004 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import cn.afterturn.easypoi.excel.ExcelExportUtil; -import cn.afterturn.easypoi.excel.entity.ExportParams; -import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.TypeReference; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; -import com.huoran.api.UserClient; -import com.huoran.common.constant.DelConstant; -import com.huoran.common.constant.PlatformConstant; -import com.huoran.common.entity.Student; -import com.huoran.common.entity.UserAccount; -import com.huoran.common.entity.UserInfo; -import com.huoran.common.exception.CustomException; -import com.huoran.common.exception.ExceptionEnum; -import com.huoran.common.utils.DateUtils; -import com.huoran.common.utils.MD5; -import com.huoran.occupationlab.entity.*; -import com.huoran.occupationlab.entity.Class; -import com.huoran.occupationlab.entity.req.*; -import com.huoran.occupationlab.entity.resp.StudentInfoResp; -import com.huoran.occupationlab.entity.vo.ImportStudentFailureVo; -import com.huoran.occupationlab.mapper.ArchitectureMapper; -import com.huoran.occupationlab.mapper.ClassMapper; -import com.huoran.occupationlab.mapper.StudentMapper; -import com.huoran.occupationlab.service.StudentService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.huoran.common.utils.DateUtil; -import com.huoran.occupationlab.utils.ExcelImportHelper; -import com.huoran.occupationlab.utils.poi.CommonCode; -import com.huoran.occupationlab.utils.poi.ExcelStyleUtil; -import com.huoran.occupationlab.utils.poi.ExceptionCast; -import org.apache.ibatis.annotations.Param; -import org.apache.poi.ss.usermodel.Workbook; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.data.redis.core.ValueOperations; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.net.URLEncoder; -import java.util.*; -import java.util.concurrent.TimeUnit; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.stream.Collectors; - -/** - *

- * 学生表 服务实现类 - *

- * - * @author lr - * @since 2021-08-24 - */ -@Service -public class StudentServiceImpl extends ServiceImpl implements StudentService { - - @Autowired - private ArchitectureMapper architectureMapper; - - @Autowired - private ClassMapper classMapper; - - @Autowired - private StudentMapper studentMapper; - - @Resource - StringRedisTemplate stringRedisTemplate; - - @Autowired - private UserClient userClient; - - @Override - public StudentInfoResp getStudentInfoDetail(@Param("params") Map params) { - return studentMapper.getStudentInfoDetail(params); - } - - @Override - public StudentInfoResp getStudentInfoDetailByWorkNum(Map params) { - return studentMapper.getStudentInfoDetailByWorkNum(params); - } - - @Override - public boolean addUserInfo(UserInfo userInfo) { - if (studentMapper.addUserInfo(userInfo) > 0) { - return true; - } - return false; - - } - - @Override - public boolean addUserAccount(UserAccount account) { - if (studentMapper.addUserAccount(account) > 0) { - return true; - } - return false; - } - - @Override - public List checkUserInfo(UserInfo userInfo) { - return baseMapper.checkUserInfo(userInfo); - } - - @Override - public List checkUserAccount(UserAccount userAccount) { - return baseMapper.checkUserAccount(userAccount); - } - - @Override - public List studentList(PageStudentListReq req) { - Map map = new HashMap<>(); - map.put("schoolId", req.getSchoolId()); - map.put("keyWord", req.getKeyWord()); - map.put("pageNum", (req.getPageNum() - 1) * req.getPageSize()); - map.put("pageSize", req.getPageSize()); - map.put("type", req.getType()); - map.put("accountId", req.getAccountId()); - return baseMapper.studentList(map); - } - - @Override - public Integer studentListNum(PageStudentListReq req) { - Map map = new HashMap<>(); - map.put("keyWord", req.getKeyWord()); - map.put("schoolId", req.getSchoolId()); - map.put("pageNum", (req.getPageNum() - 1) * req.getPageSize()); - map.put("pageSize", req.getPageSize()); - map.put("type", req.getType()); - return baseMapper.studentListNum(map); - } - - @Override - public List getOccupationlabStudent() { - return baseMapper.getOccupationlabStudent(); - } - - @Override - public StudentInfoResp getStudentInfoByAccountId(Integer stuAccountId) { - return baseMapper.getStudentInfoByAccountId(stuAccountId); - } - - @Override - public boolean modifyUserInfo(UserInfo userInfo) { - /* EditStudentsReq req = new EditStudentsReq(); - req.setPhoneBindingTime(null); - if (userInfo.getPhone() != null) { - - BeanUtils.copyProperties(userInfo, req); - req.setPhoneBindingTime(DateUtils.getNowTime()); - boolean result = baseMapper.modifyUserAccountByUserId(req); - }*/ - - return baseMapper.modifyUserInfo(userInfo); - } - - @Override - public boolean modifyUserAccount(UserAccount userAccount) { - userAccount.setPhoneBindingTime(null); - if (userAccount.getPhone() != null && !userAccount.getPhone().equals("")) { - userAccount.setPhoneBindingTime(DateUtils.getNowTime()); - } - return baseMapper.modifyUserAccount(userAccount); - } - - /** - * @Description :校验是否存在文字 为true表示存在 false表示不存在 - * @Param str - * @Author Rong---2021/11/4 - */ - public static boolean isContainChinese(String str) { - Pattern p = Pattern.compile("[\u4e00-\u9fa5]"); - Matcher m = p.matcher(str); - if (m.find()) { - return true; - } - return false; - } - - @Transactional - @Override - public Map uploadStudent(MultipartFile file, Integer schoolId) throws IOException { - List impStudentReqs = ExcelImportHelper.readStudent(file); - if (impStudentReqs.size() <= 0) { - //小于等于0为上传空模板的情况下 抛出异常 - throw new CustomException(ExceptionEnum.EXCEL_FILE_FORMAT_ERROR); - } - int count = 0; - List failVo1 = new ArrayList<>(); - // 参数合法性校验,只能上传.xlsx后缀的文件 - if (org.apache.commons.lang3.StringUtils.isBlank(file.getOriginalFilename()) || !file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")).equals(".xlsx")) { - ExceptionCast.cast(CommonCode.EXCEL_FILE_INVALID); - } - int size = impStudentReqs.size(); - Map map = new HashMap<>(); - Long ii = 1L;//用于记录序列号 - Integer countNum = 0;//用于失败原因排序 eg:1、XXXXX 2、XXXXXXX - try { - Integer countSuccess = 0;//统计成功次数 - Integer countError = 0;//统计失败次数 - - List workNumberList = new ArrayList<>();//用来储存新增前用户在excel中输入的所有学号用于excel中的数据判重 - List accountList = new ArrayList<>();//用来储存新增前用户在excel中输入的所有账号用于excel中的数据判重 - - for (int i = 0; i < impStudentReqs.size(); i++) { - boolean ret = true;//用于判断是否可以新增到数据库中 - ++ii; - ExcelImpStudentReq req = impStudentReqs.get(i); - - String errMsg = ""; - //去除Excel中的全角半角空格 - String getUserName = req.getUserName().replaceAll("\\u00A0", "").trim(); - //String getAccount = req.getAccount().replaceAll("\\u00A0", "").trim(); - //22.4.13补充: 账号组成条件:平台(职站/数据平台/中台)-端(教师、学生端、无端(数据平台的用户))-学校(学校id)-学号/工号(用户输入的工号学号) - - String getWorkNumber = req.getWorkNumber().replaceAll("\\u00A0", "").trim(); - String getProfessional = req.getProfessional().replaceAll("\\u00A0", "").trim();//专业 - String getGrade = req.getGrade().replaceAll("\\u00A0", "").trim();//年级 - String getClasses = req.getClasses().replaceAll("\\u00A0", "").trim();//班级 - String getPhone = req.getPhone().replaceAll("\\u00A0", "").trim(); - String getEmail = req.getEmail().replaceAll("\\u00A0", "").trim(); - - ImportStudentFailureVo vo1 = new ImportStudentFailureVo(); - - //判断当前的Excel列表中是否存在重复的 - if (!workNumberList.contains(req.getWorkNumber())) { - workNumberList.add(req.getWorkNumber()); - } else { - //包含excel数据中存在相同学号 - ++countNum; - vo1.setProfessional(getProfessional); - vo1.setGrade(getGrade); - vo1.setClasses(getClasses); - vo1.setUserName(getUserName); - vo1.setPhone(getPhone); - vo1.setEmail(getEmail); - // vo1.setAccount(getAccount); - vo1.setWorkNumber(getWorkNumber + " *必填项:(当前Excel数据中该学号已存在重复的!)"); - errMsg += countNum + " *必填项:(当前Excel数据中该学号已存在重复的)"; - ret = false; - countError++; - } - - /* if (!accountList.contains(req.getAccount())) { - accountList.add(req.getAccount()); - } else { - //包含excel数据中存在相同账号 - ++countNum; - vo1.setProfessional(getProfessional); - vo1.setGrade(getGrade); - vo1.setClasses(getClasses); - vo1.setUserName(getUserName); - vo1.setWorkNumber(getWorkNumber); - vo1.setPhone(getPhone); - vo1.setEmail(getEmail); - // vo1.setAccount(getAccount + " *必填项:(当前Excel数据中该账号已存在重复的)"); - errMsg += countNum + " *必填项:(当前Excel数据中该账号已存在重复的)"; - ret = false; - }*/ - - vo1.setIndex(ii); - - //校验学号是否存在汉字 - if (!getWorkNumber.trim().equals("")) { - if (isContainChinese(getWorkNumber)) { - ++countNum; - vo1.setProfessional(getProfessional); - vo1.setGrade(getGrade); - vo1.setClasses(getClasses); - // vo1.setAccount(getAccount); - vo1.setUserName(getUserName); - vo1.setPhone(getPhone); - vo1.setEmail(getEmail); - vo1.setWorkNumber(getWorkNumber + "* 学号不能存在汉字!"); - errMsg += countNum + " * 学号不能存在汉字!"; - ret = false; - countError++; - } - } - - String classId = ""; - //姓名 账号 学号 不为空则查询是否存在该生 - //如若已经存在则根据学生架构判断 如果存在同一个班级下才提示错误信息 - - StudentInfoResp stu = new StudentInfoResp(); - stu.setWorkNumber(getWorkNumber); - stu.setUserName(getUserName); - stu.setSchoolId(schoolId); - StudentInfoResp listResp = studentMapper.getUserInfo(stu);//连表查询 - - if (!getWorkNumber.equals("") && !getUserName.equals("")) { - UserAccount checkWorkNumber = new UserAccount(); - checkWorkNumber.setWorkNumber(getWorkNumber); - checkWorkNumber.setSchoolId(schoolId); - checkWorkNumber.setType(PlatformConstant.STUDENT_SIDE); - checkWorkNumber.setPlatformId(PlatformConstant.POST_STATION + ""); - - UserAccount getUserInfoByWorkNumber = studentMapper.checkAccountOrWorkNum(checkWorkNumber);//查询工号 - - if (listResp != null && getUserInfoByWorkNumber != null) { - //如果查询工号 以及 查询账号时 查询出来的信息一致则表示该用户已存在 - if (!getWorkNumber.equals(getUserInfoByWorkNumber.getWorkNumber().equals(listResp.getUserName())) && !listResp.getUserName().equals(getUserName)) { - ++countNum; - vo1.setProfessional(getProfessional); - vo1.setGrade(getGrade); - vo1.setClasses(getClasses); - // vo1.setAccount(getAccount); - vo1.setUserName(getUserName); - vo1.setWorkNumber(getWorkNumber); - vo1.setPhone(getPhone); - vo1.setEmail(getEmail); - errMsg += countNum + " * 该学号已存在!"; - ret = false; - countError++; - } - } else if (listResp != null || getUserInfoByWorkNumber != null) {//如果其中一个不为空表示该导入的用户账号或工号重复了 - ++countNum; - vo1.setProfessional(getProfessional); - vo1.setGrade(getGrade); - vo1.setClasses(getClasses); - // vo1.setAccount(getAccount); - vo1.setUserName(getUserName); - vo1.setWorkNumber(getWorkNumber); - vo1.setPhone(getPhone); - vo1.setEmail(getEmail); - errMsg += countNum + " * 学号已存在,姓名与学号不匹配!"; - ret = false; - countError++; - } - } - - //表示用户输入的都匹配 --->判断是否有输入组织架构 - if (listResp != null) {//表示存在该校存在该学生 - if (getProfessional.equals("") && getGrade.equals("") && getClasses.equals("")) {//表示已存在该用户 - ++countNum; - vo1.setProfessional(getProfessional); - vo1.setGrade(getGrade); - vo1.setClasses(getClasses); - // vo1.setAccount(getAccount); - vo1.setUserName(getUserName); - vo1.setWorkNumber(getWorkNumber); - vo1.setPhone(getPhone); - vo1.setEmail(getEmail); - errMsg += countNum + " * 该用户已存在!"; - ret = false; - countError++; - } else if (!getProfessional.equals("") && !getGrade.equals("") && !getClasses.equals("")) {//三层之前都不为空 则对用户输入的三层进行查询 - - //查询专业所属主键 - QueryWrapper queryWrapper1 = new QueryWrapper<>(); - queryWrapper1.eq("organization_name", getProfessional); - queryWrapper1.eq("is_del", DelConstant.NOT_DEL); - queryWrapper1.eq("school_id", schoolId); - queryWrapper1.eq("parent_id", schoolId); - queryWrapper1.eq("level", 1); - Architecture professional = architectureMapper.selectOne(queryWrapper1); - - if (professional == null) {//professional 为空表示用户输入的是自定义的一级架构 则新增专业 - Architecture addProfessional = new Architecture(); - addProfessional.setSchoolId(schoolId); - addProfessional.setParentId(schoolId); - addProfessional.setOrganizationName(getProfessional); - addProfessional.setLevel(1); - Integer addProfessionalRet = architectureMapper.insert(addProfessional); - if (addProfessionalRet > 0) {//执行新增专业成功后 - // 执行新增年级 - Architecture addGrade = new Architecture(); - addGrade.setSchoolId(schoolId); - addGrade.setParentId(addProfessional.getId()); - addGrade.setLevel(2); - addGrade.setOrganizationName(getGrade); - Integer addGradeRet = architectureMapper.insert(addGrade); - // 执行新增班级操作 - if (addGradeRet > 0) { - - Class addClass = new Class().setArchitectureId(addGrade.getId()).setClassName(getClasses); - Integer addClsssRet = classMapper.insert(addClass); - - if (addClsssRet > 0) { - QueryWrapper studentQueryWrapper = new QueryWrapper<>(); - studentQueryWrapper.eq("is_del", DelConstant.NOT_DEL); - studentQueryWrapper.eq("account_id", listResp.getAccountId()); - //此处判断是否存在别的班级中 - Student student = baseMapper.selectOne(studentQueryWrapper); - - UpdateWrapper updateWrapper = new UpdateWrapper<>(); - if (student.getClassId().equals("1")) { //没有存在该班级中 直接拉入该班级 - updateWrapper.set("class_id", addClass.getId()); - } else { - updateWrapper.set("class_id", student.getClassId() + "," + addClass.getId());//该生存在于别的班级中 所以拼接 - } - updateWrapper.eq("account_id", listResp.getAccountId()); - updateWrapper.eq("is_del", 0); - baseMapper.update(new Student(), updateWrapper); - - } - } - } - - } else {//professional 不为空表示一级存在 - //根据专业id查询该专业下的年级 - QueryWrapper queryWrapper2 = new QueryWrapper<>(); - queryWrapper2.eq("is_del", DelConstant.NOT_DEL); - queryWrapper2.eq("school_id", schoolId); - queryWrapper2.eq("parent_id", professional.getId()); - queryWrapper2.eq("level", 2); - queryWrapper2.eq("organization_name", getGrade); - Architecture grade = architectureMapper.selectOne(queryWrapper2); - if (grade == null) {//如果二级为空表示自定义二级架构 则新增年级 - Architecture addGrade = new Architecture(); - addGrade.setSchoolId(schoolId); - addGrade.setParentId(professional.getId()); - addGrade.setLevel(2); - addGrade.setOrganizationName(getGrade); - architectureMapper.insert(addGrade); - //同时新增班级及拉入班级 - Class addClass = new Class(); - addClass.setArchitectureId(addGrade.getId()).setClassName(getClasses); - Integer addClsssRet = classMapper.insert(addClass); - - if (addClsssRet > 0) { - QueryWrapper studentQueryWrapper = new QueryWrapper<>(); - studentQueryWrapper.eq("is_del", DelConstant.NOT_DEL); - studentQueryWrapper.eq("account_id", listResp.getAccountId()); - //此处判断是否存在别的班级中 - Student student = baseMapper.selectOne(studentQueryWrapper); - - UpdateWrapper updateWrapper = new UpdateWrapper<>(); - if (student.getClassId().equals("1")) { //没有存在该班级中 直接拉入该班级 - updateWrapper.set("class_id", addClass.getId()); - } else { - updateWrapper.set("class_id", student.getClassId() + "," + addClass.getId());//该生存在于别的班级中 所以拼接 - } - updateWrapper.eq("account_id", listResp.getAccountId()); - updateWrapper.eq("is_del", 0); - baseMapper.update(new Student(), updateWrapper); - - } - - } else {//表示该年级存在 - //根据年级id查询年级下的班级 - QueryWrapper queryWrapper3 = new QueryWrapper<>(); - queryWrapper3.eq("is_del", DelConstant.NOT_DEL); - queryWrapper3.eq("architecture_id", grade.getId()); - queryWrapper3.eq("class_name", getClasses); - Class class1 = classMapper.selectOne(queryWrapper3); - - if (class1 == null) {//classes为空表示自定义三级架构 执行新增操作 - Class addClass = new Class().setArchitectureId(grade.getId()).setClassName(getClasses); - classMapper.insert(addClass); - //新增班级同时拉入班级 - QueryWrapper studentQueryWrapper = new QueryWrapper<>(); - studentQueryWrapper.eq("is_del", DelConstant.NOT_DEL); - studentQueryWrapper.eq("account_id", listResp.getAccountId()); - Student student = baseMapper.selectOne(studentQueryWrapper); - - //没有存在该班级中 直接拉入该班级 - UpdateWrapper updateWrapper = new UpdateWrapper<>(); - if (student.getClassId().equals("1")) {//表示该生还未加入班级 - updateWrapper.set("class_id", addClass.getId()); - } else { - updateWrapper.set("class_id", student.getClassId() + "," + addClass.getId()); - } - updateWrapper.eq("account_id", listResp.getAccountId()); - updateWrapper.eq("is_del", 0); - baseMapper.update(new Student(), updateWrapper); - - } else { - - QueryWrapper studentQueryWrapper = new QueryWrapper<>(); - studentQueryWrapper.eq("is_del", DelConstant.NOT_DEL); - studentQueryWrapper.eq("account_id", listResp.getAccountId()); - studentQueryWrapper.last(" and FIND_IN_SET(" + class1.getId() + ",class_id) "); - - Student checkReapt = baseMapper.selectOne(studentQueryWrapper); - if (checkReapt != null) { - ++countNum; - vo1.setProfessional(getProfessional); - vo1.setGrade(getGrade); - vo1.setClasses(getClasses); - // vo1.setAccount(getAccount); - vo1.setUserName(getUserName); - vo1.setWorkNumber(getWorkNumber); - vo1.setPhone(getPhone); - vo1.setEmail(getEmail); - errMsg += countNum + " * 该用户已存在该班级中了!"; - ret = false; - countError++; - } else { - //拉入该班级 - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("is_del", DelConstant.NOT_DEL); - queryWrapper.eq("account_id", listResp.getAccountId()); - Student student = baseMapper.selectOne(queryWrapper); - - //没有存在该班级中 直接拉入该班级 - UpdateWrapper updateWrapper = new UpdateWrapper<>(); - if (student.getClassId().equals("1")) {//表示该生还未加入班级 - updateWrapper.set("class_id", class1.getId()); - } else { - updateWrapper.set("class_id", student.getClassId() + "," + class1.getId()); - } - updateWrapper.eq("account_id", listResp.getAccountId()); - updateWrapper.eq("is_del", 0); - baseMapper.update(new Student(), updateWrapper); - } - - } - } - - } - - } - - } else { - //不存在该生则校验学号账号新增学生操作 - //ret判断 新增成功的插入到数据库 否则则不新增至数据库 - //检验学生姓名 - if (getUserName.equals("")) { - ++countNum; - vo1.setUserName(getUserName + " *必填项:(学生姓名不能为空) "); - vo1.setProfessional(getProfessional); - vo1.setGrade(getGrade); - vo1.setClasses(getClasses); - // vo1.setAccount(getAccount); - vo1.setWorkNumber(getWorkNumber); - vo1.setPhone(getPhone); - vo1.setEmail(getEmail); - errMsg += countNum + "必填项:(学生姓名不能为空)"; - ret = false; - countError++; - } else { - vo1.setUserName(getUserName); - } - - /*if (getAccount.equals("")) { - ++countNum; - vo1.setAccount(getAccount + " *必填项:(学生账号不能为空)"); - vo1.setProfessional(getProfessional); - vo1.setGrade(getGrade); - vo1.setClasses(getClasses); - vo1.setUserName(getUserName); - vo1.setWorkNumber(getWorkNumber); - vo1.setPhone(getPhone); - vo1.setEmail(getEmail); - errMsg += countNum + " *必填项:(学生账号不能为空)"; - ret = false; - countError++; - } else { - vo1.setAccount(getAccount); - }*/ - if (getWorkNumber.equals("")) { - ++countNum; - vo1.setWorkNumber(getWorkNumber + " *必填项:(学号不能为空)"); - vo1.setProfessional(getProfessional); - vo1.setGrade(getGrade); - vo1.setClasses(getClasses); - // vo1.setAccount(getAccount); - vo1.setUserName(getUserName); - vo1.setPhone(getPhone); - vo1.setEmail(getEmail); - errMsg += countNum + " *必填项:(学号不能为空)"; - ret = false; - countError++; - } else { - vo1.setWorkNumber(getWorkNumber); - } - - //校验手机号、邮箱 - if (!getPhone.equals("")) { - //校验手机号格式 - if (validPhoneNum("0", getPhone) == false) { - ++countNum; - vo1.setPhone(getPhone + " *请输入正确的手机号!"); - vo1.setProfessional(getProfessional); - vo1.setGrade(getGrade); - vo1.setClasses(getClasses); - // vo1.setAccount(getAccount); - vo1.setUserName(getUserName); - vo1.setWorkNumber(getWorkNumber); - vo1.setPhone(getPhone); - vo1.setEmail(getEmail); - vo1.setProfessional(getProfessional); - vo1.setGrade(getGrade); - vo1.setClasses(getClasses); - vo1.setUserName(getUserName); - vo1.setWorkNumber(getWorkNumber); - vo1.setEmail(getEmail); - errMsg += countNum + " *请输入正确的手机号!"; - ret = false; - countError++; - }/* else { - //检验手机号 type 1为手机号 2为校验邮箱 - boolean checkPhone = userClient.checkPhoneOrEmailExist(getPhone, getEmail, 1); - if (checkPhone) { - ++countNum; - vo1.setProfessional(getProfessional); - vo1.setGrade(getGrade); - vo1.setClasses(getClasses); - // vo1.setAccount(getAccount); - vo1.setUserName(getUserName); - vo1.setWorkNumber(getWorkNumber); - vo1.setEmail(getEmail); - vo1.setPhone(getPhone + " *该手机号已被绑定!"); - errMsg += countNum + " *该手机号已被绑定!"; - ret = false; - countError++; - } - vo1.setPhone(getPhone); - }*/ - - } else { - vo1.setPhone(getPhone); - } - - if (!getEmail.equals("")) { - //校验邮箱格式 - if (isValidEmail(getEmail) == false) { - ++countNum; - vo1.setProfessional(getProfessional); - vo1.setGrade(getGrade); - vo1.setClasses(getClasses); - // vo1.setAccount(getAccount); - vo1.setUserName(getUserName); - vo1.setWorkNumber(getWorkNumber); - vo1.setPhone(getPhone); - vo1.setEmail(getEmail + "*请输入正确的邮箱格式!"); - errMsg += countNum + " *请输入正确的邮箱格式!"; - ret = false; - countError++; - } /*else { - //检验手机号 type 2为校验邮箱 - boolean checkEmail = userClient.checkPhoneOrEmailExist(getPhone, getEmail, 2); - if (checkEmail) { - ++countNum; - vo1.setProfessional(getProfessional); - vo1.setGrade(getGrade); - vo1.setClasses(getClasses); - // vo1.setAccount(getAccount); - vo1.setUserName(getUserName); - vo1.setWorkNumber(getWorkNumber); - vo1.setPhone(getPhone); - vo1.setEmail(getEmail + " *该邮箱已被绑定!"); - errMsg += countNum + " *该邮箱已被绑定!"; - ret = false; - countError++; - } - vo1.setEmail(getEmail); - }*/ - - } else { - vo1.setEmail(getEmail); - } - - if (ret) { - //执行新增操作 - // 学号(本校内、平台端(教师or学生)、平台来源) - // 账号、手机号、邮箱全平台判重 - UserInfo userInfo = new UserInfo(); - userInfo.setSchoolId(schoolId); - userInfo.setRoleId("0"); - userInfo.setUniqueIdentification(String.valueOf(System.currentTimeMillis())); - BeanUtils.copyProperties(req, userInfo); - studentMapper.addUserInfo(userInfo); - - UserAccount account = new UserAccount(); - account.setSchoolId(schoolId); - account.setPassword(MD5.encrypt("1122aa")); - account.setPlatformId(PlatformConstant.POST_STATION + "");//所属平台id 1.职站 - account.setType(PlatformConstant.STUDENT_SIDE);//平台端区分:0->教师端 1->学生端 2->无端 - account.setUserId(userInfo.getUserId()); - account.setRoleId("0"); - //22.4.13补充: 账号组成条件:平台(职站/数据平台/中台)-端(教师、学生端、无端(数据平台的用户))-学校(学校id)-学号/工号(用户输入的工号学号) - - account.setAccount(PlatformConstant.POST_STATION + "-" + PlatformConstant.STUDENT_SIDE + "-" + schoolId + "-" + req.getWorkNumber()); - BeanUtils.copyProperties(req, account); - account.setPhone(null); - if (getPhone != null && !getPhone.equals("")) { - account.setPhone(getPhone); - account.setPhoneBindingTime(DateUtil.currentDate()); - } - - studentMapper.addUserAccount(account); - - //新增学生(先默认为未指定班级) - Student addStudent = new Student(); - addStudent.setAccountId(account.getId()); - if (classId.equals("")) { - addStudent.setClassId("1"); - } else { - addStudent.setClassId(classId); - } - - BeanUtils.copyProperties(req, addStudent); - addStudent.setSchoolId(schoolId); - studentMapper.insert(addStudent); - - if (getProfessional.equals("") || getGrade.equals("") || getClasses.equals("")) { - ++countNum; - vo1.setProfessional(getProfessional); - vo1.setGrade(getGrade); - vo1.setClasses(getClasses); - // vo1.setAccount(getAccount); - vo1.setUserName(getUserName); - vo1.setWorkNumber(getWorkNumber); - vo1.setPhone(getPhone); - vo1.setEmail(getEmail); - errMsg += countNum + "该生已新增成功,请输入正确的学生架构才能将该生拉入班级中!"; - ret = false; - countError++;//countError:累计失败次数 - } else if (!getProfessional.equals("") && !getGrade.equals("") && !getClasses.equals("")) { - QueryWrapper queryWrapper1 = new QueryWrapper<>(); - queryWrapper1.eq("organization_name", getProfessional); - queryWrapper1.eq("is_del", DelConstant.NOT_DEL); - queryWrapper1.eq("school_id", schoolId); - queryWrapper1.eq("parent_id", schoolId); - queryWrapper1.eq("level", 1); - Architecture professional = architectureMapper.selectOne(queryWrapper1); - - if (professional == null) {//professional 为空表示用户输入的是自定义的一级架构 则新增专业 - Architecture addProfessional = new Architecture(); - addProfessional.setSchoolId(schoolId); - addProfessional.setParentId(schoolId); - addProfessional.setOrganizationName(getProfessional); - addProfessional.setLevel(1); - Integer addProfessionalRet = architectureMapper.insert(addProfessional); - if (addProfessionalRet > 0) {//执行新增专业成功后 - // 执行新增年级 - Architecture addGrade = new Architecture(); - addGrade.setSchoolId(schoolId); - addGrade.setParentId(addProfessional.getId()); - addGrade.setLevel(2); - addGrade.setOrganizationName(getGrade); - Integer addGradeRet = architectureMapper.insert(addGrade); - // 执行新增班级操作 - if (addGradeRet > 0) { - - Class addClass = new Class().setArchitectureId(addGrade.getId()).setClassName(getClasses); - Integer addClsssRet = classMapper.insert(addClass); - - classCheck(account, addClass, addClsssRet); - } - } - - } else {//professional 不为空表示一级存在 - //根据专业id查询该专业下的年级 - QueryWrapper queryWrapper2 = new QueryWrapper<>(); - queryWrapper2.eq("is_del", DelConstant.NOT_DEL); - queryWrapper2.eq("school_id", schoolId); - queryWrapper2.eq("parent_id", professional.getId()); - queryWrapper2.eq("level", 2); - queryWrapper2.eq("organization_name", getGrade); - Architecture grade = architectureMapper.selectOne(queryWrapper2); - if (grade == null) {//如果二级为空表示自定义二级架构 则新增年级 - Architecture addGrade = new Architecture(); - addGrade.setSchoolId(schoolId); - addGrade.setParentId(professional.getId()); - addGrade.setLevel(2); - addGrade.setOrganizationName(getGrade); - architectureMapper.insert(addGrade); - //同时新增班级及拉入班级 - Class addClass = new Class(); - addClass.setArchitectureId(addGrade.getId()).setClassName(getClasses); - Integer addClsssRet = classMapper.insert(addClass); - - classCheck(account, addClass, addClsssRet); - - } else {//表示该年级存在 - //根据年级id查询年级下的班级 - QueryWrapper queryWrapper3 = new QueryWrapper<>(); - queryWrapper3.eq("is_del", DelConstant.NOT_DEL); - queryWrapper3.eq("architecture_id", grade.getId()); - queryWrapper3.eq("class_name", getClasses); - Class class1 = classMapper.selectOne(queryWrapper3); - - if (class1 == null) {//classes为空表示自定义三级架构 执行新增操作 - Class addClass = new Class().setArchitectureId(grade.getId()).setClassName(getClasses); - classMapper.insert(addClass); - //新增班级同时拉入班级 - QueryWrapper studentQueryWrapper = new QueryWrapper<>(); - studentQueryWrapper.eq("is_del", DelConstant.NOT_DEL); - studentQueryWrapper.eq("account_id", account.getId()); - Student student = baseMapper.selectOne(studentQueryWrapper); - - //没有存在该班级中 直接拉入该班级 - UpdateWrapper updateWrapper = new UpdateWrapper<>(); - if (student.getClassId().equals("1")) {//表示该生还未加入班级 - updateWrapper.set("class_id", addClass.getId()); - } else { - updateWrapper.set("class_id", student.getClassId() + "," + addClass.getId()); - } - updateWrapper.eq("account_id", account.getId()); - updateWrapper.eq("is_del", 0); - baseMapper.update(new Student(), updateWrapper); - - } else { - QueryWrapper studentQueryWrapper = new QueryWrapper<>(); - studentQueryWrapper.eq("is_del", DelConstant.NOT_DEL); - studentQueryWrapper.eq("account_id", account.getId()); - Student student = baseMapper.selectOne(studentQueryWrapper); - - //没有存在该班级中 直接拉入该班级 - UpdateWrapper updateWrapper = new UpdateWrapper<>(); - if (student.getClassId().equals("1")) {//表示该生还未加入班级 - updateWrapper.set("class_id", class1.getId()); - } else { - updateWrapper.set("class_id", student.getClassId() + "," + class1.getId()); - } - updateWrapper.eq("account_id", account.getId()); - updateWrapper.eq("is_del", 0); - baseMapper.update(new Student(), updateWrapper); - } - } - - } - } - - } - } - - countSuccess++; //统计累计成功次数 - vo1.setPhone(getPhone); - vo1.setEmail(getEmail); - vo1.setFailureMsg(errMsg); - countNum = 0; - failVo1.add(vo1); - - } - String exportCode = ""; - - // 有导入失败的数据,才会存入redis - if (countError > 0) { - //生成token - exportCode = "FAILURE_IMPORT" + UUID.randomUUID().toString().replace("-", ""); - ValueOperations ops = stringRedisTemplate.opsForValue(); - - List collect = failVo1.stream().filter(importStudentFailureVo -> { - return !importStudentFailureVo.getFailureMsg().equals(""); - }).collect(Collectors.toList()); - - String failureVOJson = JSON.toJSONString(collect); - ops.set(exportCode, failureVOJson, 30 * 60, TimeUnit.SECONDS); - } - map.put("exportCode", exportCode);//返回导出code - //map.put("successNum", countSuccess + "");//本次新增成功数量 - map.put("failureNum", countError + "");//本次新增失败数量 - return map; - } catch (RuntimeException e) { - System.err.println(e.getMessage()); - throw new RuntimeException(); - } - - } - - private void classCheck(UserAccount account, Class addClass, Integer addClsssRet) { - if (addClsssRet > 0) { - QueryWrapper studentQueryWrapper = new QueryWrapper<>(); - studentQueryWrapper.eq("is_del", DelConstant.NOT_DEL); - studentQueryWrapper.eq("account_id", account.getId()); - //此处判断是否存在别的班级中 - Student student = baseMapper.selectOne(studentQueryWrapper); - - UpdateWrapper updateWrapper = new UpdateWrapper<>(); - if (student.getClassId().equals("1")) { //没有存在该班级中 直接拉入该班级 - updateWrapper.set("class_id", addClass.getId()); - } else { - updateWrapper.set("class_id", student.getClassId() + "," + addClass.getId());//该生存在于别的班级中 所以拼接 - } - updateWrapper.eq("account_id", account.getId()); - updateWrapper.eq("is_del", 0); - baseMapper.update(new Student(), updateWrapper); - - } - } - - /** - * @Description : 校验邮箱 - * @Param email - * @Author Rong---2021/10/18 - */ - public static boolean isValidEmail(String email) { - if ((email != null) && (!email.isEmpty())) { - return Pattern.matches("^(\\w+([-.][A-Za-z0-9]+)*){3,18}@\\w+([-.][A-Za-z0-9]+)*\\.\\w+([-.][A-Za-z0-9]+)*$", email); - } - return false; - } - - /** - * @Description : 校验手机号 - * @Param checkType 校验类型:0校验手机号码,1校验座机号码,2两者都校验满足其一就可 - * @Param phoneNum - * @Author Rong---2021/10/18 - */ - public static boolean validPhoneNum(String checkType, String phoneNum) { - boolean flag = false; - Pattern p1 = null; - Pattern p2 = null; - Matcher m = null; - String regex = "^((13[0-9])|(14(0|[5-7]|9))|(15([0-3]|[5-9]))|(16(2|[5-7]))|(17[0-8])|(18[0-9])|(19([0-3]|[5-9])))\\d{8}$"; -// p1 = Pattern.compile("^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1})|(17[0-9]{1}))+\\d{8})?$"); - p1 = Pattern.compile(regex, Pattern.CASE_INSENSITIVE); - p2 = Pattern.compile("^(0[0-9]{2,3}\\-)?([1-9][0-9]{6,7})$"); - if ("0".equals(checkType)) { - System.out.println(phoneNum.length()); - if (phoneNum.length() != 11) { - return false; - } else { - m = p1.matcher(phoneNum); - flag = m.matches(); - } - } else if ("1".equals(checkType)) { - if (phoneNum.length() < 11 || phoneNum.length() >= 16) { - return false; - } else { - m = p2.matcher(phoneNum); - flag = m.matches(); - } - } else if ("2".equals(checkType)) { - if (!((phoneNum.length() == 11 && p1.matcher(phoneNum).matches()) || (phoneNum.length() < 16 && p2.matcher(phoneNum).matches()))) { - return false; - } else { - flag = true; - } - } - return flag; - } - - public static void main(String[] args) { - boolean b = validPhoneNum("0", "19905350999"); - System.out.println(b); - } - - @Override - public void exportFailureRecord(HttpServletResponse response, String token) throws Exception { - if (org.apache.commons.lang3.StringUtils.isEmpty(token)) { - return; - } - ValueOperations ops = stringRedisTemplate.opsForValue(); - //获取数据 - String record = ops.get(token); - if (org.apache.commons.lang3.StringUtils.isEmpty(record)) { - return; - } - List parse = JSON.parseObject(record, new TypeReference>() { - }); - - parse.sort(Comparator.comparing(ImportStudentFailureVo::getIndex)); - - /*ClassPathResource classPathResource = new ClassPathResource("excel-template/学生导入失败数据导出模板.xlsx"); - InputStream inputStream = classPathResource.getInputStream(); -*/ - //3、通过工具类下载文件 - /*new ExcelExportUtil(ImportStudentFailureVo.class, Constant.ROW_INDEX, Constant.STYLE_INDEX). - export(response, inputStream, parse, "学生导入失败数据表.xlsx"); - - if (inputStream != null) { - inputStream.close(); - }*/ - // 告诉浏览器用什么软件可以打开此文件 - response.setHeader("content-Type", "application/vnd.ms-excel"); - // 下载文件的默认名称 - response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("学生导入失败数据表", "UTF-8") + ".xls"); - //编码 - response.setCharacterEncoding("UTF-8"); - Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), ImportStudentFailureVo.class, parse); - ExportParams exportParams = new ExportParams(null, "delivery", ExcelType.XSSF); - exportParams.setStyle(ExcelStyleUtil.class); - workbook.write(response.getOutputStream()); - } - - @Override - public List organizationalStudentList(OrganizationStudentReq req) { - return studentMapper.organizationalStudentList(req); - } - - @Override - public Integer organizationalStudentListNum(OrganizationStudentReq req) { - return studentMapper.organizationalStudentListNum(req); - } - - @Override - public Integer updateAccountEnable(Integer id, Integer isEnable) { - return studentMapper.updateAccountEnable(id, isEnable); - } - - @Override - public Integer getUserId(Integer accountId) { - return baseMapper.getUserId(accountId); - } - - @Override - public Integer countClassSizes(Integer schoolId, Integer classId) { - return baseMapper.countClassSizes(schoolId, classId); - } - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/SysJobLogServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/SysJobLogServiceImpl.java deleted file mode 100644 index 22c93a8..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/SysJobLogServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.huoran.occupationlab.entity.SysJobLog; -import com.huoran.occupationlab.mapper.SysJobLogMapper; -import com.huoran.occupationlab.service.SysJobLogService; -import org.springframework.stereotype.Service; - -/** - * 定时任务 服务类 - * - * @author cheney - * @version V1.0 - * @date 2022年7月28日 - */ -@Service("sysJobLogService") -public class SysJobLogServiceImpl extends ServiceImpl implements SysJobLogService { - - -} \ No newline at end of file diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/SysJobServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/SysJobServiceImpl.java deleted file mode 100644 index c089e52..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/SysJobServiceImpl.java +++ /dev/null @@ -1,117 +0,0 @@ -//package com.huoran.occupationlab.service.impl; -// -//import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -//import com.huoran.common.exception.BusinessException; -//import com.huoran.occupationlab.entity.SysJob; -//import com.huoran.occupationlab.job.utils.ScheduleUtils; -//import com.huoran.occupationlab.mapper.SysJobMapper; -//import com.huoran.occupationlab.service.SysJobService; -//import com.huoran.occupationlab.utils.job.Constant; -//import org.quartz.CronTrigger; -//import org.quartz.Scheduler; -//import org.springframework.stereotype.Service; -//import org.springframework.transaction.annotation.Transactional; -// -//import javax.annotation.PostConstruct; -//import javax.annotation.Resource; -//import java.util.List; -// -///** -// * 定时任务 服务类 -// * -// * @author cheney -// * @version V1.0 -// * @date 2022年7月28日 -// */ -// -//@Service("sysJobService") -//public class SysJobServiceImpl extends ServiceImpl implements SysJobService { -// @Resource -// private Scheduler scheduler; -// @Resource -// private SysJobMapper sysJobMapper; -// -// /** -// * 项目启动时,初始化定时器 -// */ -// -// @PostConstruct -// public void init() { -// List scheduleJobList = sysJobMapper.selectList(null); -// for (SysJob scheduleJob : scheduleJobList) { -// CronTrigger cronTrigger = ScheduleUtils.getCronTrigger(scheduler, scheduleJob.getId()); -// //如果不存在,则创建 -// if (cronTrigger == null) { -// ScheduleUtils.createScheduleJob(scheduler, scheduleJob); -// } else { -// ScheduleUtils.updateScheduleJob(scheduler, scheduleJob); -// } -// } -// } -// -// @Override -// public void saveJob(SysJob sysJob) { -// sysJob.setStatus(Constant.SCHEDULER_STATUS_NORMAL); -// this.save(sysJob); -// -// ScheduleUtils.createScheduleJob(scheduler, sysJob); -// } -// -// @Override -// public void updateJobById(SysJob sysJob) { -// SysJob sysJobEntity = this.getById(sysJob.getId()); -// if (sysJobEntity == null) { -// throw new BusinessException("获取定时任务异常"); -// } -// sysJob.setStatus(sysJobEntity.getStatus()); -// ScheduleUtils.updateScheduleJob(scheduler, sysJob); -// -// this.updateById(sysJob); -// } -// -// @Override -// public void delete(List ids) { -// for (Integer jobId : ids) { -// ScheduleUtils.deleteScheduleJob(scheduler, jobId); -// } -// sysJobMapper.deleteBatchIds(ids); -// } -// -// @Override -// @Transactional(rollbackFor = Exception.class) -// public void run(List ids) { -// for (Integer jobId : ids) { -// ScheduleUtils.run(scheduler, this.getById(jobId)); -// } -// } -// -// @Override -// @Transactional(rollbackFor = Exception.class) -// public void pause(List ids) { -// for (Integer jobId : ids) { -// ScheduleUtils.pauseJob(scheduler, jobId); -// } -// -// updateBatch(ids, Constant.SCHEDULER_STATUS_PAUSE); -// } -// -// @Override -// @Transactional(rollbackFor = Exception.class) -// public void resume(List ids) { -// for (Integer jobId : ids) { -// ScheduleUtils.resumeJob(scheduler, jobId); -// } -// -// updateBatch(ids, Constant.SCHEDULER_STATUS_NORMAL); -// } -// -// @Override -// public void updateBatch(List ids, int status) { -// ids.parallelStream().forEach(id -> { -// SysJob sysJobEntity = new SysJob(); -// sysJobEntity.setId(id); -// sysJobEntity.setStatus(status); -// baseMapper.updateById(sysJobEntity); -// }); -// } -//} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/SystemLogoServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/SystemLogoServiceImpl.java deleted file mode 100644 index b7df518..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/SystemLogoServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.huoran.occupationlab.entity.SystemLogo; -import com.huoran.occupationlab.mapper.SystemLogoMapper; -import com.huoran.occupationlab.service.SystemLogoService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -/** - *

- * 职站教师端-系统logo设置 服务实现类 - *

- * - * @author lr - * @since 2021-10-18 - */ -@Service -public class SystemLogoServiceImpl extends ServiceImpl implements SystemLogoService { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/TheoreticalCourseChapterServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/TheoreticalCourseChapterServiceImpl.java deleted file mode 100644 index 4c981ca..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/TheoreticalCourseChapterServiceImpl.java +++ /dev/null @@ -1,165 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.aliyuncs.exceptions.ClientException; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.huoran.common.utils.AliyunOssUtil; -import com.huoran.common.utils.VideoUtil; -import com.huoran.occupationlab.entity.TheoreticalCourseChapter; -import com.huoran.occupationlab.entity.TheoreticalCourseSubsection; -import com.huoran.occupationlab.entity.vo.ReorderVO; -import com.huoran.occupationlab.entity.vo.TheoreticalChapterVO; -import com.huoran.occupationlab.entity.vo.TheoreticalSubsectionVO; -import com.huoran.occupationlab.mapper.TheoreticalCourseChapterMapper; -import com.huoran.occupationlab.mapper.TheoreticalCourseSubsectionMapper; -import com.huoran.occupationlab.service.TheoreticalCourseChapterService; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.ArrayList; -import java.util.List; - -/** - *

- * 理论课程章节表 服务实现类 - *

- * - * @author lr - * @since 2022-09-22 - */ -@Service -public class TheoreticalCourseChapterServiceImpl extends ServiceImpl implements TheoreticalCourseChapterService { - - @Autowired - private TheoreticalCourseSubsectionMapper theoreticalCourseSubsectionMapper; - - @Override - public List getChapterTree(String courseId) { - // 根据课程ID查询所有章节 - QueryWrapper chapterWrapper = new QueryWrapper<>(); - chapterWrapper.eq("course_id", courseId); - //降序查询 - chapterWrapper.orderByAsc("sort"); - List chapters = baseMapper.selectList(chapterWrapper); - - // 根据课程ID查询所有小节 - QueryWrapper subsectionWrapper = new QueryWrapper<>(); - subsectionWrapper.eq("course_id", courseId); - //降序查询 - subsectionWrapper.orderByAsc("sort"); - List subsections = theoreticalCourseSubsectionMapper.selectList(subsectionWrapper); - - List chapterVOList = new ArrayList<>(); - // 遍历封装 - for (TheoreticalCourseChapter c : chapters) { - TheoreticalChapterVO chapterVO = new TheoreticalChapterVO(); - //属性复制 - BeanUtils.copyProperties(c, chapterVO); - chapterVOList.add(chapterVO); - - List subsectionVOList = new ArrayList<>(); - for (TheoreticalCourseSubsection s : subsections) { - //判断小节是否属于某一章节 - if (c.getId().equals(s.getChapterId())) { - TheoreticalSubsectionVO subsectionVO = new TheoreticalSubsectionVO(); - BeanUtils.copyProperties(s, subsectionVO); - subsectionVOList.add(subsectionVO); - } - } - //设置小节 - chapterVO.setSubsectionList(subsectionVOList); - } - return chapterVOList; - } - - @Override - public boolean updateSort(ReorderVO reorderVO) { - List chapterVOList = reorderVO.getChapterVOList(); - if (chapterVOList != null && chapterVOList.size() != 0) { - chapterVOList.forEach(chapterVO -> { - TheoreticalCourseChapter courseChapter = new TheoreticalCourseChapter(); - courseChapter.setId(chapterVO.getId()); - courseChapter.setSort(chapterVO.getSort()); - baseMapper.updateById(courseChapter); - List subsectionList = chapterVO.getSubsectionList(); - if (subsectionList != null && subsectionList.size() != 0) { - subsectionList.forEach(subsectionVO -> { - TheoreticalCourseSubsection courseSubsection = new TheoreticalCourseSubsection(); - courseSubsection.setId(subsectionVO.getId()); - courseSubsection.setSort(subsectionVO.getSort()); - theoreticalCourseSubsectionMapper.updateById(courseSubsection); - }); - } - }); - return true; - } - return false; - } - - @Override - public boolean repeat(TheoreticalCourseChapter theoreticalCourseChapter) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("course_id", theoreticalCourseChapter.getCourseId()); - wrapper.eq("name", theoreticalCourseChapter.getName()); - Integer count = baseMapper.selectCount(wrapper); - return count > 0; - } - - @Override - public boolean saveChapter(TheoreticalCourseChapter theoreticalCourseChapter) { - //查询课程章节的总数 - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("course_id", theoreticalCourseChapter.getCourseId()); - int count = baseMapper.selectCount(wrapper); - if (count == 0) { - theoreticalCourseChapter.setSort(1); - } else { - //查询课程章节最大排序数 - count = baseMapper.selectMaxSort(); - theoreticalCourseChapter.setSort(count + 1); - } - int insert = baseMapper.insert(theoreticalCourseChapter); - return insert > 0; - } - - /** - * 删除章节,删除小节及资源 - * - * @param chapterId 章节id - */ - @Override - @Transactional - public boolean removeChapter(Integer chapterId) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("chapter_id", chapterId); - List courseSubsections = theoreticalCourseSubsectionMapper.selectList(wrapper); - - if (courseSubsections != null && courseSubsections.size() != 0) { - //循环删除小节 - courseSubsections.forEach(subsection -> { - //删除资源 - boolean isVideo = VideoUtil.isVideo(subsection.getFileType()); - if (isVideo) { - try { - AliyunOssUtil.removeVideo(subsection.getFileId()); - } catch (ClientException e) { - e.printStackTrace(); - } - } else { - List keys = new ArrayList<>(); - keys.add(subsection.getFileName()); - try { - AliyunOssUtil.removeMoreVideo(keys); - } catch (ClientException e) { - e.printStackTrace(); - } - } - theoreticalCourseSubsectionMapper.deleteById(subsection.getId()); - }); - } - int count = baseMapper.deleteById(chapterId); - return count > 0; - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/TheoreticalCourseClassificationServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/TheoreticalCourseClassificationServiceImpl.java deleted file mode 100644 index 98decb6..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/TheoreticalCourseClassificationServiceImpl.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.huoran.common.constant.PlatformConstant; -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.TheoreticalCourseClassification; -import com.huoran.occupationlab.entity.req.ClassificationPageReq; -import com.huoran.occupationlab.mapper.TheoreticalCourseClassificationMapper; -import com.huoran.occupationlab.service.TheoreticalCourseClassificationService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - *

- * 理论课程分类信息 服务实现类 - *

- * - * @author lr - * @since 2022-09-14 - */ -@Service -public class TheoreticalCourseClassificationServiceImpl extends ServiceImpl implements TheoreticalCourseClassificationService { - - @Override - public R checkRepeat(TheoreticalCourseClassification classification) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("classification_name", classification.getClassificationName()); - queryWrapper.eq("platform_source", classification.getPlatformSource()); - if (classification.getSchoolId() != null) { - queryWrapper.eq("school_id", classification.getSchoolId()); - } - - //id不得空表示编辑校验 - if (classification.getId() != null) { - queryWrapper.last(" and id != " + classification.getId()); - } - - TheoreticalCourseClassification courseClassification = baseMapper.selectOne(queryWrapper); - if (courseClassification != null) { - return R.error("当前分类已存在!"); - } - return R.ok(); - } - - @Override - public R pagingQuery(ClassificationPageReq pageReq) { - - IPage page = new Page(pageReq.getPageNum(), pageReq.getPageSize()); - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("platform_source", pageReq.getPlatformSource()); - - if (pageReq.getSchoolId() != null) { - queryWrapper.eq("school_id", pageReq.getSchoolId()); - } - IPage iPage = baseMapper.selectPage(page, queryWrapper); - return R.ok().put("page", iPage); - } - - @Override - public R queryAllCategoriesOfSchools() { - return R.ok().put("data",baseMapper.queryAllCategoriesOfSchools()); - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/TheoreticalCourseCollectServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/TheoreticalCourseCollectServiceImpl.java deleted file mode 100644 index b16f382..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/TheoreticalCourseCollectServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.huoran.occupationlab.entity.TheoreticalCourseCollect; -import com.huoran.occupationlab.mapper.TheoreticalCourseCollectMapper; -import com.huoran.occupationlab.service.TheoreticalCourseCollectService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -/** - *

- * 理论课程收藏表 服务实现类 - *

- * - * @author lr - * @since 2023-04-18 - */ -@Service -public class TheoreticalCourseCollectServiceImpl extends ServiceImpl implements TheoreticalCourseCollectService { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/TheoreticalCourseConfigureServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/TheoreticalCourseConfigureServiceImpl.java deleted file mode 100644 index 7c60695..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/TheoreticalCourseConfigureServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.huoran.occupationlab.entity.TheoreticalCourseConfigure; -import com.huoran.occupationlab.mapper.TheoreticalCourseConfigureMapper; -import com.huoran.occupationlab.service.TheoreticalCourseConfigureService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -/** - *

- * 理论课程与理论课程分类配置表 服务实现类 - *

- * - * @author lr - * @since 2022-09-14 - */ -@Service -public class TheoreticalCourseConfigureServiceImpl extends ServiceImpl implements TheoreticalCourseConfigureService { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/TheoreticalCourseRangeServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/TheoreticalCourseRangeServiceImpl.java deleted file mode 100644 index e74c26d..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/TheoreticalCourseRangeServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.huoran.occupationlab.entity.TheoreticalCourseRange; -import com.huoran.occupationlab.mapper.TheoreticalCourseRangeMapper; -import com.huoran.occupationlab.service.TheoreticalCourseRangeService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -/** - *

- * 理论课程指定范围选择 服务实现类 - *

- * - * @author lr - * @since 2022-09-19 - */ -@Service -public class TheoreticalCourseRangeServiceImpl extends ServiceImpl implements TheoreticalCourseRangeService { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/TheoreticalCourseServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/TheoreticalCourseServiceImpl.java deleted file mode 100644 index 4b52137..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/TheoreticalCourseServiceImpl.java +++ /dev/null @@ -1,322 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.huoran.api.UserClient; -import com.huoran.common.constant.ClassificationOfTheoreticalCoursesConstant; -import com.huoran.common.constant.PlatformConstant; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.occupationlab.entity.TheoreticalCourse; -import com.huoran.occupationlab.entity.TheoreticalCourseCollect; -import com.huoran.occupationlab.entity.TheoreticalCourseConfigure; -import com.huoran.occupationlab.entity.TheoreticalCourseRange; -import com.huoran.occupationlab.entity.req.AddTheoreticalCourseReq; -import com.huoran.occupationlab.entity.req.PageStudentTheoreticalCourseReq; -import com.huoran.occupationlab.entity.req.PageTheoreticalCourseReq; -import com.huoran.occupationlab.entity.resp.PageTheoreticalCourseByNakadaiResp; -import com.huoran.occupationlab.entity.resp.TheoreticalCourseDetailResp; -import com.huoran.occupationlab.entity.resp.TheoreticalCoursetRangeResp; -import com.huoran.occupationlab.mapper.TheoreticalCourseCollectMapper; -import com.huoran.occupationlab.mapper.TheoreticalCourseConfigureMapper; -import com.huoran.occupationlab.mapper.TheoreticalCourseMapper; -import com.huoran.occupationlab.mapper.TheoreticalCourseRangeMapper; -import com.huoran.occupationlab.service.TheoreticalCourseService; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; -import java.util.stream.Collectors; - -/** - *

- * 理论课程基本信息 服务实现类 - *

- * - * @author lr - * @since 2022-09-14 - */ -@Service -public class TheoreticalCourseServiceImpl extends ServiceImpl implements TheoreticalCourseService { - - @Autowired - private UserClient userClient; - - @Autowired - private TheoreticalCourseConfigureMapper configureMapper; - - @Autowired - private TheoreticalCourseRangeMapper courseRangeMapper; - - @Autowired - private TheoreticalCourseCollectMapper collectMapper; - - @Override - public R addTheoryCourses(AddTheoreticalCourseReq req, HttpServletRequest request) { - TheoreticalCourse theoreticalCourse = new TheoreticalCourse(); - String accountId = TokenUtils.getIdByJwtToken(request); - theoreticalCourse.setFounderId(Integer.valueOf(accountId)); - theoreticalCourse.setSchoolId(0); - //判断平台来源为职站时候才赋值学校id - if (req.getPlatformSource() == PlatformConstant.POST_STATION) { - theoreticalCourse.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - } - BeanUtils.copyProperties(req, theoreticalCourse); - Integer addCoursesInfo = baseMapper.insert(theoreticalCourse); - - if (addCoursesInfo > 0) { - //新增课程基本信息后新增课程分类配置信息 - if (req.getSchoolClassificationsIds().size() > 0) { - for (Integer schoolClassificationsIds : req.getSchoolClassificationsIds()) { - TheoreticalCourseConfigure configure1 = new TheoreticalCourseConfigure(); - configure1.setCourseId(theoreticalCourse.getId()); - configure1.setClassificationId(schoolClassificationsIds); - configure1.setClassificationType(ClassificationOfTheoreticalCoursesConstant.SCHOOL_CLASSIFICATION); - configureMapper.insert(configure1); - } - } - - //学校课程分类 - if (req.getPlatformClassificationIds().size() > 0) { - for (Integer platformClassificationIds : req.getPlatformClassificationIds()) { - TheoreticalCourseConfigure configure2 = new TheoreticalCourseConfigure(); - configure2.setCourseId(theoreticalCourse.getId()); - configure2.setClassificationId(platformClassificationIds); - configure2.setClassificationId(platformClassificationIds); - configure2.setClassificationType(ClassificationOfTheoreticalCoursesConstant.NAKADAI_CLASSIFICATION); - configureMapper.insert(configure2); - } - } - - //判断学校指定范围 - if (req.getVisibleRange() == 2) { - if (req.getCourseRangeList().size() > 0) { - for (TheoreticalCourseRange range : req.getCourseRangeList()) { - range.setCourseId(theoreticalCourse.getId()); - courseRangeMapper.insert(range);//新增记录至指定范围配置表 - } - } - } - - } - - - return R.ok().put("courseId", theoreticalCourse.getId()); - } - - @Override - public R pageConditionalQueryCourse(PageTheoreticalCourseReq pageReq) { - if (pageReq.getPlatformSource() != PlatformConstant.POST_STATION) { - pageReq.setSchoolId(null); - } - Page page = new Page(pageReq.getPageNum(), pageReq.getPageSize()); - IPage pageList = baseMapper.pageConditionalQueryCourseByNakadai(page, pageReq); - return R.ok().put("page", pageList); - } - - /** - * 编辑理论课程 - * - * @param req - * @param request - * @return - */ - @Override - public R modifyTheoryCourses(AddTheoreticalCourseReq req, HttpServletRequest request) { - - - TheoreticalCourse courseInfo = baseMapper.selectById(req.getCourseId()); - - //查询课程指定范围配置表是否有该课程信息 - List courseRangeList = courseRangeMapper.getCourseRangeByCourseId(req.getCourseId()); - List idList = courseRangeList.stream().map(TheoreticalCourseRange::getId).collect(Collectors.toList()); - //中 台 权 限 :能选择发布全平台、指定院校 - //职站教师端权限:能选择发布全平台、本校 - if (req.getVisibleRange() != null) { - switch (req.getPlatformSource()) {//平台来源(0中台,1职站) - case 0: - //理论课程范围:(1:全平台 2.指定区域、院校) - if (req.getVisibleRange() == ClassificationOfTheoreticalCoursesConstant.ALL_PLATFORMS) {//全平台 - - if (courseRangeList.size() > 0) { - //删除原有指定范围配置表中的信息 - courseRangeMapper.deleteBatchIds(idList); - } - - } else if (req.getVisibleRange() == ClassificationOfTheoreticalCoursesConstant.SPECIFIED_RANGE) {//指定区域、院校 - //增加指定范围配置表的信息 - if (req.getCourseRangeList().size() > 0) { - for (TheoreticalCourseRange addCourseRange : req.getCourseRangeList()) { - addCourseRange.setCourseId(req.getCourseId()); - courseRangeMapper.insert(addCourseRange); - } - - } - } - break; - } - } - - BeanUtils.copyProperties(req, courseInfo); - courseInfo.setId(req.getCourseId()); - String accountId = TokenUtils.getIdByJwtToken(request); - courseInfo.setFounderId(Integer.valueOf(accountId)); - //判断平台来源为职站时候才赋值学校id - if (req.getPlatformSource() == PlatformConstant.POST_STATION) { - courseInfo.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - } - - Integer addCoursesInfo = baseMapper.updateById(courseInfo); - - - //处理课程分类、平台课程分类 - if (req.getPlatformClassificationIds() != null) { - if (req.getPlatformClassificationIds().size() > 0) { - //删除当前课程分类配置表 分类类型为平台的 - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("course_id", courseInfo.getId()); - queryWrapper.eq("classification_type", 0).select("config_id"); - //List list1 = configureMapper.selectList(queryWrapper); - configureMapper.delete(queryWrapper); - for (Integer platformClassificationIds : req.getPlatformClassificationIds()) { - TheoreticalCourseConfigure addPlatformClassification = new TheoreticalCourseConfigure(); - addPlatformClassification.setClassificationType(0); - addPlatformClassification.setCourseId(courseInfo.getId()); - addPlatformClassification.setClassificationId(platformClassificationIds); - configureMapper.insert(addPlatformClassification); - } - } - } - - if (req.getSchoolClassificationsIds() != null) { - if (req.getSchoolClassificationsIds().size() > 0) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("course_id", courseInfo.getId()); - //删除当前课程分类配置表 分类类型为学校的 - queryWrapper.eq("classification_type", 1).select("config_id"); - //List list2 = configureMapper.selectList(queryWrapper); - configureMapper.delete(queryWrapper); - - for (Integer schoolClassificationsId : req.getSchoolClassificationsIds()) { - TheoreticalCourseConfigure addSchoolClassifications = new TheoreticalCourseConfigure(); - addSchoolClassifications.setClassificationType(1); - addSchoolClassifications.setCourseId(courseInfo.getId()); - addSchoolClassifications.setClassificationId(schoolClassificationsId); - configureMapper.insert(addSchoolClassifications); - } - - } - } - - - return addCoursesInfo > 0 ? R.ok() : R.error(); - } - - @Override - public R theoryCoursesDetail(Integer id) { - TheoreticalCourseDetailResp detailResp = baseMapper.theoryCoursesDetail(id); - - //判断当前课程可见范围为指定范围查询范围配置表 - /* if (detailResp.getVisibleRange() == ClassificationOfTheoreticalCoursesConstant.SPECIFIED_RANGE) { - - }*/ - //查询指定院校信息 - List rangeRespList = courseRangeMapper.getRangeByCourseId(id); - if (rangeRespList.size() > 0) { - detailResp.setCourseRangeList(rangeRespList); - } - - - //查询课程分类信息 分类类型(0:中台分类 1:学校分类) - - List platformClassification = configureMapper.getConfigInfoByCourseId(id, 0); - if (platformClassification.size() > 0) { - detailResp.setPlatformClassificationList(platformClassification); - } - - List schoolClassification = configureMapper.getConfigInfoByCourseId(id, 1); - if (schoolClassification.size() > 0) { - detailResp.setSchoolClassificationsList(schoolClassification); - } - - - return R.ok().put("data", detailResp); - } - - @Override - public R pageConditionalQueryCourseByStudent(PageStudentTheoreticalCourseReq pageReq) { - Page page = new Page(pageReq.getPageNum(), pageReq.getPageSize()); - IPage pageList = null; - //来源(0.共享课堂 1.本校课程 2.收藏的课程) - switch (pageReq.getCourseSource()) { - case 0: - pageList = baseMapper.pageConditionalQueryCourseByStudent(page, pageReq); - break; - case 1: - pageList = baseMapper.theoreticalCoursesOfTheSchool(page, pageReq); - break; - case 2: - pageList = baseMapper.theCurrentUserFavoriteCourse(page, pageReq); - break; - } - - - for (PageTheoreticalCourseByNakadaiResp resp : pageList.getRecords()) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("account_id", pageReq.getAccountId()); - queryWrapper.eq("course_id", resp.getId()); - TheoreticalCourseCollect courseCollect = collectMapper.selectOne(queryWrapper); - - //是否收藏:(state = 1收藏,0取消收藏) - if (courseCollect != null) { - //收藏过 - resp.setCollectionStatus(1); - } else { - resp.setCollectionStatus(0); - } - } - return R.ok().put("page", pageList); - } - - @Override - public R studentLoginPreCourse(PageTheoreticalCourseReq pageReq) { - Page page = new Page(pageReq.getPageNum(), pageReq.getPageSize()); - IPage pageList = baseMapper.studentLoginPreCourse(page, pageReq); - - //浏览量作假数据处理:低于50以下的全部给予随机数 500-1000区间 - for (PageTheoreticalCourseByNakadaiResp object : pageList.getRecords()) { - if (object.getPageviews() <= 50) { - int r = (int) (500 + Math.random() * (1000 - 500 + 1)); - object.setPageviews(r); - } - } - - return R.ok().put("page", pageList); - } - - - @Override - public R checkRepeat(TheoreticalCourse theoreticalCourse) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("course_name", theoreticalCourse.getCourseName()); - queryWrapper.eq("platform_source", theoreticalCourse.getPlatformSource()); - if (theoreticalCourse.getSchoolId() != null) { - queryWrapper.eq("school_id", theoreticalCourse.getSchoolId()); - } - - //id不得空表示编辑校验 - if (theoreticalCourse.getId() != null) { - queryWrapper.last(" and id != " + theoreticalCourse.getId()); - } - - TheoreticalCourse course = baseMapper.selectOne(queryWrapper); - if (course != null) { - return R.error("当前课程名已存在!"); - } - return R.ok(); - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/TheoreticalCourseSubsectionServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/TheoreticalCourseSubsectionServiceImpl.java deleted file mode 100644 index 8c7ddff..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/TheoreticalCourseSubsectionServiceImpl.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.aliyuncs.exceptions.ClientException; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.huoran.common.utils.AliyunOssUtil; -import com.huoran.common.utils.VideoUtil; -import com.huoran.occupationlab.entity.TheoreticalCourseSubsection; -import com.huoran.occupationlab.mapper.TheoreticalCourseSubsectionMapper; -import com.huoran.occupationlab.service.TheoreticalCourseSubsectionService; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.ArrayList; -import java.util.List; - -/** - *

- * 课程小节 服务实现类 - *

- * - * @author lr - * @since 2022-09-22 - */ -@Service -public class TheoreticalCourseSubsectionServiceImpl extends ServiceImpl implements TheoreticalCourseSubsectionService { - - @Override - public boolean repeat(TheoreticalCourseSubsection theoreticalCourseSubsection) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("chapter_id", theoreticalCourseSubsection.getChapterId()); - wrapper.eq("course_id", theoreticalCourseSubsection.getCourseId()); - wrapper.eq("name", theoreticalCourseSubsection.getName()); - Integer count = baseMapper.selectCount(wrapper); - return count > 0; - } - - @Override - public boolean saveSubsection(TheoreticalCourseSubsection theoreticalCourseSubsection) { - //查询章节小节的总数 - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("chapter_id", theoreticalCourseSubsection.getChapterId()); - int count = baseMapper.selectCount(wrapper); - if (count == 0) { - theoreticalCourseSubsection.setSort(1); - } else { - //查询章节小节最大排序数 - count = baseMapper.selectMaxSort(); - theoreticalCourseSubsection.setSort(count + 1); - } - int insert = baseMapper.insert(theoreticalCourseSubsection); - return insert > 0; - } - - /** - * 删除小节及资源 - * - * @param subsectionId 小节id - */ - @Transactional - @Override - public boolean removeSubsection(Integer subsectionId) throws ClientException { - TheoreticalCourseSubsection theoreticalCourseSubsection = baseMapper.selectById(subsectionId); - String fileType = theoreticalCourseSubsection.getFileType(); - //删除资源 - boolean isVideo = VideoUtil.isVideo(fileType); - if (isVideo) { - if (theoreticalCourseSubsection.getFileId()!=null){ -// AliyunOssUtil.removeVideo(theoreticalCourseSubsection.getFileId()); - System.out.println("无法删除"); - } - } else { - List keys = new ArrayList<>(); - keys.add(theoreticalCourseSubsection.getFileName()); - AliyunOssUtil.deleteFiles(keys); - } - //删除小节 - int count = baseMapper.deleteById(subsectionId); - return count > 0; - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/UserInfoServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/UserInfoServiceImpl.java deleted file mode 100644 index 6f661a0..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/UserInfoServiceImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.huoran.occupationlab.entity.HrUserInfo; -import com.huoran.occupationlab.mapper.UserInfoMapper; -import com.huoran.occupationlab.service.UserInfoService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.HashMap; - -/** - *

- * 用户信息表 服务实现类 - *

- * - * @author Ning - * @since 2020-10-21 - */ -@Service -public class UserInfoServiceImpl extends ServiceImpl implements UserInfoService { - @Autowired - private UserInfoMapper userInfoMapper; - - @Override - public HrUserInfo getUserInfo(Integer userId) { - return baseMapper.selectById(userId); - } - - public HrUserInfo login(HashMap map) { - return baseMapper.login(map); - } - - @Override - public boolean updateTime(Integer userId) { - int size = baseMapper.updateTime(userId); - return size > 0; - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/UserManagementServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/UserManagementServiceImpl.java deleted file mode 100644 index 7b3f99f..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/UserManagementServiceImpl.java +++ /dev/null @@ -1,265 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.TypeReference; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.huoran.common.response.R; -import com.huoran.occupationlab.entity.ClientManagement; -import com.huoran.occupationlab.entity.HrUserInfo; -import com.huoran.occupationlab.entity.UserManagement; -import com.huoran.occupationlab.entity.vo.UserInfo; -import com.huoran.occupationlab.entity.vo.UserManagementImportFailureVo; -import com.huoran.occupationlab.entity.vo.UserVO; -import com.huoran.occupationlab.mapper.UserManagementMapper; -import com.huoran.occupationlab.service.ClientManagementService; -import com.huoran.occupationlab.service.UserInfoService; -import com.huoran.occupationlab.service.UserManagementService; -import com.huoran.occupationlab.utils.ExcelImportHelper; -import com.huoran.occupationlab.utils.poi.CommonCode; -import com.huoran.occupationlab.utils.poi.ExcelExportUtil; -import com.huoran.occupationlab.utils.poi.ExceptionCast; -import org.apache.commons.lang.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.core.io.ClassPathResource; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.data.redis.core.ValueOperations; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.InputStream; -import java.text.SimpleDateFormat; -import java.util.*; -import java.util.concurrent.TimeUnit; - -/** - *

- * 企业端用户管理 服务实现类 - *

- * - * @author Ning - * @since 2020-10-27 - */ -@Service -public class UserManagementServiceImpl extends ServiceImpl implements UserManagementService { - - @Autowired - private UserInfoService userInfoService; - @Autowired - private ClientManagementService clientManagementService; - @Autowired - private UserManagementService userManagementService; - @Resource - StringRedisTemplate stringRedisTemplate; - - //查询用户列表 - @Override - public List queryList(HashMap map) { -// Object searchContent = map.get("searchContent"); -// QueryWrapper wrapper = new QueryWrapper<>(); -// if (searchContent!=null){ -// wrapper.like("name",searchContent).or().like("client_name",searchContent).or().like("account",searchContent); -// } - return baseMapper.queryList(map); - } - - //查询用户列表数量 - @Override - public int queryListCount(HashMap map) { - return baseMapper.queryListCount(map); - } - - //添加用户 - @Override - @Transactional - public boolean addUser(UserVO vo) { - UserInfo userInfo = vo.getUserInfo(); - UserManagement userManagement = vo.getUserManagement(); - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式 - userManagement.setLastLoginTime(df.format(new Date())); - if (userInfo != null && userManagement != null) { - userInfo.setPassword("1122aa"); - baseMapper.addUserInfo(userInfo); - Integer userId = userInfo.getUserId(); - userManagement.setUserId(userId); - int size = baseMapper.insert(userManagement); - return size > 0; - } else { - throw new RuntimeException(); - } - } - - //批量删除用户 - @Override - public boolean deleteUser(List userIds) { - int num = userIds.size(); - for (int i = 0; i < num; i++) { - Integer id = userIds.get(i); - Integer userId = baseMapper.selectUserId(id); - int del = baseMapper.deleteUser(userId); - } - int size = baseMapper.deleteBatchIds(userIds); - return size > 0; - } - - //修改用户 - @Override - @Transactional - public boolean updateUser(UserVO vo) { - UserManagement userManagement = vo.getUserManagement(); - //UserInfo userInfo = vo.getUserInfo(); - boolean ret = userManagementService.updateUser(vo); - int size = baseMapper.updateById(userManagement); - if (size > 0) { - return size > 0; - } else { - throw new RuntimeException("数据有误,修改失败!"); - } - } - - @Override - @Transactional - public Map upload(MultipartFile file) throws IOException { - List users = ExcelImportHelper.readUserManagement(file); - List failVo1 = new ArrayList<>(); - // 参数合法性校验,只能上传.xlsx后缀的文件 - if (StringUtils.isBlank(file.getOriginalFilename()) - || !file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")).equals(".xlsx")) { - ExceptionCast.cast(CommonCode.EXCEL_FILE_INVALID); - } - int size = users.size(); - Map map = new HashMap<>(); - Long ii = 1L;//用于记录序列号 - try { - for (int i = 0; i < users.size(); i++) { - UserManagement userManagement = users.get(i); - String name = userManagement.getName(); - String clientName = userManagement.getClientName(); - String account = userManagement.getAccount(); - userManagement = new UserManagement(); - UserInfo userInfo = new UserInfo(); - if (account != null && account != "") { - // R userInfos = userManagementService.getAccount(account); - - - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("account", account).eq("isdel", 0); - HrUserInfo userInfos = userInfoService.getOne(wrapper); - - if (userInfos != null) { - UserManagementImportFailureVo vo = new UserManagementImportFailureVo(); - ++ii; - vo.setIndex(ii).setName(name).setClientName(clientName) - .setAccount(account + "(重复的账号!)").setFailureMsg("重复的账号!"); - failVo1.add(vo); - users.remove(i); - i--; - continue; - } else { - userManagement.setAccount(account); - userInfo.setAccount(account); - } - } - if (clientName != null && clientName != "") { - int clientNameSize = clientManagementService.queryClientNameSize(clientName); - if (clientNameSize < 1) { - UserManagementImportFailureVo vo = new UserManagementImportFailureVo(); - ++ii; - vo.setIndex(ii).setName(name).setClientName(clientName + "(客户名称不存在!)") - .setAccount(account).setFailureMsg("客户名称不存在!"); - failVo1.add(vo); - users.remove(i); - i--; - continue; - } else { - userManagement.setClientName(clientName); - } - } - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("client_name", clientName); - ClientManagement clientManagement = clientManagementService.getOne(wrapper); - if (clientManagement != null) { - Integer clientId = clientManagement.getId(); - if (clientId != null) { - userInfo.setClientId(clientId); - userInfo.setClientName(clientName); - userInfo.setUserName(name); - userInfo.setPassword("1122aa"); - userInfo.setRoleId("1"); - userInfo.setIsPort(2); - SimpleDateFormat da = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式 - String date = da.format(new Date());// new Date()为获取当前系统时间,也可使用当前时间戳 - long time = new Date().getTime(); - userInfo.setUniqueIdentificationAccount(time + ""); - userInfo.setCreationTime(date); - boolean user = baseMapper.addUserInfo(userInfo); - Integer userId = userInfo.getUserId(); - if (user) { - userManagement.setName(name); - userManagement.setClientId(clientId); - userManagement.setRoleId(1); - userManagement.setUserId(userId); - boolean userBoolean = userManagementService.save(userManagement); - if (!userBoolean) { - throw new RuntimeException("添加用户失败!"); - } - } else { - throw new RuntimeException("添加用户失败!"); - } - } - } else { - map.put("failura", "没有该客户,添加失败!"); - throw new RuntimeException(); - } - } - } catch (RuntimeException e) { - map.put("failura", "数据有误,添加失败!"); - throw new RuntimeException(e + "数据有误!"); - } - String token = ""; - - // 有导入失败的数据,才会存入redis - if (failVo1.size() > 0) { - //生成token - token = "FAILURE_IMPORT" + UUID.randomUUID().toString().replace("-", ""); - - ValueOperations ops = stringRedisTemplate.opsForValue(); - String failureVOJson = JSON.toJSONString(failVo1); - ops.set(token, failureVOJson, 30 * 60, TimeUnit.SECONDS); - } - map.put("token", token); - map.put("successNum", (size - failVo1.size()) + ""); - map.put("failureNum", failVo1.size() + ""); - return map; - } - - @Override - public void exportFailureRecord(HttpServletResponse response, String token) throws Exception { - if (StringUtils.isEmpty(token)) { - return; - } - ValueOperations ops = stringRedisTemplate.opsForValue(); - //获取数据 - String record = ops.get(token); - if (StringUtils.isEmpty(record)) { - return; - } - List parse = JSON.parseObject(record, new TypeReference>() { - }); - - parse.sort(Comparator.comparing(UserManagementImportFailureVo::getIndex)); - - //2.加载模板流数据 - org.springframework.core.io.Resource resource = new ClassPathResource("excel-template/用户管理导入失败数据导出模板.xlsx"); - InputStream inputStream = resource.getInputStream(); - - //3、通过工具类下载文件 - new ExcelExportUtil(UserManagementImportFailureVo.class, 2, 1). - export(response, inputStream, parse, "用户管理信息导入失败表.xlsx"); - - } -} \ No newline at end of file diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/UserRoleServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/UserRoleServiceImpl.java deleted file mode 100644 index 451950c..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/UserRoleServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.huoran.occupationlab.entity.AclUserRole; -import com.huoran.occupationlab.mapper.UserRoleMapper; -import com.huoran.occupationlab.service.UserRoleService; -import org.springframework.stereotype.Service; - -/** - *

- * 服务实现类 - *

- * - * @author testjava - * @since 2020-01-12 - */ -@Service -public class UserRoleServiceImpl extends ServiceImpl implements UserRoleService { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/UserScoreServiceImpl.java b/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/UserScoreServiceImpl.java deleted file mode 100644 index 7ce7325..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/service/impl/UserScoreServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.huoran.occupationlab.service.impl; - -import com.huoran.occupationlab.entity.UserScore; -import com.huoran.occupationlab.mapper.UserScoreMapper; -import com.huoran.occupationlab.service.UserScoreService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -/** - *

- * 用户分数表 服务实现类 - *

- * - * @author Mr.JK - * @since 2021-09-14 - */ -@Service -public class UserScoreServiceImpl extends ServiceImpl implements UserScoreService { - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/utils/CollectionUtil.java b/occupationlab/src/main/java/com/huoran/occupationlab/utils/CollectionUtil.java deleted file mode 100644 index d252e87..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/utils/CollectionUtil.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.huoran.occupationlab.utils; - -import java.util.*; - -/** - * @Author chen - * @DATE 2022/4/1 11:36 - * @Version 1.0 - * 该类提供对集合类的高效操作 - */ -public class CollectionUtil { - /** - * 不允许实例化 - */ - private CollectionUtil() { - } - - /** - * 获取两个集合的不同元素 - * @param collmax - * @param collmin - * @return - */ - @SuppressWarnings({ "rawtypes", "unchecked" }) - public static Collection getDifferent(Collection collmax, Collection collmin) - { - //使用LinkedList防止差异过大时,元素拷贝 - Collection csReturn = new LinkedList(); - Collection max = collmax; - Collection min = collmin; - //先比较大小,这样会减少后续map的if判断次数 - if(collmax.size() map = new HashMap(max.size()); - for (Object object : max) { - map.put(object, 1); - } - for (Object object : min) { - if(map.get(object)==null) - { - csReturn.add(object); - }else{ - map.put(object, 2); - } - } - for (Map.Entry entry : map.entrySet()) { - if(entry.getValue()==1) - { - csReturn.add(entry.getKey()); - } - } - return csReturn; - } - /** - * 获取两个集合的不同元素,去除重复 - * @param collMax - * @param collMin - * @return - */ - @SuppressWarnings({ "rawtypes", "unchecked" }) - public static Collection getDifferentNoDuplicate (Collection collMax,Collection collMin) - { - return new HashSet(getDifferent(collMax, collMin)); - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/utils/Constant.java b/occupationlab/src/main/java/com/huoran/occupationlab/utils/Constant.java deleted file mode 100644 index 3b7c676..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/utils/Constant.java +++ /dev/null @@ -1,339 +0,0 @@ -/** - * Copyright (c) 2016-2019 人人开源 All rights reserved. - *

- * https://www.renren.io - *

- * 版权所有,侵权必究! - */ - -package com.huoran.occupationlab.utils; - -/** - * 常量 - * - * @author Rong - */ -public class Constant { - - /** - * 测评是否通过 1、通过/0、未通过 - */ - public static final String EVALUATIONN_PASSED = "通过"; - public static final String EVALUATIONN_NOT_PASSED = "未通过"; - - /** - * 及格分数 - */ - public static final int PASSING_SCORE = 60; - - /** - * 当前题目答案是否正确 1、正确/0、错误 - */ - public enum QuestionIsTure { - - TRUE(1, "正确"), - FALSE(0, "错误"); - - private Integer type; - private String desc; - - QuestionIsTure(Integer type, String desc) { - this.type = type; - this.desc = desc; - } - - public Integer getType() { - return type; - } - - public void setType(Integer type) { - this.type = type; - } - - public String getDesc() { - return desc; - } - - public void setDesc(String desc) { - this.desc = desc; - } - } - - /** - * 试题类型 - */ - public enum QuestionType { - /** - * 单选题 - */ - SINGLE_CHOICE("1", "单选题"), - /** - * 多选题 - */ - MULTIPLE_CHOICE("2", "多选题"), - /** - * 判断题 - */ - TRUE_OR_FALSE("3", "判断题"); - - private String type; //类型 - private String desc; //描述 - - QuestionType(String type, String desc) { - this.type = type; - this.desc = desc; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getDesc() { - return desc; - } - - public void setDesc(String desc) { - this.desc = desc; - } - - } - - /** - * 项目是否提交1:已提交/0:未提交 - */ - public enum Submit { - - SUBMIT(1, "已提交"), - NOT_SUBMIT(0, "未提交"); - - - private Integer type; - private String desc; - - Submit(Integer type, String desc) { - this.type = type; - this.desc = desc; - } - - public Integer getType() { - return type; - } - - public void setType(Integer type) { - this.type = type; - } - - public String getDesc() { - return desc; - } - - public void setDesc(String desc) { - this.desc = desc; - } - } - - /** - * 是否删除:0使用,1删除,默认0使用 - */ - public enum IsDel { - /** - * 删除 - */ - DEL(1, "已删除"), - /** - * 不删除 - */ - NOT_DEL(0, "不删除"); - - private Integer type; //类型 - private String desc; //描述 - - IsDel(Integer type, String desc) { - this.type = type; - this.desc = desc; - } - - public Integer getType() { - return type; - } - - public void setType(Integer type) { - this.type = type; - } - - public String getDesc() { - return desc; - } - - public void setDesc(String desc) { - this.desc = desc; - } - } - - - /** - * 是否启用 - */ - public enum IsEnable { - /** - * 启用 - */ - ENABLE(1, "启用"), - /** - * 不启用 - */ - NOT_ENABLE(0, "不启用"); - - private Integer type; //类型 - private String desc; //描述 - - IsEnable(Integer type, String desc) { - this.type = type; - this.desc = desc; - } - - public Integer getType() { - return type; - } - - public void setType(Integer type) { - this.type = type; - } - - public String getDesc() { - return desc; - } - - public void setDesc(String desc) { - this.desc = desc; - } - } - - /** - * 评测规则类型 - */ - public enum RulesType { - /** - * 随机 - */ - RANDOM(1, "随机"), - /** - * 自定义 - */ - CUSTOMIZE(0, "自定义"); - - private Integer type; //类型 - private String desc; //描述 - - RulesType(Integer type, String desc) { - this.type = type; - this.desc = desc; - } - - public Integer getType() { - return type; - } - - public void setType(Integer type) { - this.type = type; - } - - public String getDesc() { - return desc; - } - - public void setDesc(String desc) { - this.desc = desc; - } - } - - - /** - * 当前题目状态 1、已作/0、未作 - */ - public enum QuestionStatus { - - MADE(1, "已作"), - NOT_MADE(0, "未作"); - - private Integer type; - private String desc; - - QuestionStatus(Integer type, String desc) { - this.type = type; - this.desc = desc; - } - - public Integer getType() { - return type; - } - - public void setType(Integer type) { - this.type = type; - } - - public String getDesc() { - return desc; - } - - public void setDesc(String desc) { - this.desc = desc; - } - } - - /** - * 试题选项A - */ - public static final String A = "A"; - /** - * 试题选项B - */ - public static final String B = "B"; - /** - * 试题选项C - */ - public static final String C = "C"; - /** - * 试题选项D - */ - public static final String D = "D"; - /** - * 试题选项E - */ - public static final String E = "E"; - /** - * 试题选项F - */ - public static final String F = "F"; - - /** - * 通过excel批量导入试题数据时起始行 - */ - public static final int CELL_INDEX = 0; - /** - * 需要提取的样式所在的行号 - */ - public static final int STYLE_INDEX = 2; - - - /** - * 通过excel批量导入试题数据时起始行(专门用于练习,考核报告的) - */ - public static final int ROW_INDEX_REPORT = 3; - - - /** - * 通过excel批量导入试题数据时起始行 - */ - public static final int ROW_INDEX = 2; - - - /** - * 测评规则表id - */ - public static final int EVALUATION_RULES_ID = 1; -} \ No newline at end of file diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/utils/CronUtils.java b/occupationlab/src/main/java/com/huoran/occupationlab/utils/CronUtils.java deleted file mode 100644 index 59d6733..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/utils/CronUtils.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.huoran.occupationlab.utils; - -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.Objects; - -public class CronUtils { - private static final SimpleDateFormat sdf = new SimpleDateFormat("ss mm HH dd MM ? yyyy"); - - /*** - * 功能描述:日期转换cron表达式 - * @param date - * @return - */ - public static String formatDateByPattern(Date date) { - String formatTimeStr = null; - if (Objects.nonNull(date)) { - formatTimeStr = sdf.format(date); - } - return formatTimeStr; - } - - /*** - * convert Date to cron, eg "0 07 10 15 1 ? 2016" - * @param date : 时间点 - * @return - */ - public static String getCron(Date date) { - return formatDateByPattern(date); - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/utils/DelTagsUtil.java b/occupationlab/src/main/java/com/huoran/occupationlab/utils/DelTagsUtil.java deleted file mode 100644 index b273c33..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/utils/DelTagsUtil.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.huoran.occupationlab.utils; - -/** - * @描述: - * @作者: Rong - * @日期: 2022/3/24 16:36 - */ -public class DelTagsUtil { - /** - * 去除html代码中含有的标签 - * - * @param htmlStr - * @return - */ - public static String delHtmlTags(String htmlStr) { - //定义script的正则表达式,去除js可以防止注入 - String scriptRegex = "]*?>[\\s\\S]*?<\\/script>"; - //定义style的正则表达式,去除style样式,防止css代码过多时只截取到css样式代码 - String styleRegex = "]*?>[\\s\\S]*?<\\/style>"; - //定义HTML标签的正则表达式,去除标签,只提取文字内容 - String htmlRegex = "<[^>]+>"; - //定义空格,回车,换行符,制表符 - String spaceRegex = "\\s*|\t|\r|\n"; - - // 过滤script标签 - htmlStr = htmlStr.replaceAll(scriptRegex, ""); - // 过滤style标签 - htmlStr = htmlStr.replaceAll(styleRegex, ""); - // 过滤html标签 - htmlStr = htmlStr.replaceAll(htmlRegex, ""); - // 过滤空格等 - htmlStr = htmlStr.replaceAll(spaceRegex, ""); - return htmlStr.trim(); // 返回文本字符串 - } - - /** - * 获取HTML代码里的内容 - * - * @param htmlStr - * @return - */ - public static String getTextFromHtml(String htmlStr) { - //去除html标签 - htmlStr = delHtmlTags(htmlStr); - //去除空格" " - htmlStr = htmlStr.replaceAll(" ", ""); - return htmlStr; - } - - public static void main(String[] args) { - String htmlStr = "import requests\nimport json\n\ndef get_sogou_img():\n    category = '卡通'\n    length = 5\n    imgs = requests.get(\n        'https://pic.sogou.com/pics/channel/getAllRecomPicByTag.jsp?category=%E5%A3%81%E7%BA%B8&tag=' + category + '&start=0&len=' + str(\n            length) + '&width=1920&height=1080')\n    jd = json.loads(imgs.text)\n    jd = jd['all_items']\n    imgs_url = []\n    for j in jd:\n        imgs_url.append(j['pic_url'])\n    print(imgs_url)\n1111111111111111111111111111\n\n\n\n\nif __name__ == \"__main__\":\n    get_sogou_img()\n" - ; - System.out.println(getTextFromHtml(htmlStr)); - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/utils/EXCELUtil.java b/occupationlab/src/main/java/com/huoran/occupationlab/utils/EXCELUtil.java deleted file mode 100644 index 548b39c..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/utils/EXCELUtil.java +++ /dev/null @@ -1,181 +0,0 @@ -package com.huoran.occupationlab.utils; - -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLConnection; -import java.util.ArrayList; -import java.util.List; - -import com.alibaba.fastjson.JSONException; -import com.alibaba.fastjson.JSONObject; -import org.apache.poi.hssf.usermodel.HSSFRichTextString; -import org.apache.poi.hssf.usermodel.HSSFWorkbook; -import org.apache.poi.ss.usermodel.*; -import org.apache.poi.ss.usermodel.DateUtil; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import org.springframework.util.StringUtils; - -/** - * altered by Evan on 2019-3-4 - */ -public class EXCELUtil { - - public static void main(String[] args) throws IOException { - System.out.println("导出数据为:" + readFile("https://huoran.oss-cn-shenzhen.aliyuncs.com/20220408/xls/1512317574577676288.xls")); - } - - /** - * 将EXCEL数据封装成JSON列表 - * - * @param filePath 文件路径 - * @return - * @throws JSONException - */ - public static List readFile(String filePath) throws JSONException { - // 校验文件路径是否为空 - if (StringUtils.isEmpty(filePath)) return null; - - Workbook wb; - Sheet sheet; - Row row; - String cellData; - - // 读取Excel - wb = readExcel(filePath); - // 用来存放每一行数据的列表 - List jsonObjectList = new ArrayList<>(); - - if (wb != null) { - //获取第一个sheet - sheet = wb.getSheetAt(0); - //获取最大行数 - int rowNum = sheet.getPhysicalNumberOfRows(); - //获取第一行(通常第一行为列名) - row = sheet.getRow(0); - //获取最大列数 - int colNum = row.getPhysicalNumberOfCells(); - //用来存放列名 - List columnNameList = new ArrayList<>(); - //循环列,将列名取出放入List - for (int i = 0; i < colNum; i++) { - - if (row.getCell(i) == null) { - row.createCell(i).setCellValue(new HSSFRichTextString(String.valueOf(row.getCell(i).getStringCellValue()))); - } else { - // 获取列的值,放入列名列表内 - String columnName = row.getCell(i).getStringCellValue(); - columnNameList.add(columnName); - } - - } - - //循环行,从第二行开始取行数据(因为第一行为列名) - for (int i = 1; i < rowNum; i++) { - row = sheet.getRow(i); - if (row != null) { - List dataList = new ArrayList<>(); - //循环列,将行数据取出放入List - for (int j = 0; j < colNum; j++) { - cellData = (String) getCellFormatValue(row.getCell(j)); - dataList.add(cellData); - } - // 创建行数据JSON对象 - JSONObject jsonData = new JSONObject(); - for (int k = 0; k < dataList.size(); k++) { - // 按照 列名:行数据 的格式存放 - jsonData.put(columnNameList.get(k), dataList.get(k)); - } - jsonObjectList.add(jsonData); - } else { - break; - } - } - } - return jsonObjectList; - } - - /** - * 读取EXCEL - * - * @param filePath - * @return - */ - public static Workbook readExcel(String filePath) { - if (filePath == null) return null; - // 我是从阿里云里面读取,如果是本地路径请改成FileInputStream - URL httpUrl; - InputStream is = null; - try { - httpUrl = new URL(filePath); - URLConnection urlConnection = httpUrl.openConnection(); - is = urlConnection.getInputStream(); - } catch (MalformedURLException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } - - Workbook wb = null; - - String extString = filePath.substring(filePath.lastIndexOf(".")); - try { - if (".xls".equals(extString)) { - wb = new HSSFWorkbook(is); - } else if (".xlsx".equals(extString)) { - wb = new XSSFWorkbook(is); - } else { - wb = null; - } - } catch (FileNotFoundException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } - return wb; - } - - /** - * 从row中取出数据 - * - * @param cell - * @return - */ - public static Object getCellFormatValue(Cell cell) { - Object cellValue; - if (cell != null) { - //判断cell类型 - switch (cell.getCellType()) { - case NUMERIC: { - cellValue = String.valueOf(cell.getNumericCellValue()); - break; - } - case FORMULA: { - //判断cell是否为日期格式 - if (DateUtil.isCellDateFormatted(cell)) { - //转换为日期格式YYYY-mm-dd - cellValue = cell.getDateCellValue(); - } else { - //数字 - cellValue = String.valueOf(cell.getNumericCellValue()); - } - break; - } - case STRING: { - cellValue = cell.getRichStringCellValue().getString(); - break; - } - default: - cellValue = String.valueOf(cell.getRichStringCellValue()); - break; - } - } else { - cellValue = ""; - } - return cellValue; - } - -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/utils/EasyExcelUtil.java b/occupationlab/src/main/java/com/huoran/occupationlab/utils/EasyExcelUtil.java deleted file mode 100644 index fa31be2..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/utils/EasyExcelUtil.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.huoran.occupationlab.utils; - -import com.alibaba.excel.EasyExcel; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; - -/** - * @Author chen - * @DATE 2020/10/19 14:45 - * @Version 1.0 - */ -public class EasyExcelUtil { - public static void download(HttpServletResponse response, Class head, List list) throws IOException { - response.setContentType("application/vnd.ms-excel"); - response.setCharacterEncoding("utf-8"); - response.setHeader("Content-disposition", "attachment;filename=applican.xlsx"); - EasyExcel.write(response.getOutputStream(), head).sheet("人员列表").doWrite(list); - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/utils/ExcelImportHelper.java b/occupationlab/src/main/java/com/huoran/occupationlab/utils/ExcelImportHelper.java deleted file mode 100644 index 4ab3eee..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/utils/ExcelImportHelper.java +++ /dev/null @@ -1,618 +0,0 @@ -package com.huoran.occupationlab.utils; - -import com.huoran.common.exception.CustomException; -import com.huoran.common.exception.ExceptionEnum; -import com.huoran.occupationlab.entity.ImportStaff; -import com.huoran.occupationlab.entity.ImportStudent; -import com.huoran.occupationlab.entity.UserManagement; -import com.huoran.occupationlab.entity.req.ExcelImpQuestionReq; -import com.huoran.occupationlab.entity.req.ExcelImpStaffReq; -import com.huoran.occupationlab.entity.req.ExcelImpStudentReq; -import org.apache.commons.lang.StringUtils; -import org.apache.poi.hssf.usermodel.HSSFWorkbook; -import org.apache.poi.ss.usermodel.*; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import org.springframework.web.multipart.MultipartFile; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -public class ExcelImportHelper { - /** - * 读取学生管理 - * - * @param file - * @return - */ - public static List readStudentManagement(MultipartFile file) { - List list = new ArrayList(); - - Workbook workbook = getWorkbook(file); - ImportStudent importStudent = null; - // 循环工作表Sheet - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - Sheet hssfSheet = workbook.getSheetAt(numSheet); - if (hssfSheet == null) { - continue; - } - Cell phone; - Cell email; - // 循环行Row//开始行2 - for (int rowNum = 2; rowNum <= hssfSheet.getLastRowNum(); rowNum++) { - Row row = hssfSheet.getRow(rowNum); - if (row != null) { - importStudent = new ImportStudent(); - row.getCell(0).setCellType(CellType.STRING); - Cell account = row.getCell(0); - row.getCell(1).setCellType(CellType.STRING); - Cell userName = row.getCell(1); - row.getCell(2).setCellType(CellType.STRING); - Cell workNumber = row.getCell(2); - if (row.getCell(3) != null) { - row.getCell(3).setCellType(CellType.STRING); - phone = row.getCell(3); - } else { - phone = row.createCell(3); - } - if (row.getCell(4) != null) { - row.getCell(4).setCellType(CellType.STRING); - email = row.getCell(4); - } else { - email = row.createCell(4); - } - //账号 - importStudent.setAccount(account.getStringCellValue()); - // 用户姓名 - importStudent.setUserName(userName.getStringCellValue()); - //学生学号 - importStudent.setWorkNumber(workNumber.getStringCellValue()); - //电话号 - importStudent.setPhone(phone.getStringCellValue()); - //绑定邮箱 - importStudent.setEmail(email.getStringCellValue()); - list.add(importStudent); - } - } - - } - - return list; - } - - /** - * 读取用户管理 - * - * @param file - * @return - */ - public static List readUserManagement(MultipartFile file) { - List list = new ArrayList(); - - Workbook workbook = getWorkbook(file); - UserManagement userManagement = null; - // 循环工作表Sheet - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - Sheet hssfSheet = workbook.getSheetAt(numSheet); - if (hssfSheet == null) { - continue; - } - // 循环行Row//开始行2 - for (int rowNum = 2; rowNum <= hssfSheet.getLastRowNum(); rowNum++) { - Row row = hssfSheet.getRow(rowNum); - if (row != null) { - userManagement = new UserManagement(); - row.getCell(0).setCellType(CellType.STRING); - Cell account = row.getCell(0); - row.getCell(1).setCellType(CellType.STRING); - Cell name = row.getCell(1); - row.getCell(2).setCellType(CellType.STRING); - Cell clientName = row.getCell(2); - // 账号 - userManagement.setAccount(account.getStringCellValue()); - // 用户姓名 - userManagement.setName(name.getStringCellValue()); - // 客户名称 - userManagement.setClientName(clientName.getStringCellValue()); - list.add(userManagement); - } - } - - } - return list; - } - - private static Workbook getWorkbook(MultipartFile file) { - String fileName = file.getOriginalFilename(); - Workbook workbook = null; - - if (fileName.endsWith("xlsx")) { - try { - workbook = new XSSFWorkbook(file.getInputStream()); - } catch (IOException e) { - e.printStackTrace(); - } - } else if (fileName.endsWith("xls")) { - try { - workbook = new HSSFWorkbook(file.getInputStream()); - } catch (IOException e) { - e.printStackTrace(); - } - } - return workbook; - } - - /** - * 读取员工管理 - * - * @param file - * @return - */ - public static List managementReadStaff(MultipartFile file) { - List list = new ArrayList(); - Workbook workbook = getWorkbook(file); - ImportStaff staff = null; - // 循环工作表Sheet - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - Sheet hssfSheet = workbook.getSheetAt(numSheet); - if (hssfSheet == null) { - continue; - } - // 循环行Row//开始行2 - for (int rowNum = 2; rowNum <= hssfSheet.getLastRowNum(); rowNum++) { - Row row = hssfSheet.getRow(rowNum); - Cell phone; - Cell email; - if (row != null) { - staff = new ImportStaff(); - //用户姓名 - row.getCell(0).setCellType(CellType.STRING); - Cell userName = row.getCell(0); - //账号 - row.getCell(1).setCellType(CellType.STRING); - Cell account = row.getCell(1); - //角色 - row.getCell(2).setCellType(CellType.STRING); - Cell role = row.getCell(2); - //工号 - row.getCell(3).setCellType(CellType.STRING); - Cell workNumber = row.getCell(3); - //员工组织架构名称 - row.getCell(4).setCellType(CellType.STRING); - Cell staffProfessionalArchitectureName = row.getCell(4); - //员工年级名称 - row.getCell(5).setCellType(CellType.STRING); - Cell staffGradeName = row.getCell(5); - //手机号 - if (row.getCell(6) != null) { - row.getCell(6).setCellType(CellType.STRING); - phone = row.getCell(6); - } else { - phone = row.createCell(6); - } - //邮箱 - if (row.getCell(7) != null) { - row.getCell(7).setCellType(CellType.STRING); - email = row.getCell(7); - } else { - email = row.createCell(7); - } - String roleName = role.getStringCellValue(); - //员工角色 - staff.setRoleName(roleName); - // 员工姓名 - staff.setUserName(userName.getStringCellValue()); - //用户账号 - staff.setAccount(account.getStringCellValue()); - // 员工工号 - staff.setWorkNumber(workNumber.getStringCellValue()); - //专业名称 - staff.setStaffGradeName(staffGradeName.getStringCellValue()); - //组织架构名称 - staff.setStaffProfessionalArchitectureName(staffProfessionalArchitectureName.getStringCellValue()); - //电话 - staff.setPhone(phone.getStringCellValue()); - //邮箱 - staff.setEmail(email.getStringCellValue()); - list.add(staff); - } - } - - } - return list; - } - - //判断row是否为空 - public static boolean isRowEmpty(Row row) { - if (null == row) { - return true; - } - int firstCellNum = row.getFirstCellNum(); //第一个列位置 - int lastCellNum = row.getLastCellNum(); //最后一列位置 - int nullCellNum = 0; //空列数量 - for (int c = firstCellNum; c < lastCellNum; c++) { - Cell cell = row.getCell(c); - if (null == cell || CellType.BLANK == cell.getCellType()) { - nullCellNum++; - continue; - } - cell.setCellType(CellType.STRING); - String cellValue = cell.getStringCellValue().trim(); - if (StringUtils.isEmpty(cellValue)) { - nullCellNum++; - } - } - //所有列都为空 - if (nullCellNum == (lastCellNum - firstCellNum)) { - return true; - } - return false; - } - - /** - * 读取题库 - * - * @param file - * @return - */ - public static List readQuestionManagement(MultipartFile file) { - List list = new ArrayList(); - - Workbook workbook = getWorkbook(file); - ExcelImpQuestionReq impQuestionReq = null; - // 循环工作表Sheet - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - Sheet hssfSheet = workbook.getSheetAt(numSheet); - if (hssfSheet == null) { - continue; - } - - int count = 1; - // 循环行Row//开始行2 - for (int rowNum = 2; rowNum <= hssfSheet.getLastRowNum(); rowNum++) { - Row row = hssfSheet.getRow(rowNum); - - if (isRowEmpty(row)) { - count++; - if (count == hssfSheet.getLastRowNum()) { - throw new CustomException(ExceptionEnum.EXCEL_FILE_NULL); - } - continue; - } - - Cell questionStem;//题干 - Cell questionTypeName;//题型 - Cell optionA;//选项A - Cell optionB;//选项B - Cell optionC;//选项C - Cell optionD;//选项D - Cell optionE;//选项E - Cell optionF;//选项F - Cell answer;//正确答案 - Cell answerAnalysis;//答案解析 - if (row != null) { - - impQuestionReq = new ExcelImpQuestionReq(); - - if (row.getCell(9) != null) { - row.getCell(9).setCellType(CellType.STRING); - answerAnalysis = row.getCell(9); - } else { - answerAnalysis = row.createCell(9); - } - if (row.getCell(8) != null) { - row.getCell(8).setCellType(CellType.STRING); - answer = row.getCell(8); - } else { - answer = row.createCell(8); - } - if (row.getCell(7) != null) { - row.getCell(7).setCellType(CellType.STRING); - optionF = row.getCell(7); - } else { - optionF = row.createCell(7); - } - - if (row.getCell(6) != null) { - row.getCell(6).setCellType(CellType.STRING); - optionE = row.getCell(6); - } else { - optionE = row.createCell(6); - } - - if (row.getCell(5) != null) { - row.getCell(5).setCellType(CellType.STRING); - optionD = row.getCell(5); - } else { - optionD = row.createCell(5); - } - - if (row.getCell(4) != null) { - row.getCell(4).setCellType(CellType.STRING); - optionC = row.getCell(4); - } else { - optionC = row.createCell(4); - } - - if (row.getCell(3) != null) { - row.getCell(3).setCellType(CellType.STRING); - optionB = row.getCell(3); - } else { - optionB = row.createCell(3); - } - - if (row.getCell(2) != null) { - row.getCell(2).setCellType(CellType.STRING); - optionA = row.getCell(2); - } else { - optionA = row.createCell(3); - } - - if (row.getCell(1) != null) { - row.getCell(1).setCellType(CellType.STRING); - questionTypeName = row.getCell(1); - } else { - questionTypeName = row.createCell(1); - } - - if (row.getCell(0) != null) { - row.getCell(0).setCellType(CellType.STRING); - questionStem = row.getCell(0); - } else { - questionStem = row.createCell(0); - } - - impQuestionReq.setQuestionStem(questionStem.getStringCellValue()); - impQuestionReq.setQuestionType(questionTypeName.getStringCellValue()); - impQuestionReq.setOptionA(optionA.getStringCellValue()); - impQuestionReq.setOptionB(optionB.getStringCellValue()); - impQuestionReq.setOptionC(optionC.getStringCellValue()); - impQuestionReq.setOptionD(optionD.getStringCellValue()); - impQuestionReq.setOptionE(optionE.getStringCellValue()); - impQuestionReq.setOptionF(optionF.getStringCellValue()); - impQuestionReq.setAnswer(answer.getStringCellValue()); - impQuestionReq.setAnswerAnalysis(answerAnalysis.getStringCellValue()); - - list.add(impQuestionReq); - } - } - - } - - return list; - } - - /** - * 读取职站学生管理 - * - * @param file - * @return - */ - public static List readStudent(MultipartFile file) { - List list = new ArrayList(); - - Workbook workbook = getWorkbook(file); - ExcelImpStudentReq excelImpStudentReq = null; - // 循环工作表Sheet - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - Sheet hssfSheet = workbook.getSheetAt(numSheet); - if (hssfSheet == null) { - continue; - } - - int count = 1; - // 循环行Row//开始行2 - for (int rowNum = 2; rowNum <= hssfSheet.getLastRowNum(); rowNum++) { - Row row = hssfSheet.getRow(rowNum); - - if (isRowEmpty(row)) { - count++; - if (count == hssfSheet.getLastRowNum()) { - throw new CustomException(ExceptionEnum.EXCEL_FILE_NULL); - } - continue; - } - - Cell userName;//学生姓名 - // Cell account;//学生账号 - Cell workNumber;//学号 - Cell professional;//专业 - Cell grade;//年级 - Cell classes;//班级 - Cell phone;//手机号 - Cell email;//邮箱 - if (row != null) { - - excelImpStudentReq = new ExcelImpStudentReq(); - - if (row.getCell(6) != null) { - row.getCell(6).setCellType(CellType.STRING); - email = row.getCell(6); - } else { - email = row.createCell(6); - } - - if (row.getCell(5) != null) { - row.getCell(5).setCellType(CellType.STRING); - phone = row.getCell(5); - } else { - phone = row.createCell(5); - } - - if (row.getCell(4) != null) { - row.getCell(4).setCellType(CellType.STRING); - classes = row.getCell(4); - } else { - classes = row.createCell(4); - } - - if (row.getCell(3) != null) { - row.getCell(3).setCellType(CellType.STRING); - grade = row.getCell(3); - } else { - grade = row.createCell(3); - } - - if (row.getCell(2) != null) { - row.getCell(2).setCellType(CellType.STRING); - professional = row.getCell(2); - } else { - professional = row.createCell(2); - } - - if (row.getCell(1) != null) { - row.getCell(1).setCellType(CellType.STRING); - workNumber = row.getCell(1); - } else { - workNumber = row.createCell(1); - } - - // if (row.getCell(1) != null) { - // row.getCell(1).setCellType(CellType.STRING); - // account = row.getCell(1); - // } else { - // account = row.createCell(1); - // } - - if (row.getCell(0) != null) { - row.getCell(0).setCellType(CellType.STRING); - userName = row.getCell(0); - } else { - userName = row.createCell(0); - } - - excelImpStudentReq.setUserName(userName.getStringCellValue()); - // excelImpStudentReq.setAccount(account.getStringCellValue()); - excelImpStudentReq.setWorkNumber(workNumber.getStringCellValue()); - excelImpStudentReq.setProfessional(professional.getStringCellValue()); - excelImpStudentReq.setGrade(grade.getStringCellValue()); - excelImpStudentReq.setClasses(classes.getStringCellValue()); - excelImpStudentReq.setPhone(phone.getStringCellValue()); - excelImpStudentReq.setEmail(email.getStringCellValue()); - - list.add(excelImpStudentReq); - } - } - - } - - return list; - } - - /** - * @Description : 读取职站员工管理 - * @Param file - * @Author Rong---2021/10/15 - */ - public static List readStaff(MultipartFile file) { - List list = new ArrayList(); - - Workbook workbook = getWorkbook(file); - ExcelImpStaffReq excelImpStaffReq = null; - // 循环工作表Sheet - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - Sheet hssfSheet = workbook.getSheetAt(numSheet); - if (hssfSheet == null) { - continue; - } - - int count = 1; - // 循环行Row//开始行2 - for (int rowNum = 2; rowNum <= hssfSheet.getLastRowNum(); rowNum++) { - Row row = hssfSheet.getRow(rowNum); - - if (isRowEmpty(row)) { - count++; - if (count == hssfSheet.getLastRowNum()) { - throw new CustomException(ExceptionEnum.EXCEL_FILE_NULL); - } - continue; - } - - Cell userName;//姓名 - // Cell account;//账号 - Cell workNumber;//工号 - Cell firstDept;//一级部门 - Cell secondDept;//二级部门 - Cell roleName;//角色 - Cell phone;//手机号 - Cell email;//邮箱 - if (row != null) { - - excelImpStaffReq = new ExcelImpStaffReq(); - - if (row.getCell(6) != null) { - row.getCell(6).setCellType(CellType.STRING); - email = row.getCell(6); - } else { - email = row.createCell(6); - } - - if (row.getCell(5) != null) { - row.getCell(5).setCellType(CellType.STRING); - phone = row.getCell(5); - } else { - phone = row.createCell(5); - } - - if (row.getCell(4) != null) { - row.getCell(4).setCellType(CellType.STRING); - secondDept = row.getCell(4); - } else { - secondDept = row.createCell(4); - } - - if (row.getCell(3) != null) { - row.getCell(3).setCellType(CellType.STRING); - firstDept = row.getCell(3); - } else { - firstDept = row.createCell(3); - } - - if (row.getCell(2) != null) { - row.getCell(2).setCellType(CellType.STRING); - workNumber = row.getCell(2); - } else { - workNumber = row.createCell(2); - } - - if (row.getCell(1) != null) { - row.getCell(1).setCellType(CellType.STRING); - roleName = row.getCell(1); - } else { - roleName = row.createCell(1); - } - - /* if (row.getCell(1) != null) { - row.getCell(1).setCellType(CellType.STRING); - account = row.getCell(1); - } else { - account = row.createCell(1); - }*/ - - if (row.getCell(0) != null) { - row.getCell(0).setCellType(CellType.STRING); - userName = row.getCell(0); - } else { - userName = row.createCell(0); - } - - excelImpStaffReq.setUserName(userName.getStringCellValue()); - // excelImpStaffReq.setAccount(account.getStringCellValue()); - excelImpStaffReq.setWorkNumber(workNumber.getStringCellValue()); - excelImpStaffReq.setFirstDept(firstDept.getStringCellValue()); - excelImpStaffReq.setSecondDept(secondDept.getStringCellValue()); - excelImpStaffReq.setRoleName(roleName.getStringCellValue()); - excelImpStaffReq.setPhone(phone.getStringCellValue()); - excelImpStaffReq.setEmail(email.getStringCellValue()); - - list.add(excelImpStaffReq); - } - } - - } - - return list; - } - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/utils/ImgUtil.java b/occupationlab/src/main/java/com/huoran/occupationlab/utils/ImgUtil.java deleted file mode 100644 index 6837ab5..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/utils/ImgUtil.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.huoran.occupationlab.utils; - -import org.apache.commons.codec.binary.Base64; -//import sun.misc.BASE64Encoder; - -import java.io.*; -import java.net.HttpURLConnection; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; - -public class ImgUtil { - public static String getImagePathStr(String imgFile) { - InputStream in = null; - byte[] data = null; - try { - in = new FileInputStream(imgFile); - } catch (FileNotFoundException e) { - e.printStackTrace(); - } - try { - data = new byte[in.available()]; - // 注:FileInputStream.available()方法能够从输入流中阻断由下一个方法调用这个输入流中读取的剩余字节数 - in.read(data); - in.close(); - } catch (IOException e) { - e.printStackTrace(); - } - -// BASE64Encoder encoder = new BASE64Encoder(); - return Base64.encodeBase64String(data); - - } - - - public static List getAppImageList(String imgURl){ - ArrayList arrayList = new ArrayList<>(); - if(imgURl == null || "".equals(imgURl)){ - return arrayList; - } - String[] imgURlList = imgURl.split(","); - for (String str:imgURlList) { - if(!"".equals(str)){ - arrayList.add(getImagePathStr(str)); - } - } - return arrayList; - } - - - - /** - * 服务器图片转换base64 path:服务器图片路径 返回 base64编码(String 类型) - * @param path - * @return - */ - public static String imgToBase64(String path){ - byte[] data = null; - InputStream in = null; - ByteArrayOutputStream out = null; - try{ - URL url = new URL(path); - HttpURLConnection connection = (HttpURLConnection) url.openConnection(); - connection.setRequestMethod("GET"); - connection.setConnectTimeout(5000); - connection.setReadTimeout(5000); - in = connection.getInputStream(); - out = new ByteArrayOutputStream(); - byte[] b = new byte[1024]; - int len = 0; - while((len =in.read(b)) != -1){ - out.write(b,0,len); - } - }catch (Exception e){ - e.printStackTrace(); - }finally { - try{ - if(in != null ){ - in.close(); - } - }catch (IOException e){ - e.getStackTrace(); - } - } - System.out.println("转换后的图片大小:"+out.toByteArray().length/1024); -// BASE64Encoder base = new BASE64Encoder(); - return Base64.encodeBase64String(out.toByteArray()); - - } - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/utils/SemesterDateUtils.java b/occupationlab/src/main/java/com/huoran/occupationlab/utils/SemesterDateUtils.java deleted file mode 100644 index eecd527..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/utils/SemesterDateUtils.java +++ /dev/null @@ -1,151 +0,0 @@ -package com.huoran.occupationlab.utils; - -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -public class SemesterDateUtils { - - /* public static void main(String[] args) { - - Calendar calendar = Calendar.getInstance(); - // 获取当前年 - int year = calendar.get(Calendar.YEAR); - // 获取当前月 - int month = calendar.get(Calendar.MONTH) + 1; - - //打印出当前学期 - System.out.println(getCurrentSemester(year, month)); - - - } - - //获取当前学期 - public static String getCurrentSemester(Integer year, Integer month) { - StringBuilder sb = new StringBuilder(); - String num = "上"; //默认设成第一学期 - //如果是当前的9月1日到1月30之间,就是本年加上下一年的学期,学期是第一学期 - if (month >= 9 && month <= 12) { //当年的9至12月份 - // sb.append(year); - // sb.append("-"); - sb.append(year + 1); - } else if (month == 1 || month == 2) { //1,2月份为上学期 - // sb.append(year - 1); - // sb.append("-"); - sb.append(year); - - } else if (month >= 2 && month < 9) { //下学期 //如果是2至8月,那它就是上一年加上本年的学期,学期是下学期 - // sb.append(year - 1); - // sb.append("-"); - sb.append(year); - num = "下"; - } - //sb.append("第"); - sb.append(num); - sb.append("学期"); - return sb.toString(); - }*/ - - - public static String getYear(String content) { - - String year = null; - - if (content != null) { - - //正则表达式 - - String pat = "\\d{4}-\\d{2}-\\d{2}"; - - Pattern pattern = Pattern.compile(pat); // 实例化Pattern类 - - Matcher m = pattern.matcher(content); // 实例化Matcher类 - - if (m.matches()) { // 进行验证的匹配,使用正则 - - SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); - - Date date = null; - - try { - - date = format.parse(content); - - Calendar cal = Calendar.getInstance(); - - cal.setTime(date); - - year = "" + cal.get(Calendar.YEAR); - - } catch (ParseException e) { - - e.printStackTrace(); - - } - - } - - } - - return year; - - } - - public static String getMonth(String content) { - - String month = null; - - if (content != null) { - - //正则表达式 - - String pat = "\\d{4}-\\d{2}-\\d{2}"; - - Pattern pattern = Pattern.compile(pat); // 实例化Pattern类 - - Matcher m = pattern.matcher(content); // 实例化Matcher类 - - if (m.matches()) { // 进行验证的匹配,使用正则 - - SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); - - Date date = null; - - try { - - date = format.parse(content); - - Calendar cal = Calendar.getInstance(); - - cal.setTime(date); - - int num = cal.get(Calendar.MONTH) + 1; - - month = "" + num; - - } catch (ParseException e) { - - e.printStackTrace(); - - } - - } - - } - - return month; - - } - - public static void main(String[] args) { - - - System.out.println("month is:" + getMonth("2022-09-07")); - - System.out.println("year is:" + getYear("2022-09-07")); - - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/utils/SpringContextUtils.java b/occupationlab/src/main/java/com/huoran/occupationlab/utils/SpringContextUtils.java deleted file mode 100644 index 6bef595..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/utils/SpringContextUtils.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.huoran.occupationlab.utils; - -import org.springframework.beans.BeansException; -import org.springframework.context.ApplicationContext; -import org.springframework.context.ApplicationContextAware; -import org.springframework.stereotype.Component; - -/** - * SpringContextUtils - * - * @author cheney - * @version V1.0 - * @date 2022年7月28日 - */ -@Component -public class SpringContextUtils implements ApplicationContextAware { - private static ApplicationContext applicationContext; - - @Override - public void setApplicationContext(ApplicationContext applicationContext) - throws BeansException { - SpringContextUtils.applicationContext = applicationContext; - } - - public static Object getBean(String name) { - try { - return applicationContext.getBean(name); - } catch (Exception e) { - return null; - } - } - -} \ No newline at end of file diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/utils/StatusConverter.java b/occupationlab/src/main/java/com/huoran/occupationlab/utils/StatusConverter.java deleted file mode 100644 index c54cbbb..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/utils/StatusConverter.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.huoran.occupationlab.utils; - -import com.alibaba.excel.converters.Converter; -import com.alibaba.excel.enums.CellDataTypeEnum; -import com.alibaba.excel.metadata.CellData; -import com.alibaba.excel.metadata.GlobalConfiguration; -import com.alibaba.excel.metadata.property.ExcelContentProperty; - -/** - * @Author chen - * @DATE 2020/10/19 15:44 - * @Version 1.0 - * 状态转换器 - */ -public class StatusConverter implements Converter { - - @Override - public Class supportJavaTypeKey() { - return Integer.class; - } - - @Override - public CellDataTypeEnum supportExcelTypeKey() { - return CellDataTypeEnum.STRING; - } - - /** - * 这里读的时候会调用 - * - * @param cellData NotNull - * @param contentProperty Nullable - * @param globalConfiguration NotNull - * @return - */ - @Override - public Integer convertToJavaData(CellData cellData, ExcelContentProperty contentProperty, - GlobalConfiguration globalConfiguration) { - return 0; - } - - /** - * 这里是写的时候会调用 - * - * @param value NotNull - * @param contentProperty Nullable - * @param globalConfiguration NotNull - * @return - */ - @Override - public CellData convertToExcelData(Integer value, ExcelContentProperty contentProperty, - GlobalConfiguration globalConfiguration) { - - switch (value) { - case 0: - return new CellData("已禁用"); - case 1: - return new CellData("未禁用"); - default: - return new CellData(String.valueOf(value)); - } - - } - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/utils/WordUtil.java b/occupationlab/src/main/java/com/huoran/occupationlab/utils/WordUtil.java deleted file mode 100644 index 8a7889d..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/utils/WordUtil.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.huoran.occupationlab.utils; - -import com.huoran.occupationlab.entity.ExperimentalReport; -import freemarker.template.Configuration; -import freemarker.template.Template; -import freemarker.template.Version; - -import java.io.*; -import java.util.HashMap; -import java.util.Map; - -/** - * @ClassName WordUtil - * @Description 使用Freemarker生成Word文档工具类 - * @Author Fclever - * @Date 2021/8/11 10:06 - **/ -public class WordUtil { - - /** - * 使用Freemarker自动生成Word文档 - * - * @param dataMap 保存Word文档中所需要的数据 - * @param templatePath 模板文件的绝对路径 - * @param templateFile 模板文件的名称 - * @param generateFile 生成文件的路径+名称 - * @throws Exception - */ - public static void generateWord(Map dataMap, String templatePath, String templateFile, String generateFile) { - // 设置FreeMarker的版本 - Configuration configuration = new Configuration(new Version("2.3.28")); - // 设置Freemarker的编码格式 - configuration.setDefaultEncoding("UTF-8"); - Writer out = null; - try { - // 设置FreeMarker生成Word文档所需要的模板的路径 - configuration.setDirectoryForTemplateLoading(new File(templatePath)); - // 设置FreeMarker生成Word文档所需要的模板名称 - Template t = configuration.getTemplate(templateFile, "UTF-8"); - // 创建一个Word文档的输出流 - out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(generateFile)), "UTF-8")); - //FreeMarker使用Word模板和数据生成Word文档 - t.process(dataMap, out); - } catch (Exception e) { - e.printStackTrace(); - } - if (out != null) { - try { - out.flush(); - out.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - - /* *//** - * 获取生成普通文本所需数据 - * - * @return - *//* - private static Map getTextData(ExperimentalReport report) { - *//* - * 创建一个Map对象,将Word文档需要的数据都保存到该Map对象中 - *//* - Map dataMap = new HashMap<>(); - dataMap.put("userName", report.getUserName()); - dataMap.put("workNumber", report.getWorkNumber()); - dataMap.put("className", report.getClassName()); - dataMap.put("projectName", report.getProjectName()); - dataMap.put("summarize", report.getSummarize()); - dataMap.put("instructor", report.getInstructor()); - return dataMap; - }*/ - - /*public static void main(String[] args) { - WordUtil.generateWord(getTextData(), "D:\\huoran\\huorantech\\occupationlab\\src\\main\\resources\\excel-template\\", - "exportWord.ftl" - , "D:\\huoran\\huorantech\\occupationlab\\src\\main\\resources\\excel-template\\exportWord.doc"); - }*/ -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/utils/XlsUtils.java b/occupationlab/src/main/java/com/huoran/occupationlab/utils/XlsUtils.java deleted file mode 100644 index a839cb8..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/utils/XlsUtils.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.huoran.occupationlab.utils; - -import java.io.*; -import java.net.HttpURLConnection; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLConnection; -import java.text.SimpleDateFormat; -import java.util.*; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import org.apache.poi.hssf.usermodel.*; -import org.apache.poi.ss.usermodel.*; -import org.apache.poi.ss.usermodel.DateUtil; -import org.apache.poi.xssf.usermodel.XSSFCell; -import org.apache.poi.xssf.usermodel.XSSFRow; -import org.apache.poi.xssf.usermodel.XSSFSheet; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; - -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLConnection; -import java.util.ArrayList; -import java.util.List; - -import com.alibaba.fastjson.JSONException; -import com.alibaba.fastjson.JSONObject; -import org.apache.poi.hssf.usermodel.HSSFWorkbook; -import org.apache.poi.ss.usermodel.*; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import org.springframework.util.StringUtils; - -public class XlsUtils { - - public static void main(String[] args) throws IOException { - System.out.println("导出数据为:" + readFileJoinTender("https://huoran.oss-cn-shenzhen.aliyuncs.com/20220408/xls/1512275189860687872.xls")); - } - - private static List readFileJoinTender(String path) { - List list = new ArrayList<>(); - //excel文件路径 - try { - - Workbook wb = getWorkbook(path); - JSONArray jsons = new JSONArray(); - //开始解析 - //读取sheet 0 - Sheet sheet = wb.getSheetAt(0); - //第一行是列名,所以不读 - int firstRowIndex = sheet.getFirstRowNum() + 1; - int lastRowIndex = sheet.getLastRowNum(); - - //遍历行 - for (int rIndex = firstRowIndex; rIndex <= lastRowIndex; rIndex++) { - Row row = sheet.getRow(rIndex); - - if (row != null) { - int indexMin = row.getFirstCellNum(); - int indexMax = row.getLastCellNum(); - for (int i = indexMin; i < indexMax; i++) { - Cell cell = row.getCell(i); - - JSONObject object = new JSONObject(); - if (cell != null) { - // System.out.println(cell.toString()); - // list.add(cell.toString()); - object.put("key", cell.toString()); - //加入json队列 - jsons.add(object); - - } - - } - } - } - - System.out.println("对队列进行输出或者其他操作" + jsons.toJSONString()); - - } catch (Exception e) { - e.printStackTrace(); - } - return list; - } - - public static Workbook getWorkbook(String path) throws Exception { - String type = path.substring(path.lastIndexOf(".") + 1); - Workbook wb; - //根据文件后缀(xls/xlsx)进行判断 - InputStream input = new URL(path).openStream(); - if ("xls".equals(type)) { - - //文件流对象 - wb = new HSSFWorkbook(input); - } else if ("xlsx".equals(type)) { - wb = new XSSFWorkbook(input); - } else { - throw new Exception("文件 类型错误"); - } - return wb; - } - -} - diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/utils/job/Constant.java b/occupationlab/src/main/java/com/huoran/occupationlab/utils/job/Constant.java deleted file mode 100644 index 579b54b..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/utils/job/Constant.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.huoran.occupationlab.utils.job; - -/** - * Constant - * - * @author cheney - * @version V1.0 - * @date 2022年7月28日 - */ -public class Constant { - - /** - * 定时任务状态 - */ - public static final Integer SCHEDULER_STATUS_NORMAL = 0; - public static final Integer SCHEDULER_STATUS_PAUSE = 1; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/utils/oss/AliyunOssUtil.java b/occupationlab/src/main/java/com/huoran/occupationlab/utils/oss/AliyunOssUtil.java deleted file mode 100644 index 63000cb..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/utils/oss/AliyunOssUtil.java +++ /dev/null @@ -1,287 +0,0 @@ -package com.huoran.occupationlab.utils.oss; - -import cn.hutool.core.util.IdUtil; -import com.aliyun.oss.ClientException; -import com.aliyun.oss.OSS; -import com.aliyun.oss.OSSClientBuilder; -import com.aliyun.oss.OSSException; -import com.aliyun.oss.model.*; -import com.huoran.common.entity.FilesResult; -import com.huoran.common.utils.ConstantPropertiesUtil; -import org.apache.commons.lang.StringUtils; -import org.springframework.web.multipart.MultipartFile; - -import javax.servlet.http.HttpServletResponse; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.URLEncoder; -import java.util.List; - -public class AliyunOssUtil { - - /** - * 创建存储空间 - * - * @param ossClient oss客户端 - */ - public static void createBucket(OSS ossClient) { - // 判断存储空间是否存在,不存在,则创建 - if (!ossClient.doesBucketExist(ConstantPropertiesUtil.BUCKET_NAME)) { - // 创建CreateBucketRequest对象,设置仓库名称 - CreateBucketRequest bucketRequest = new CreateBucketRequest(ConstantPropertiesUtil.BUCKET_NAME); - // 设置存储空间的权限为公共读,默认是私有。 - bucketRequest.setCannedACL(CannedAccessControlList.PublicRead); - // 此处以设置存储空间的存储类型为标准存储为例。 - // createBucketRequest.setStorageClass(StorageClass.Standard); - // 默认情况下,数据容灾类型为本地冗余存储,即DataRedundancyType.LRS。如果需要设置数据容灾类型为同城冗余存储,请替换为DataRedundancyType.ZRS。 - // createBucketRequest.setDataRedundancyType(DataRedundancyType.ZRS) - // 创建存储空间。 - ossClient.createBucket(bucketRequest); - - } - } - - /** - * 上传文件 - * - * @param file 文件 - * @return 返回文件上传结果 - * @throws OSSException oss异常 - * @throws ClientException 客户端异常 - * @throws IOException io异常 - */ - public static FilesResult uploadFile(MultipartFile file, String tableName) throws OSSException, ClientException, IOException { - - //获取访问key - String endPoint = ConstantPropertiesUtil.END_POINT; - String accessKeyId = ConstantPropertiesUtil.ACCESS_KEY_ID; - String accessKeySecret = ConstantPropertiesUtil.ACCESS_KEY_SECRET; - //创建ossClient - OSS ossClient = new OSSClientBuilder().build(endPoint, accessKeyId, accessKeySecret); - - FilesResult result = new FilesResult(); - // 创建存储空间 - createBucket(ossClient); - - //获取上传文件流 - InputStream inputStream = file.getInputStream(); - //获取当前日期构建日期路径:PythonDataExcel/文件名 -// String currentDate = new DateTime().toString("yyyyMMdd"); - //获取上传的文件名称(此处filename直接取的TableName) -// String fileName = file.getOriginalFilename(); - - String fileName = tableName; - result.setOriginalFileName(StringUtils.substringBefore(fileName,".")); - - // 获取文件尾缀 - assert fileName != null; - String ext = fileName.substring(fileName.lastIndexOf(".")); - // 获取文件类型,大小 - String fileType = getFileType(ext); - long fileSize = file.getSize(); - - result.setFileType(fileType); - result.setFileSize(String.valueOf(fileSize)); - //获取随机值 - String snowflakeId = IdUtil.getSnowflake(6, 4).nextIdStr(); - //文件名:雪花算法.文件扩展名 -// String newName = snowflakeId + ext; - String sort = ext.substring(ext.lastIndexOf(".") + 1); - result.setFileType(sort); - //组合新的文件名 - String fileUrl = "PythonDataExcel/" + fileName; - result.setOssFileName(fileUrl); - // 设置上传时存储类型与访问权限 - ObjectMetadata metadata = new ObjectMetadata(); - // 指定该Object被下载时的网页的缓存行为 - metadata.setCacheControl("no-cache"); - // 指定该Object下设置Header - metadata.setHeader("Pragma", "no-cache"); - // 指定该Object被下载时的内容编码格式 - metadata.setContentEncoding("utf-8"); - // 文件的MIME,定义文件的类型及网页编码,决定浏览器将以什么形式、什么编码读取文件。如果用户没有指定则根据Key或文件名的扩展名生成, - // 如果没有扩展名则填默认值application/octet-stream - metadata.setContentType(fileType); - // 指定该Object被下载时的名称(指示MINME用户代理如何显示附加的文件,打开或下载,及文件名称) - metadata.setContentDisposition("filename/filesize=" + file.getName() + "/" + fileSize + "Byte."); - - //上传文件 (上传文件流的形式) - ossClient.putObject(ConstantPropertiesUtil.BUCKET_NAME, fileUrl, inputStream, metadata); - // 关闭OSSClient。 - ossClient.shutdown(); - - // 拼接文件url地址,返回控制层 - String tempEndpoint = ConstantPropertiesUtil.END_POINT; - String endpoint = tempEndpoint.substring(tempEndpoint.lastIndexOf("/") + 1, tempEndpoint.length()); - String url = "https://" + ConstantPropertiesUtil.BUCKET_NAME + "." + endpoint + "/" + fileUrl; - - result.setFileUrl(url); - - // 关闭OSSClient。 - ossClient.shutdown(); - - return result; - } - - /** - * 文件下载 - * - * @param response 响应对象 - * @param ossClient oss客户端 - * @param objectName 文件名 - */ - public static void downloadFiles(HttpServletResponse response, OSS ossClient, String objectName) throws IOException { - - // ossObject包含文件所在的存储空间名称、文件名称、文件元信息以及一个输入流。 - OSSObject ossObject = ossClient.getObject(ConstantPropertiesUtil.BUCKET_NAME, objectName); - InputStream input = null; - OutputStream outputStream = null; - try { - // 获取文件名 - String fileName = objectName.substring(objectName.lastIndexOf("/") + 1); - //获取输入流 - input = ossObject.getObjectContent(); - // 获取OutputStream输出流 - outputStream = response.getOutputStream(); - byte[] buffer = new byte[input.available()]; - - response.setHeader("content-Type", "application/octet-stream"); - response.setHeader("Content-disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8")); - response.flushBuffer(); - - for (int length = 0; (length = input.read(buffer)) > 0; ) { - outputStream.write(buffer, 0, length); - } - - } catch (IOException e) { - e.printStackTrace(); - throw e; - } finally { - if (null != outputStream) { - try { - outputStream.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - if (null != input) { - try { - input.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - // 关闭OSSClient。 - ossClient.shutdown(); - } - - } - - /** - * *** 谨慎操作 *** - * 删除存储空间 - * - * @param bucketName 存储空间名称 - */ - public static void deleteBucket(String bucketName) { - String endPoint = ConstantPropertiesUtil.END_POINT; - String accessKeyId = ConstantPropertiesUtil.ACCESS_KEY_ID; - String accessKeySecret = ConstantPropertiesUtil.ACCESS_KEY_SECRET; - // 创建OSSClient实例。 - OSS ossClient = new OSSClientBuilder().build(endPoint, accessKeyId, accessKeySecret); - // 删除存储空间。 - ossClient.deleteBucket(bucketName); - // 关闭OSSClient。 - ossClient.shutdown(); - } - - /** - * 创建文件夹 - * - * @param ossClient oss连接 - * @param bucketName 存储空间 - * @param folder 文件夹名,如 "qj_nanjing/" - * @return 返回创建的文件夹名 - */ - public static String createFolder(OSS ossClient, String bucketName, String folder) { - // 判断文件夹是否存在,不存在则创建 - if (!ossClient.doesObjectExist(bucketName, folder)) { - // 创建文件夹 - ossClient.putObject(bucketName, folder, new ByteArrayInputStream(new byte[0])); - // 得到文件夹名 - OSSObject object = ossClient.getObject(bucketName, folder); - return object.getKey(); - } - return folder; - } - - /** - * 批量删除文件。key等同于ObjectName,表示删除OSS文件时需要指定包含文件后缀在内的完整路径,例如abc/efg/123.jpg。 - * - * @param keys 文件完整路径 - */ - public static List deleteFiles(List keys) { - String endPoint = ConstantPropertiesUtil.END_POINT; - String accessKeyId = ConstantPropertiesUtil.ACCESS_KEY_ID; - String accessKeySecret = ConstantPropertiesUtil.ACCESS_KEY_SECRET; - String bucketName = ConstantPropertiesUtil.BUCKET_NAME; - // 创建OSSClient实例。 - OSS ossClient = new OSSClientBuilder().build(endPoint, accessKeyId, accessKeySecret); - - DeleteObjectsResult deleteObjectsResult = ossClient.deleteObjects(new DeleteObjectsRequest(bucketName).withKeys(keys)); - List deletedObjects = deleteObjectsResult.getDeletedObjects(); - // 关闭OSSClient。 - ossClient.shutdown(); - //返回删除成功文件列表 - return deletedObjects; - } - - /** - * 获取文件类型 - * - * @param fileExtension 文件后缀 - * @return 返回类型 - */ - public static String getFileType(String fileExtension) { - if (".bmp".equalsIgnoreCase(fileExtension)) { - return "image/bmp"; - } - if (".gif".equalsIgnoreCase(fileExtension)) { - return "image/gif"; - } - if (".jpeg".equalsIgnoreCase(fileExtension) || ".jpg".equalsIgnoreCase(fileExtension) || ".png".equalsIgnoreCase(fileExtension)) { - return "image/jpg"; - } - if (".html".equalsIgnoreCase(fileExtension)) { - return "text/html"; - } - if (".txt".equalsIgnoreCase(fileExtension)) { - return "text/plain"; - } - if (".vsd".equalsIgnoreCase(fileExtension)) { - return "application/vnd.visio"; - } - if (".ppt".equalsIgnoreCase(fileExtension) || ".pptx".equalsIgnoreCase(fileExtension)) { - return "application/vnd.ms-powerpoint"; - } - if (".doc".equalsIgnoreCase(fileExtension) || ".docx".equalsIgnoreCase(fileExtension)) { - return "application/msword"; - } - if (".xml".equalsIgnoreCase(fileExtension)) { - return "text/xml"; - } - if (".mp4".equalsIgnoreCase(fileExtension) || ".avi".equalsIgnoreCase(fileExtension)) { - return "video/mp4"; - } - if (".mpg".equalsIgnoreCase(fileExtension) || ".mpeg".equalsIgnoreCase(fileExtension)) { - return "video/mpeg"; - } - if ("pdf".equalsIgnoreCase(fileExtension)) { - return "application/pdf"; - } - return "application/octet-stream"; - } - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/utils/oss/AliyunVodSDKUtil.java b/occupationlab/src/main/java/com/huoran/occupationlab/utils/oss/AliyunVodSDKUtil.java deleted file mode 100644 index 65552df..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/utils/oss/AliyunVodSDKUtil.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.huoran.occupationlab.utils.oss; - -import com.aliyuncs.DefaultAcsClient; -import com.aliyuncs.profile.DefaultProfile; - -/** - * @Author chen - * @DATE 2020/10/12 9:10 - * @Version 1.0 - */ -public class AliyunVodSDKUtil { - public static DefaultAcsClient initVodClient(String accessKeyId, String accessKeySecret) { - String regionId = "cn-shanghai"; // 点播服务接入区域 - DefaultProfile profile = DefaultProfile.getProfile(regionId, accessKeyId, accessKeySecret); - return new DefaultAcsClient(profile); - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/utils/poi/CommonCode.java b/occupationlab/src/main/java/com/huoran/occupationlab/utils/poi/CommonCode.java deleted file mode 100644 index 7b00811..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/utils/poi/CommonCode.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.huoran.occupationlab.utils.poi; - -import com.huoran.occupationlab.utils.poi.ResultCode; -import lombok.ToString; - -@ToString -public enum CommonCode implements ResultCode { - - - SUCCESS(true, 10000, "操作成功!"), - UNAUTHENTICATED(false, 10001, "此操作需要登陆系统!"), - UNAUTHORISE(false, 10002, "权限不足,无权操作!"), - QUESTIONTYPE_INVALID(false, 10006, "题型错误!"), - INVALID_PARAM(false, 10003, "非法参数!"), - QUESTION_NUM_INVALID(false, 10004, "测评题目数量设置超出范围!"), - QUESTION_EXISTS(false, 10005, "此题已存在!"), - QUESTION_TYPE_INVALID(false, 10006, "题型错误!"), - EXCEL_INVALID(false, 10007, "excel表内容错误!"), - EVALUATION_TIME_INVALID(false, 10008, "测评时间错误!"), - EXCEL_FILE_INVALID(false, 10009, "上传excel文件错误!"), - REPEAT_INEXCEL(false, 10010, "试题在excel表中重复!"), - EVALUATION_QUESTION_NUM_INVALID(false, 10011, "当前测评题数设置为0,请先设置测评题数!"), - FAIL(false, 11111, "操作失败!"), - SERVER_ERROR(false, 99999, "抱歉,系统繁忙,请稍后重试!"); - //操作是否成功 - boolean success; - //操作代码 - int code; - //提示信息 - String message; - - CommonCode(boolean success, int code, String message) { - this.success = success; - this.code = code; - this.message = message; - } - - @Override - public boolean success() { - return success; - } - - @Override - public int code() { - return code; - } - - @Override - public String message() { - return message; - } - - -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/utils/poi/CustomException.java b/occupationlab/src/main/java/com/huoran/occupationlab/utils/poi/CustomException.java deleted file mode 100644 index fc59681..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/utils/poi/CustomException.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.huoran.occupationlab.utils.poi; - -import com.huoran.common.response.R; -import com.huoran.occupationlab.utils.poi.ResultCode; - -/** - * @author 世杰 - * @date 2020/3/24 22:47 - */ -public class CustomException extends RuntimeException { - private com.huoran.occupationlab.utils.poi.ResultCode resultCode; - - public CustomException(Integer code, String message) { - //异常信息为错误代码+异常信息 - super("错误代码:" + code + "错误信息:" + message); - this.resultCode = resultCode; - } - - public CustomException(com.huoran.occupationlab.utils.poi.ResultCode resultCode) { - //异常信息为错误代码+异常信息 - super("错误代码:" + resultCode.code() + "错误信息:" + resultCode.message()); - this.resultCode = resultCode; - } - - public ResultCode getResultCode() { - return this.resultCode; - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/utils/poi/ExcelAttribute.java b/occupationlab/src/main/java/com/huoran/occupationlab/utils/poi/ExcelAttribute.java deleted file mode 100644 index fb709ed..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/utils/poi/ExcelAttribute.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.huoran.occupationlab.utils.poi; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.FIELD) -public @interface ExcelAttribute { - /** - * 对应的列名称 - */ - String name() default ""; - - /** - * excel列的索引 - */ - int sort(); - - /** - * 字段类型对应的格式 - */ - String format() default ""; -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/utils/poi/ExcelExportUtil.java b/occupationlab/src/main/java/com/huoran/occupationlab/utils/poi/ExcelExportUtil.java deleted file mode 100644 index 8d3b468..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/utils/poi/ExcelExportUtil.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.huoran.occupationlab.utils.poi; - -import lombok.Data; -import org.apache.poi.ss.usermodel.Cell; -import org.apache.poi.ss.usermodel.CellStyle; -import org.apache.poi.ss.usermodel.Row; -import org.apache.poi.ss.usermodel.Sheet; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; - -import javax.servlet.http.HttpServletResponse; -import java.io.InputStream; -import java.lang.reflect.Field; -import java.net.URLEncoder; -import java.util.List; -import java.util.concurrent.atomic.AtomicInteger; - -/** - * 导出Excel工具类 - * 基于模板打印的方式导出: - */ -@Data -public class ExcelExportUtil { - - private int rowIndex; //写入数据的起始行 - private int styleIndex; //需要提取的样式所在的行号 - private Class clazz; //对象的字节码 - private Field fields[]; //对象中的所有属性 - - public ExcelExportUtil(Class clazz, int rowIndex, int styleIndex) { - this.clazz = clazz; - this.rowIndex = rowIndex; - this.styleIndex = styleIndex; - fields = clazz.getDeclaredFields(); - } - - /** - * 基于注解导出 - * 参数: - * response: - * InputStream:模板的输入流 - * objs:数据 - * fileName:生成的文件名 - */ - public void export(HttpServletResponse response, InputStream is, List objs, String fileName) throws Exception { - - //1.根据模板创建工作簿 - XSSFWorkbook workbook = new XSSFWorkbook(is); - //2.读取工作表 - Sheet sheet = workbook.getSheetAt(0); - Row row1 = sheet.getRow(styleIndex); - //3.提取公共的样式 - CellStyle[] styles = getTemplateStyles(row1); - //4.根据数据创建每一行和每一个单元格的数据2 - AtomicInteger datasAi = new AtomicInteger(rowIndex); //数字 - for (T t : objs) { - //datasAi.getAndIncrement() :获取数字,并++ i++ - Row row = sheet.createRow(datasAi.getAndIncrement()); - for (int i = 0; i < styles.length; i++) { - Cell cell = row.createCell(i); - cell.setCellStyle(styles[i]); - for (Field field : fields) { - if (field.isAnnotationPresent(com.huoran.occupationlab.utils.poi.ExcelAttribute.class)) { - field.setAccessible(true); - com.huoran.occupationlab.utils.poi.ExcelAttribute ea = field.getAnnotation(ExcelAttribute.class); - if (i == ea.sort()) { - if (field.get(t) != null) { - cell.setCellValue(field.get(t).toString()); - } - } - } - } - } - } - fileName = URLEncoder.encode(fileName, "UTF-8"); - response.setContentType("application/octet-stream"); - response.setHeader("content-disposition", "attachment;filename=" + new String(fileName.getBytes("ISO8859-1"))); - response.setHeader("filename", fileName); - workbook.write(response.getOutputStream()); - } - - CellStyle[] getTemplateStyles(Row row) { - CellStyle[] styles = new CellStyle[row.getLastCellNum()]; - for (int i = 0; i < row.getLastCellNum(); i++) { - if (row.getCell(i) == null) { - styles[i] = row.createCell(i).getCellStyle(); - } else { - styles[i] = row.getCell(i).getCellStyle(); - } - } - return styles; - } -// CellStyle[] getTemplateStyles(Row row) { -// CellStyle[] styles = new CellStyle[row.getLastCellNum()]; -// for (int i = 0; i < row.getLastCellNum(); i++) { -// styles[i] = row.getCell(i).getCellStyle(); -// } -// return styles; -// } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/utils/poi/ExcelImportUtil.java b/occupationlab/src/main/java/com/huoran/occupationlab/utils/poi/ExcelImportUtil.java deleted file mode 100644 index c2bc797..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/utils/poi/ExcelImportUtil.java +++ /dev/null @@ -1,123 +0,0 @@ -package com.huoran.occupationlab.utils.poi;//package com.huoran.enterprise.utils.poi; -// -//import org.apache.poi.ss.usermodel.Cell; -//import org.apache.poi.ss.usermodel.DateUtil; -//import org.apache.poi.ss.usermodel.Row; -//import org.apache.poi.ss.usermodel.Sheet; -//import org.apache.poi.xssf.usermodel.XSSFWorkbook; -// -//import java.io.InputStream; -//import java.lang.reflect.Field; -//import java.math.BigDecimal; -//import java.text.SimpleDateFormat; -//import java.util.ArrayList; -//import java.util.Date; -//import java.util.List; -// -// -//public class ExcelImportUtil { -// -// private Class clazz; -// private Field fields[]; -// -// public ExcelImportUtil(Class clazz) { -// this.clazz = clazz; -// fields = clazz.getDeclaredFields(); -// } -// -// /** -// * 基于注解读取excel -// */ -// public List readExcel(InputStream is, int rowIndex, int cellIndex) { -// List list = new ArrayList<>(); -// T entity = null; -// try { -// XSSFWorkbook workbook = new XSSFWorkbook(is); -// Sheet sheet = workbook.getSheetAt(0); -// // 不准确 -// // int rowLength = sheet.getLastRowNum(); -// // System.out.println(sheet.getLastRowNum()); -// for (int rowNum = rowIndex; rowNum <= sheet.getLastRowNum(); rowNum++) { -// Row row = sheet.getRow(rowNum); -// entity = (T) clazz.newInstance(); -// // System.out.println(row.getLastCellNum()); -// for (int j = cellIndex; j < row.getLastCellNum(); j++) { -// Cell cell = row.getCell(j); -// for (Field field : fields) { -// if (field.isAnnotationPresent(ExcelAttribute.class)) { -// field.setAccessible(true); -// ExcelAttribute ea = field.getAnnotation(ExcelAttribute.class); -// if (j == ea.sort()) { -// field.set(entity, covertAttrType(field, cell)); -// } -// } -// } -// } -// Field field = entity.getClass().getDeclaredField("index"); -// field.setAccessible(true); -// field.set(entity, rowNum + 1); -// list.add(entity); -// } -// } catch (Exception e) { -// e.printStackTrace(); -// } -// return list; -// } -// -// /** -// * 类型转换 将cell 单元格格式转为 字段类型 -// */ -// private Object covertAttrType(Field field, Cell cell) throws Exception { -// String fieldType = field.getType().getSimpleName(); -// if ("String".equals(fieldType)) { -// return getValue(cell); -// } else if ("Date".equals(fieldType)) { -// return new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").parse(getValue(cell)); -// } else if ("int".equals(fieldType) || "Integer".equals(fieldType)) { -// return Integer.parseInt(getValue(cell)); -// } else if ("double".equals(fieldType) || "Double".equals(fieldType)) { -// return Double.parseDouble(getValue(cell)); -// } else { -// return null; -// } -// } -// -// -// /** -// * 格式转为String -// * -// * @param cell -// * @return -// */ -//// public String getValue(Cell cell) { -//// if (cell == null) { -//// return ""; -//// } -//// switch (cell.getCellType()) { -//// case STRING: -//// return cell.getRichStringCellValue().getString().trim(); -//// case NUMERIC: -//// if (DateUtil.isCellDateFormatted(cell)) { -//// Date dt = DateUtil.getJavaDate(cell.getNumericCellValue()); -//// return new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(dt); -//// } else { -//// // 防止数值变成科学计数法 -//// String strCell = ""; -//// Double num = cell.getNumericCellValue(); -//// BigDecimal bd = new BigDecimal(num.toString()); -//// if (bd != null) { -//// strCell = bd.toPlainString(); -//// } -//// // 去除 浮点型 自动加的 .0 -//// if (strCell.endsWith(".0")) { -//// strCell = strCell.substring(0, strCell.indexOf(".")); -//// } -//// return strCell; -//// } -//// case BOOLEAN: -//// return String.valueOf(cell.getBooleanCellValue()); -//// default: -//// return ""; -//// } -//// } -//} \ No newline at end of file diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/utils/poi/ExcelStyleUtil.java b/occupationlab/src/main/java/com/huoran/occupationlab/utils/poi/ExcelStyleUtil.java deleted file mode 100644 index e5d0917..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/utils/poi/ExcelStyleUtil.java +++ /dev/null @@ -1,187 +0,0 @@ -package com.huoran.occupationlab.utils.poi; - -import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; -import cn.afterturn.easypoi.excel.entity.params.ExcelForEachParams; -import cn.afterturn.easypoi.excel.export.styler.IExcelExportStyler; -import org.apache.poi.ss.usermodel.*; - -/** - * @ProjectName: huorantech - * @Package: com.huoran.common.utils - * @ClassName: ExcelStyleUtil - * @Description: easy poi导出设置样式 - * @Author: Maureen.Rong - * @CreateDate: 2021/9/1 14:29 - * @UpdateDate: 2021/9/1 14:29 - * @Version: 1.0 - */ -public class ExcelStyleUtil implements IExcelExportStyler { - private static final short STRING_FORMAT = (short) BuiltinFormats.getBuiltinFormat("TEXT"); - private static final short FONT_SIZE_TEN = 9; - private static final short FONT_SIZE_ELEVEN = 10; - private static final short FONT_SIZE_TWELVE = 50; - - /** - * 大标题样式 - */ - private CellStyle headerStyle; - /** - * 每列标题样式 - */ - private CellStyle titleStyle; - /** - * 数据行样式 - */ - private CellStyle styles; - - public ExcelStyleUtil(Workbook workbook) { - this.init(workbook); - } - - /** - * 初始化样式 - * - * @param workbook - */ - private void init(Workbook workbook) { - this.headerStyle = initHeaderStyle(workbook); - this.titleStyle = initTitleStyle(workbook); - this.styles = initStyles(workbook); - } - - /** - * 大标题样式 - * - * @param color - * @return - */ - @Override - public CellStyle getHeaderStyle(short color) { - return headerStyle; - } - - /** - * 每列标题样式 - * - * @param color - * @return - */ - @Override - public CellStyle getTitleStyle(short color) { - return titleStyle; - } - - /** - * 数据行样式 - * - * @param parity 可以用来表示奇偶行 - * @param entity 数据内容 - * @return 样式 - */ - @Override - public CellStyle getStyles(boolean parity, ExcelExportEntity entity) { - return styles; - } - - /** - * 获取样式方法 - * - * @param dataRow 数据行 - * @param obj 对象 - * @param data 数据 - */ - @Override - public CellStyle getStyles(Cell cell, int dataRow, ExcelExportEntity entity, Object obj, Object data) { - return getStyles(true, entity); - } - - /** - * 模板使用的样式设置 - */ - @Override - public CellStyle getTemplateStyles(boolean isSingle, ExcelForEachParams excelForEachParams) { - return null; - } - - /** - * 初始化--大标题样式 - * - * @param workbook - * @return - */ - private CellStyle initHeaderStyle(Workbook workbook) { - CellStyle style = getBaseCellStyle(workbook); - style.setFont(getFont(workbook, FONT_SIZE_TWELVE, true)); - return style; - } - - /** - * 初始化--每列标题样式 - * - * @param workbook - * @return - */ - private CellStyle initTitleStyle(Workbook workbook) { - CellStyle style = getBaseCellStyle(workbook); - style.setFont(getFont(workbook, FONT_SIZE_ELEVEN, false)); - //背景色 - style.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex()); - style.setFillPattern(FillPatternType.SOLID_FOREGROUND); - return style; - } - - /** - * 初始化--数据行样式 - * - * @param workbook - * @return - */ - private CellStyle initStyles(Workbook workbook) { - CellStyle style = getBaseCellStyle(workbook); - style.setFont(getFont(workbook, FONT_SIZE_TEN, false)); - style.setDataFormat(STRING_FORMAT); - return style; - } - - /** - * 基础样式 - * - * @return - */ - private CellStyle getBaseCellStyle(Workbook workbook) { - CellStyle style = workbook.createCellStyle(); - //下边框 - style.setBorderBottom(BorderStyle.THIN); - //左边框 - style.setBorderLeft(BorderStyle.THIN); - //上边框 - style.setBorderTop(BorderStyle.THIN); - //右边框 - style.setBorderRight(BorderStyle.THIN); - //水平居中 - style.setAlignment(HorizontalAlignment.CENTER); - //上下居中 - style.setVerticalAlignment(VerticalAlignment.CENTER); - //设置自动换行 - style.setWrapText(true); - return style; - } - - /** - * 字体样式 - * - * @param size 字体大小 - * @param isBold 是否加粗 - * @return - */ - private Font getFont(Workbook workbook, short size, boolean isBold) { - Font font = workbook.createFont(); - //字体样式 - font.setFontName("宋体"); - //是否加粗 - font.setBold(isBold); - //字体大小 - font.setFontHeightInPoints(size); - return font; - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/utils/poi/ExceptionCast.java b/occupationlab/src/main/java/com/huoran/occupationlab/utils/poi/ExceptionCast.java deleted file mode 100644 index 29727cd..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/utils/poi/ExceptionCast.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.huoran.occupationlab.utils.poi; - -import com.huoran.occupationlab.utils.poi.CustomException; -import com.huoran.occupationlab.utils.poi.ResultCode; - -/** - * @author 世杰 - * @date 2020/3/24 23:04 - */ -public class ExceptionCast { - //使用此静态方法抛出自定义异常 - public static void cast(ResultCode resultCode) { - throw new CustomException(resultCode); - } -} diff --git a/occupationlab/src/main/java/com/huoran/occupationlab/utils/poi/ResultCode.java b/occupationlab/src/main/java/com/huoran/occupationlab/utils/poi/ResultCode.java deleted file mode 100644 index a7ba2d0..0000000 --- a/occupationlab/src/main/java/com/huoran/occupationlab/utils/poi/ResultCode.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.huoran.occupationlab.utils.poi; - -/** - * Created by mrt on 2018/3/5. - * 10000-- 通用错误代码 - * 22000-- 媒资错误代码 - * 23000-- 用户中心错误代码 - * 24000-- cms错误代码 - * 25000-- 文件系统 - */ -public interface ResultCode { - //操作是否成功,true为成功,false操作失败 - boolean success(); - - //操作代码 - int code(); - - //提示信息 - String message(); - -} diff --git a/occupationlab/src/main/resources/bootstrap.properties b/occupationlab/src/main/resources/bootstrap.properties deleted file mode 100644 index 43519d9..0000000 --- a/occupationlab/src/main/resources/bootstrap.properties +++ /dev/null @@ -1,33 +0,0 @@ -#职站 -spring.application.name=occupationlab - -#addr -spring.cloud.nacos.config.server-addr=127.0.0.1:8848 - -#namespace -spring.cloud.nacos.config.namespace=kindergarten-microservice-configuration-namespace - -#spring.profiles.active=dev -#thread -occupationlab.thread.core-size=20 -occupationlab.thread.max-size=200 -occupationlab.thread.keep-alive-time=10 - -# 某些类对象无法序列化的时候,是否报错 -#spring.jackson.serialization.fail-on-empty-beans=true -# json对象中有不存在的属性时候,是否报错 -#spring.jackson.deserialization.fail-on-unknown-properties=true - - -#以下是补充配置 -spring.datasource.type=com.zaxxer.hikari.HikariDataSource -spring.datasource.hikari.minimum-idle=5 -spring.datasource.hikari.maximum-pool-size=15 -spring.datasource.hikari.auto-commit=true -spring.datasource.hikari.idle-timeout=30000 -spring.datasource.hikari.pool-name=DatebookHikariCP -spring.datasource.hikari.max-lifetime=500000 -spring.datasource.hikari.connection-timeout=30000 -spring.datasource.hikari.connection-test-query=SELECT 1 - - diff --git a/occupationlab/src/main/resources/excel-template/bank.ftl b/occupationlab/src/main/resources/excel-template/bank.ftl deleted file mode 100644 index 88af47e..0000000 --- a/occupationlab/src/main/resources/excel-template/bank.ftl +++ /dev/null @@ -1,3285 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 标准实验报告 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 基本信息 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 学生姓名 - - - - - - - - - - - - - - : - - - - - - - - - - - - - - - - - - - - - - ${userName!} - - - - - - - - - - - - - - - - - - - - - - - - - - - 试验时间 - - - - - - - - - - - - - : - - - - - - - - - - - ${submitTime!} - - - - - - - - - - - - - - - - - - - - - - - - - - - 学生班级 - - - - - - - - - - - - - : - - - - - - - - - - - ${className!} - - - - - - - - - - - - - - - - - - - - - - 实验成绩 - - - - - - - - - - - - - : - - - - - - - - - - - ${score!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 学号 - - - - - - - - - - - - - : - - - - - - - - - - - ${workNumber!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验学时 - - - - - - - - - - - - - : - - - - - - - - - - - ${timeSum!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 指导老师 - - - - - - - - - - - - - : - - - - - - - - - - - ${instructor!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验项目名称 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${projectName!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验目的 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${purpose!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验数据 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 序号 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 判分点 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 考核点 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 参考答案 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 学生答案 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 分值 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 得分 - - - - - - <#list experimentalDataList as data> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.id!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.judgmentName!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.assessmentPoint!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.referenceAnswer!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.answer!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.quesScore!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.score!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验总结与体会 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 总感觉军军军军军军 - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - 423 - 478 - 0 - 0 - 154 - false - false - 808 - WPS Office_11.1.0.13703_F1E327BC-269C-435d-A152-05C5408002CA - 0 - - - - - - - 2022-03-25T03:10:00Z - Hello - rong - 2023-10-25T08:09:49Z - 1 - - - - - - - - 2052-11.1.0.13703 - - - 2124D8FADC4D4677BEFA07ADCD9514A7 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAElBMVEUAAAAAfv8Afv8Afv8Afv8A - fv+el/cYAAAABXRSTlMAqpfd2z124asAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAAkSURBVCiRY2Cg - G2BFBkRKMDNCAAu6BBOUxUS0UcPeDlIlaAoAstwDOYaAcLoAAAAASUVORK5CYII= - - - - iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAALVBMVEUAAAAAfv8Afv8Ad/8Afv8A - fv8Aff8Aff8Af/8Afv8Af/8Aff8Afv8Af/8Afv9+TCfvAAAADnRSTlMA5MYD3Jr17IuJSx3Wo4N5 - 2H8AAAAJcEhZcwAADsQAAA7EAZUrDhsAAABUSURBVCiRvY3ZCoAwDARjNr21//+5YorQSyg+dJ4G - hmSJdiG5QqqQG7pwKGMwxcz6xeeGZcWOG1Cu9Ve/AvM8BMBPgouPRNcHTsUSN0ECXoU/aRc35zgI - 8eK691UAAAAASUVORK5CYII= - - - - iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAALVBMVEUAAAAAeP8Afv8Afv8Afv8A - e/8Afv8Af/8AgP8Aff8AgP8Afv8Af/8Afv8Afv+RS+oMAAAADnRSTlMADNRdph/Ep0TmYFXDRfNw - SsgAAAAJcEhZcwAADsQAAA7EAZUrDhsAAABvSURBVCiRvZDbEoAgCEQFNG/F/39uUI1jJtNT7YPD - nFUWce5XASLMePLMPj1wWPjQGgae+VK+O3o/EkV90/NNQIVCUKXockBzAZkRolbNEMRUNIFIDnw3 - zFZm+Dmun4xrf7CtZBm45syX6Oy1f6cdwqsGnX1mG3QAAAAASUVORK5CYII= - - - - iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAclBMVEUAAAAAfv8Afv8Ahf8Afv8A - fv8Afv8Afv8AfP8Afv8Afv8Afv8Af/8Af/8Afv8AgP8Aff8Afv8AgP8Af/8Aff8AgP8Ae/8Afv8A - fv8Afv8Afv8Af/8Af/8Afv8Afv8Af/8Aff8Af/8Afv8Af/8Aff8Afv/G+dOvAAAAJXRSTlMA990F - 7Mumggm9tpJiW0UmrI1STCweDunf0s6pn5aIh3pwb2g/g62ubAAAAAlwSFlzAAAOxAAADsQBlSsO - GwAAAJZJREFUKJG9j0cWwyAMBb8oBpe4xXZ6j+5/xZiwEqyTWen9UQHgn4ylMdWYxfrEu743XOhE - 1HxdIz/wIPOZz7EoaBbiwV0sJn7KTQS0SzcBVAvh2GsqVYmFnRAtb3BnbtDwVl5XB8AarZVK3hs6 - C4XXOinxVAVx3Kc/R0XWkE1OBy78Jd0E3KJoM+GieGeiUyG3PhM/5AOdtQnIhXjAuAAAAABJRU5E - rkJgghjj - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/occupationlab/src/main/resources/excel-template/bank1.ftl b/occupationlab/src/main/resources/excel-template/bank1.ftl deleted file mode 100644 index ba20395..0000000 --- a/occupationlab/src/main/resources/excel-template/bank1.ftl +++ /dev/null @@ -1,3350 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 标准实验报告 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -102235 - - - 65405 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 基本信息 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 学生姓名 - - - - - - - - - - - - - - - : - - - - - - - - - - - ${userName!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 试验时间 - - - - - - - - - - - - - - : - - - - - - - - - - - ${submitTime!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 学生班级 - - - - - - - - - - - - - - : - - - - - - - - - - - ${className!} - - - - - - - - - - - - - - - - - - - - - - - - 实验成绩 - - - - - - - - - - - - - - : - - - - - - - - - - - ${score!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 学生学 - - - - - - - - - - - - - - - - - - - - - - - - - - - : - - - - - - - - - - - ${workNumber!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验学时 - - - - - - - - - - - - - - : - - - - - - - - - - - ${timeSum!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 指导老师 - - - - - - - - - - - - - - : - - - - - - - - - - - - ${instructor!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -102235 - - - 51435 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验项目名称 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${projectName!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -95250 - - - 71755 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验目的 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${purpose!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -47625 - - - 78740 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验数据 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 序号 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 判分点 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 考核点 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 参考答案 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 学生答案 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 分值 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 得分 - - - - - - <#list experimentalDataList as data> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.id!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.judgmentName!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.assessmentPoint!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.referenceAnswer!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.answer!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.quesScore!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.score!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -22860 - - - 64770 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验总结与体会 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${summarize!} - - - - - - - - - - - - - - - - - - - - - 1 - 151 - 191 - 0 - 0 - 1 - false - false - 518 - WPS Office_11.1.0.13703_F1E327BC-269C-435d-A152-05C5408002CA - 0 - - - - - - - 2022-03-25T03:10:00Z - Hello - rong - 2023-10-25T10:00:39Z - 1 - - - - - - - - 2052-11.1.0.13703 - - - 6688675D522C4567B48CD6A8387DA695 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAElBMVEUAAAAAfv8Afv8Afv8Afv8A - fv+el/cYAAAABXRSTlMAqpfd2z124asAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAAkSURBVCiRY2Cg - G2BFBkRKMDNCAAu6BBOUxUS0UcPeDlIlaAoAstwDOYaAcLoAAAAASUVORK5CYII= - - - - iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAALVBMVEUAAAAAfv8Afv8Ad/8Afv8A - fv8Aff8Aff8Af/8Afv8Af/8Aff8Afv8Af/8Afv9+TCfvAAAADnRSTlMA5MYD3Jr17IuJSx3Wo4N5 - 2H8AAAAJcEhZcwAADsQAAA7EAZUrDhsAAABUSURBVCiRvY3ZCoAwDARjNr21//+5YorQSyg+dJ4G - hmSJdiG5QqqQG7pwKGMwxcz6xeeGZcWOG1Cu9Ve/AvM8BMBPgouPRNcHTsUSN0ECXoU/aRc35zgI - 8eK691UAAAAASUVORK5CYII= - - - - iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAALVBMVEUAAAAAeP8Afv8Afv8Afv8A - e/8Afv8Af/8AgP8Aff8AgP8Afv8Af/8Afv8Afv+RS+oMAAAADnRSTlMADNRdph/Ep0TmYFXDRfNw - SsgAAAAJcEhZcwAADsQAAA7EAZUrDhsAAABvSURBVCiRvZDbEoAgCEQFNG/F/39uUI1jJtNT7YPD - nFUWce5XASLMePLMPj1wWPjQGgae+VK+O3o/EkV90/NNQIVCUKXockBzAZkRolbNEMRUNIFIDnw3 - zFZm+Dmun4xrf7CtZBm45syX6Oy1f6cdwqsGnX1mG3QAAAAASUVORK5CYII= - - - - iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAclBMVEUAAAAAfv8Afv8Ahf8Afv8A - fv8Afv8Afv8AfP8Afv8Afv8Afv8Af/8Af/8Afv8AgP8Aff8Afv8AgP8Af/8Aff8AgP8Ae/8Afv8A - fv8Afv8Afv8Af/8Af/8Afv8Afv8Af/8Aff8Af/8Afv8Af/8Aff8Afv/G+dOvAAAAJXRSTlMA990F - 7Mumggm9tpJiW0UmrI1STCweDunf0s6pn5aIh3pwb2g/g62ubAAAAAlwSFlzAAAOxAAADsQBlSsO - GwAAAJZJREFUKJG9j0cWwyAMBb8oBpe4xXZ6j+5/xZiwEqyTWen9UQHgn4ylMdWYxfrEu743XOhE - 1HxdIz/wIPOZz7EoaBbiwV0sJn7KTQS0SzcBVAvh2GsqVYmFnRAtb3BnbtDwVl5XB8AarZVK3hs6 - C4XXOinxVAVx3Kc/R0XWkE1OBy78Jd0E3KJoM+GieGeiUyG3PhM/5AOdtQnIhXjAuAAAAABJRU5E - rkJgghjj - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/occupationlab/src/main/resources/excel-template/export.ftl b/occupationlab/src/main/resources/excel-template/export.ftl deleted file mode 100644 index eabb225..0000000 --- a/occupationlab/src/main/resources/excel-template/export.ftl +++ /dev/null @@ -1,2984 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 标准实验报告 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 基本信息 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 学生姓名 - - - - - - - - - - - - - - : - - - - - - - - - - - ${userName!} - - - - - - - - - - - - - - - - - - - - - - - - - - - 试验时间 - - - - - - - - - - - - - : - - - - - - - - - - - ${submitTime!} - - - - - - - - - - - - - - - - - - - - - - - - - - - 学生班级 - - - - - - - - - - - - - : - - - - - - - - - - - ${className!} - - - - - - - - - - - - - - - - - - - - 实验成绩 - - - - - - - - - - - - - : - - - - - - - - - - - ${score!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 学号 - - - - - - - - - - - - - : - - - - - - - - - - - ${workNumber!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验学时 - - - - - - - - - - - - - : - - - - - - - - - - - ${timeSum!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - 指导老师 - - - - - - - - - - - - - : - - - - - - - - - - - ${instructor!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验项目名称 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${projectName!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验目的 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${purpose!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验 - - - - - - - - - - - - - - - - - 数据 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 序号 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 判分点 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 参考答案 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 学生答案 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 得分 - - - - - <#list experimentalDataList as data> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.id!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.judgmentName!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.referenceAnswer!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.answer!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.score!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验总结与体会 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${summarize!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - 87 - 290 - 0 - 0 - 1 - false - false - 616 - WPS Office_11.1.0.11365_F1E327BC-269C-435d-A152-05C5408002CA - 0 - - - - - - - 2022-03-25T03:10:00Z - Hello - Hello - 2022-03-25T03:26:55Z - 1 - - - - - - - - 2052-11.1.0.11365 - - - C90992013AE14A128CE039DC2F52DD41 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAElBMVEUAAAAAfv8Afv8Afv8Afv8A - fv+el/cYAAAABXRSTlMAqpfd2z124asAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAAkSURBVCiRY2Cg - G2BFBkRKMDNCAAu6BBOUxUS0UcPeDlIlaAoAstwDOYaAcLoAAAAASUVORK5CYII= - - - - iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAALVBMVEUAAAAAfv8Afv8Ad/8Afv8A - fv8Aff8Aff8Af/8Afv8Af/8Aff8Afv8Af/8Afv9+TCfvAAAADnRSTlMA5MYD3Jr17IuJSx3Wo4N5 - 2H8AAAAJcEhZcwAADsQAAA7EAZUrDhsAAABUSURBVCiRvY3ZCoAwDARjNr21//+5YorQSyg+dJ4G - hmSJdiG5QqqQG7pwKGMwxcz6xeeGZcWOG1Cu9Ve/AvM8BMBPgouPRNcHTsUSN0ECXoU/aRc35zgI - 8eK691UAAAAASUVORK5CYII= - - - - iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAALVBMVEUAAAAAeP8Afv8Afv8Afv8A - e/8Afv8Af/8AgP8Aff8AgP8Afv8Af/8Afv8Afv+RS+oMAAAADnRSTlMADNRdph/Ep0TmYFXDRfNw - SsgAAAAJcEhZcwAADsQAAA7EAZUrDhsAAABvSURBVCiRvZDbEoAgCEQFNG/F/39uUI1jJtNT7YPD - nFUWce5XASLMePLMPj1wWPjQGgae+VK+O3o/EkV90/NNQIVCUKXockBzAZkRolbNEMRUNIFIDnw3 - zFZm+Dmun4xrf7CtZBm45syX6Oy1f6cdwqsGnX1mG3QAAAAASUVORK5CYII= - - - - iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAclBMVEUAAAAAfv8Afv8Ahf8Afv8A - fv8Afv8Afv8AfP8Afv8Afv8Afv8Af/8Af/8Afv8AgP8Aff8Afv8AgP8Af/8Aff8AgP8Ae/8Afv8A - fv8Afv8Afv8Af/8Af/8Afv8Afv8Af/8Aff8Af/8Afv8Af/8Aff8Afv/G+dOvAAAAJXRSTlMA990F - 7Mumggm9tpJiW0UmrI1STCweDunf0s6pn5aIh3pwb2g/g62ubAAAAAlwSFlzAAAOxAAADsQBlSsO - GwAAAJZJREFUKJG9j0cWwyAMBb8oBpe4xXZ6j+5/xZiwEqyTWen9UQHgn4ylMdWYxfrEu743XOhE - 1HxdIz/wIPOZz7EoaBbiwV0sJn7KTQS0SzcBVAvh2GsqVYmFnRAtb3BnbtDwVl5XB8AarZVK3hs6 - C4XXOinxVAVx3Kc/R0XWkE1OBy78Jd0E3KJoM+GieGeiUyG3PhM/5AOdtQnIhXjAuAAAAABJRU5E - rkJggg== - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/occupationlab/src/main/resources/excel-template/exportBankExperimentReport.ftl b/occupationlab/src/main/resources/excel-template/exportBankExperimentReport.ftl deleted file mode 100644 index 7418bb6..0000000 --- a/occupationlab/src/main/resources/excel-template/exportBankExperimentReport.ftl +++ /dev/null @@ -1,3102 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 标准实验报告 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 基本信息 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 学生姓名 - - - - - - - - - - - - - - : - - - - - - - - - - - ${userName!} - - - - - - - - - - - - - - - - - - - - - - - - - - - 试验时间 - - - - - - - - - - - - - : - - - - - - - - - - - ${submitTime!} - - - - - - - - - - - - - - - - - - - - - - - - - - - 学生班级 - - - - - - - - - - - - - : - - - - - - - - - - - ${className!} - - - - - - - - - - - - - - - - - - - - 实验成绩 - - - - - - - - - - - - - : - - - - - - - - - - - ${score!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 学号 - - - - - - - - - - - - - : - - - - - - - - - - - ${workNumber!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验学时 - - - - - - - - - - - - - : - - - - - - - - - - - ${timeSum!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - 指导老师 - - - - - - - - - - - - - : - - - - - - - - - - - ${instructor!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验项目名称 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${projectName!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验目的 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${purpose!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验 - - - - - - - - - - - - - - - - - 数据 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 序号 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 判分点 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 考核点 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 参考答案 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 学生答案 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 得分 - - - - - <#list experimentalDataList as data> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.id!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.judgmentName!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.assessmentPoint!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.referenceAnswer!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.answer!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.score!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验总结与体会 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${summarize!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - 91 - 317 - 0 - 0 - 151 - false - false - 643 - WPS Office_11.1.0.11365_F1E327BC-269C-435d-A152-05C5408002CA - 0 - - - - - - - 2022-03-25T03:10:00Z - Hello - Hello - 2022-03-25T06:12:21Z - 1 - - - - - - - - 2052-11.1.0.11365 - - - 74A242D1521E43DCAA703F29EF0E76BC - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAElBMVEUAAAAAfv8Afv8Afv8Afv8A - fv+el/cYAAAABXRSTlMAqpfd2z124asAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAAkSURBVCiRY2Cg - G2BFBkRKMDNCAAu6BBOUxUS0UcPeDlIlaAoAstwDOYaAcLoAAAAASUVORK5CYII= - - - - iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAALVBMVEUAAAAAfv8Afv8Ad/8Afv8A - fv8Aff8Aff8Af/8Afv8Af/8Aff8Afv8Af/8Afv9+TCfvAAAADnRSTlMA5MYD3Jr17IuJSx3Wo4N5 - 2H8AAAAJcEhZcwAADsQAAA7EAZUrDhsAAABUSURBVCiRvY3ZCoAwDARjNr21//+5YorQSyg+dJ4G - hmSJdiG5QqqQG7pwKGMwxcz6xeeGZcWOG1Cu9Ve/AvM8BMBPgouPRNcHTsUSN0ECXoU/aRc35zgI - 8eK691UAAAAASUVORK5CYII= - - - - iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAALVBMVEUAAAAAeP8Afv8Afv8Afv8A - e/8Afv8Af/8AgP8Aff8AgP8Afv8Af/8Afv8Afv+RS+oMAAAADnRSTlMADNRdph/Ep0TmYFXDRfNw - SsgAAAAJcEhZcwAADsQAAA7EAZUrDhsAAABvSURBVCiRvZDbEoAgCEQFNG/F/39uUI1jJtNT7YPD - nFUWce5XASLMePLMPj1wWPjQGgae+VK+O3o/EkV90/NNQIVCUKXockBzAZkRolbNEMRUNIFIDnw3 - zFZm+Dmun4xrf7CtZBm45syX6Oy1f6cdwqsGnX1mG3QAAAAASUVORK5CYII= - - - - iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAclBMVEUAAAAAfv8Afv8Ahf8Afv8A - fv8Afv8Afv8AfP8Afv8Afv8Afv8Af/8Af/8Afv8AgP8Aff8Afv8AgP8Af/8Aff8AgP8Ae/8Afv8A - fv8Afv8Afv8Af/8Af/8Afv8Afv8Af/8Aff8Af/8Afv8Af/8Aff8Afv/G+dOvAAAAJXRSTlMA990F - 7Mumggm9tpJiW0UmrI1STCweDunf0s6pn5aIh3pwb2g/g62ubAAAAAlwSFlzAAAOxAAADsQBlSsO - GwAAAJZJREFUKJG9j0cWwyAMBb8oBpe4xXZ6j+5/xZiwEqyTWen9UQHgn4ylMdWYxfrEu743XOhE - 1HxdIz/wIPOZz7EoaBbiwV0sJn7KTQS0SzcBVAvh2GsqVYmFnRAtb3BnbtDwVl5XB8AarZVK3hs6 - C4XXOinxVAVx3Kc/R0XWkE1OBy78Jd0E3KJoM+GieGeiUyG3PhM/5AOdtQnIhXjAuAAAAABJRU5E - rkJggg== - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/occupationlab/src/main/resources/excel-template/now.ftl b/occupationlab/src/main/resources/excel-template/now.ftl deleted file mode 100644 index d117cb9..0000000 --- a/occupationlab/src/main/resources/excel-template/now.ftl +++ /dev/null @@ -1,2090 +0,0 @@ - - - - Administrator - rong - 2022-11-18T07:56:31Z - 2023-06-16T06:07:40Z - 4320 - 1 - 184 - 441 - 0 - 0 - 598 - 14 - - - 2052-11.1.0.13703 - ACD9B54CA54342F39DABFA5AFBBAC87E - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 标准实验报告 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 基本信息 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 学生姓名:${userName!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 学生学号:${workNumber!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验时间:${submitTime!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验成绩:${score!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 学生班级:${className!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 指导老师:${instructor!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验学时:${period!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验项目名称 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${projectName!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验目的 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${purpose!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验数据 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 序号 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 判分点 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 参考答案 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 分值 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 学生答案 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 运行结果 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 得分 - - - - - <#list experimentalDataList as data> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.id!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.judgmentName!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.referenceAnswer!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.quesScore!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.answer!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.runResult!} - - <#if data.runThePictureList??> - <#list data.runThePictureList as picture> - - - - - - - - - - - - - ${picture!} - - - - - - - - - - - - - - - - - <#-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.quesScore!} - - - --> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.score!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验总结与体会 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${summarize!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/occupationlab/src/main/resources/excel-template/practiceScoreList.ftl b/occupationlab/src/main/resources/excel-template/practiceScoreList.ftl deleted file mode 100644 index 1c52664..0000000 --- a/occupationlab/src/main/resources/excel-template/practiceScoreList.ftl +++ /dev/null @@ -1,886 +0,0 @@ - - - - Administrator - rong - 2023-07-31T09:46:07Z - 2023-07-31T09:50:25Z - 4320 - 1 - 32 - 32 - 0 - 0 - 32 - 14 - - - 2052-11.1.0.13703 - 00B6E100E7F8430F9122B2E4FC014355 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 课程名称:${goodsName} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 班级名称:${className} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 导出时间:${derivationTime} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 姓名 - - - - - - - - - - - - - - - - - - - - - - - - 学号 - - - - - - - - - - - - - - - - - - - - - - - - 项目名称 - - - - - - - - - - - - - - - - - - - - - - - - 平均练习时长 - - - - - - - - - - - - - - - - - - - - - - - - 平均分 - - - - - - <#list practicePerformanceData as data> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.userName!} - - - - - - - - - - - - - - - - - - - - - - - - 4533 - - - - - - - - - - - - - - - - - - - - - - - - 科目一 - - - - - - - - - - - - - - - - - - - - - - - - 90min - - - - - - - - - - - - - - - - - - - - - - - - 90 - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/occupationlab/src/main/resources/excel-template/programmingClassExperimentReportExport.ftl b/occupationlab/src/main/resources/excel-template/programmingClassExperimentReportExport.ftl deleted file mode 100644 index cf56b20..0000000 --- a/occupationlab/src/main/resources/excel-template/programmingClassExperimentReportExport.ftl +++ /dev/null @@ -1,1891 +0,0 @@ - - - - - Administrator - rong - 2022-11-18T07:56:31Z - 2023-06-16T03:41:06Z - 1440 - 1 - 176 - 453 - 0 - 0 - 610 - 14 - - - 2052-11.1.0.13703 - 99E93BE3C2BE433DB3FC698D72A4D84E - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 标准实验报告 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 基本信息 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 学生姓名:${userName!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 学生学号:${workNumber!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验时间:${submitTime!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验成绩:${score!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 学生班级:${className!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 指导老师:${instructor!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验学时:${timeSum!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验项目名称 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${projectName!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验目的 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${purpose!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验数据 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 序号 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 判分点 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 参考答案 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 学生答案 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 学生运行结果 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 得分 - - - - - - <#list experimentalDataList as data> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.id!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.judgmentName!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.referenceAnswer!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.answer!} - - - - <#if data.runThePictureList??> - <#list data.runThePictureList as picture> - - - - - - - - - - - - - ${picture!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.runResult!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.score!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验总结与体会 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${summarize!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/occupationlab/src/main/resources/excel-template/python.ftl b/occupationlab/src/main/resources/excel-template/python.ftl deleted file mode 100644 index f3812b6..0000000 --- a/occupationlab/src/main/resources/excel-template/python.ftl +++ /dev/null @@ -1,2072 +0,0 @@ - - - - - Administrator - rong - 2022-11-18T07:56:31Z - 2023-06-20T02:49:24Z - 2880 - 1 - 200 - 441 - 0 - 0 - 519 - 14 - - - 2052-11.1.0.13703 - D99024E4D5AF470BA29A9E76AF6CE8C6 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 标准实验报告 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 基本信息 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 学生姓名:${userName!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 学生学号:${workNumber!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验时间:${submitTime!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验成绩:${score!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 学生班级:${className!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 指导老师:${instructor!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验学时:${period!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验项目名称 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${projectName!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验目的 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${purpose!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验数据 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 序号 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 判分点 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 参考答案 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 学生答案 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 学生运行结果 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 分值 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 得分 - - - - - <#list experimentalDataList as data> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.id!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.judgmentName!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.referenceAnswer!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.answer!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.runResult!} - - <#if data.runThePictureList??> - <#list data.runThePictureList as picture> - - - - - - - - - - - - - - ${picture!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.quesScore!} - - <#-- - - - - - - - - - - - - - --> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.score!} - - <#-- - - - - - - - - - - - - - --> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验总结与体会 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${summarize!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/occupationlab/src/main/resources/excel-template/rong.ftl b/occupationlab/src/main/resources/excel-template/rong.ftl deleted file mode 100644 index 0889020..0000000 --- a/occupationlab/src/main/resources/excel-template/rong.ftl +++ /dev/null @@ -1,2054 +0,0 @@ - - - - - Administrator - rong - 2022-11-18T07:56:31Z - 2023-06-19T10:24:58Z - 0 - 2 - 196 - 452 - 0 - 0 - 610 - 14 - - - 2052-11.1.0.13703 - EF7DFBDD3EB5435B8946A481C09D6EAA - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 标准实验报告 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 基本信息 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 学生姓名:${userName!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 学生学号:${workNumber!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验时间:${submitTime!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验成绩:${score!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 学生班级:${className!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 指导老师:${instructor!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验学时:${period!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验项目名称 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${projectName!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验目的 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${purpose!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验数据 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 序号 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 判分点 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 参考答案 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 学生答案 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 学生运行结果 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 分值 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 得分 - - - - - <#list experimentalDataList as data> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.id!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.judgmentName!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.referenceAnswer!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.answer!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.runResult!} - - <#if data.runThePictureList??> - <#list data.runThePictureList as picture> - - - - - - - - - - - - - ${picture!} - - - - - - - - - - - - - - - <#-- - - - - - - - - - - - - - - - - - - - - - - --> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.quesScore!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${data.score!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 实验总结与体会 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${summarize!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/occupationlab/src/main/resources/excel-template/员工导入失败数据导出模板.xlsx b/occupationlab/src/main/resources/excel-template/员工导入失败数据导出模板.xlsx deleted file mode 100644 index 817bfe0..0000000 Binary files a/occupationlab/src/main/resources/excel-template/员工导入失败数据导出模板.xlsx and /dev/null differ diff --git a/occupationlab/src/main/resources/excel-template/学生导入失败数据导出模板.xlsx b/occupationlab/src/main/resources/excel-template/学生导入失败数据导出模板.xlsx deleted file mode 100644 index 5aaf60f..0000000 Binary files a/occupationlab/src/main/resources/excel-template/学生导入失败数据导出模板.xlsx and /dev/null differ diff --git a/occupationlab/src/main/resources/excel-template/练习实验成绩.xlsx b/occupationlab/src/main/resources/excel-template/练习实验成绩.xlsx deleted file mode 100644 index 61557ad..0000000 Binary files a/occupationlab/src/main/resources/excel-template/练习实验成绩.xlsx and /dev/null differ diff --git a/occupationlab/src/main/resources/excel-template/试题导入失败数据导出模板.xlsx b/occupationlab/src/main/resources/excel-template/试题导入失败数据导出模板.xlsx deleted file mode 100644 index 96a1301..0000000 Binary files a/occupationlab/src/main/resources/excel-template/试题导入失败数据导出模板.xlsx and /dev/null differ diff --git a/occupationlab/src/test/java/com/huoran/occupationlab/OccupationlabApplicationTests.java b/occupationlab/src/test/java/com/huoran/occupationlab/OccupationlabApplicationTests.java deleted file mode 100644 index 08e8927..0000000 --- a/occupationlab/src/test/java/com/huoran/occupationlab/OccupationlabApplicationTests.java +++ /dev/null @@ -1,153 +0,0 @@ -/* -package com.huoran.occupationlab; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.huoran.api.JudgmentPointClient; -import com.huoran.occupationlab.entity.HrProject; -import com.huoran.occupationlab.entity.HrScore; -import com.huoran.occupationlab.entity.ProjectJudgment; -import com.huoran.occupationlab.entity.ProjectManage; -import com.huoran.occupationlab.mapper.ProjectJudgmentMapper; -import com.huoran.occupationlab.mapper.ProjectManageMapper; -import org.apache.http.HttpEntity; -import org.apache.http.HttpStatus; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClientBuilder; -import org.apache.http.util.EntityUtils; -import org.junit.jupiter.api.Test; -import org.junit.runner.RunWith; -import org.springframework.amqp.core.AmqpAdmin; -import org.springframework.amqp.core.DirectExchange; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.util.ObjectUtils; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -*/ -/** - * 迁移项目管理已经项目管理中间表 - *//* - -@RunWith(SpringRunner.class) -@SpringBootTest -class OccupationlabApplicationTests { - - @Autowired - private ProjectManageMapper projectManageMapper; - - @Autowired - private ProjectJudgmentMapper projectJudgmentMapper; - - @Autowired - private JudgmentPointClient judgmentPointClient; - - @Autowired - AmqpAdmin amqpAdmin; - - @Test - void create() { - DirectExchange directExchange = new DirectExchange("java-exchanges",true,false); - amqpAdmin.declareExchange(directExchange); - } - - @Test - void contextLoads() { - - //判分点绑定为空 - List ret = new ArrayList<>(); - List retJudg = new ArrayList<>(); - - List ids = Arrays.asList(); - for (Integer id : ids) { - CloseableHttpClient httpClient = HttpClientBuilder.create().build(); - HttpGet httpGet = new HttpGet("http://www.occupationlab.com/project/ProjectManagement/getProjectId?projectId=" + id); - CloseableHttpResponse response = null; - - try { - response = httpClient.execute(httpGet);//执行请求 - if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {//请求成功执行 - HttpEntity entity = response.getEntity();//获取返回的数据 - String s = EntityUtils.toString(entity);//转换成字符串 - JSONObject datas = JSONObject.parseObject(s);//转换成JSON格式 - Integer status = (Integer) datas.get("status");//获取返回数据状态,get获取的字段需要根据提供的返回值去获取 - if (status == 200) {//返回的状态 - JSONArray data = JSONArray.parseArray(datas.get("message").toString()); - JSONObject Project = JSONObject.parseObject(data.get(0).toString()); - JSONArray Score = JSONArray.parseArray(data.get(1).toString()); - - HrProject hrProject = JSONObject.parseObject(Project.toString(), HrProject.class); - List hrScores = JSONArray.parseArray(Score.toString(), HrScore.class); - - if (ObjectUtils.isEmpty(hrProject)){ - - } - ProjectManage projectManage = new ProjectManage(); - projectManage.setProjectName(hrProject.getProjectName()); - projectManage.setState(hrProject.getState()); - projectManage.setPermissions(hrProject.getProjectPermissions()); - projectManage.setExperimentTarget(hrProject.getExperimentalGoal()); - projectManage.setExperimentDescription(hrProject.getCaseDescription()); - projectManage.setExperimentHint(hrProject.getExperimentSuggests()); - projectManage.setHintOpen(hrProject.getExperimentIntroductionIsEnable()); - projectManage.setIsDel(0); - projectManage.setIsOpen(0); - projectManage.setZtOpen(0); - projectManage.setZtDel(0); - projectManage.setFounder(0); - - - projectManage.setSystemId(10); - projectManageMapper.insert(projectManage); - - if (ObjectUtils.isEmpty(hrScores)){ - ret.add(hrProject.getProjectName()); - }else { - int i = 1; - List bands = new ArrayList<>(); - for (HrScore hrScore : hrScores) { - //查询对应判分点分数id - Integer bcId = projectJudgmentMapper.tempSelectBcId(hrScore.getJudgmentPointsName(),hrScore.getExperimentalRequirements()); - - //新增中间表 - ProjectJudgment projectJudgment = new ProjectJudgment(); - projectJudgment.setScore(hrScore.getScore()); - projectJudgment.setProjectId(projectManage.getProjectId()); - projectJudgment.setJudgmentId(bcId); - projectJudgment.setSort(i++); - projectJudgmentMapper.insert(projectJudgment); - - Thread.sleep(1000); - //判分点绑定中间表 - int bandcount = judgmentPointClient.bcBandingProject(bcId, projectManage.getProjectId(),1); - bands.add(bandcount); - } - if (bands.size() != hrScores.size()){ - retJudg.add(hrProject.getProjectName()); - } - } - - } - } - - } catch (IOException e) { - e.printStackTrace(); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - - ret.stream().peek((r) -> System.out.println(r)); - ret.forEach((r) -> System.out.println(r)); - retJudg.forEach((r) -> System.out.println()); - } - -} -*/ diff --git a/occupationlab/src/test/java/com/huoran/occupationlab/code/CodeGenerator.java b/occupationlab/src/test/java/com/huoran/occupationlab/code/CodeGenerator.java deleted file mode 100644 index 1b0dd44..0000000 --- a/occupationlab/src/test/java/com/huoran/occupationlab/code/CodeGenerator.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.huoran.occupationlab.code; - -import com.baomidou.mybatisplus.annotation.DbType; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.generator.AutoGenerator; -import com.baomidou.mybatisplus.generator.config.DataSourceConfig; -import com.baomidou.mybatisplus.generator.config.GlobalConfig; -import com.baomidou.mybatisplus.generator.config.PackageConfig; -import com.baomidou.mybatisplus.generator.config.StrategyConfig; -import com.baomidou.mybatisplus.generator.config.rules.DateType; -import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; -import org.junit.Test; - -/** - * @Author chen - * @DATE 2021/8/10 15:42 - * @Version 1.0 - */ -public class CodeGenerator { - - @Test - public void run() { - - // 1、创建代码生成器 - AutoGenerator mpg = new AutoGenerator(); - - // 2、全局配置 - GlobalConfig gc = new GlobalConfig(); - String projectPath = System.getProperty("user.dir"); - gc.setOutputDir(projectPath + "/src/main/java"); - - - gc.setAuthor("lr");//设置作者 - gc.setOpen(false); //生成后是否打开资源管理器 - gc.setFileOverride(false); //重新生成时文件是否覆盖 - gc.setServiceName("%sService"); //去掉Service接口的首字母I - gc.setIdType(IdType.ID_WORKER_STR); //主键策略 - gc.setDateType(DateType.ONLY_DATE);//定义生成的实体类中日期类型 - gc.setSwagger2(true);//开启Swagger2模式 - - mpg.setGlobalConfig(gc); - - // 3、数据源配置 - DataSourceConfig dsc = new DataSourceConfig(); - dsc.setUrl("jdbc:mysql://121.37.12.51:3308/occupationlab?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8"); - dsc.setDriverName("com.mysql.cj.jdbc.Driver"); - dsc.setUsername("root"); - dsc.setPassword("root"); - dsc.setDbType(DbType.MYSQL); - mpg.setDataSource(dsc); - - // 4、包配置 - PackageConfig pc = new PackageConfig(); - pc.setParent("com.huoran.occupationlab"); - //pc.setModuleName("occupationlab"); //模块名 - pc.setController("controller"); - pc.setEntity("entity"); - pc.setService("service"); - pc.setServiceImpl("service.impl"); - pc.setMapper("mapper"); - mpg.setPackageInfo(pc); - - // 5、策略配置 - StrategyConfig strategy = new StrategyConfig(); - strategy.setInclude("ol_school_project_hint_open"); - strategy.setNaming(NamingStrategy.underline_to_camel);//数据库表映射到实体的命名策略 - strategy.setTablePrefix("ol_"); //生成实体时去掉表前缀 - - strategy.setColumnNaming(NamingStrategy.underline_to_camel);//数据库表字段映射到实体的命名策略 - strategy.setEntityLombokModel(true); // lombok 模型 @Accessors(chain = true) setter链式操作 - - strategy.setRestControllerStyle(true); //restful api风格控制器 - strategy.setControllerMappingHyphenStyle(true); //url中驼峰转连字符 - - mpg.setStrategy(strategy); - - - // 6、执行 - mpg.execute(); - } -} diff --git a/pom.xml b/pom.xml index d2a842f..8d8b68d 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,6 @@ gateway nakadai users - occupationlab api competition websocket diff --git a/users/src/main/java/com/huoran/users/controller/HrUserAccountController.java b/users/src/main/java/com/huoran/users/controller/HrUserAccountController.java index ac60af9..ccd74c2 100644 --- a/users/src/main/java/com/huoran/users/controller/HrUserAccountController.java +++ b/users/src/main/java/com/huoran/users/controller/HrUserAccountController.java @@ -214,7 +214,7 @@ public class HrUserAccountController { //未登录情况判断,并返回token if (!StrUtil.isNotEmpty(accountId)) { accountId = iHrUserAccountService.getAccountId(checkVo); - token = JwtUtils.getJwtToken(accountId); +// token = JwtUtils.getJwtToken(accountId); } Integer userId = iHrUserAccountService.getUserIdByAccountId(accountId); R result = iHrUserInfoService.bindPhone(checkVo, userId); diff --git a/users/src/main/java/com/huoran/users/service/impl/HrUserInfoServiceImpl.java b/users/src/main/java/com/huoran/users/service/impl/HrUserInfoServiceImpl.java index 81d06bc..7c5b543 100644 --- a/users/src/main/java/com/huoran/users/service/impl/HrUserInfoServiceImpl.java +++ b/users/src/main/java/com/huoran/users/service/impl/HrUserInfoServiceImpl.java @@ -807,7 +807,7 @@ public class HrUserInfoServiceImpl extends ServiceImpl hrUserAccounts = getOtherAccount(loginVo.getAccount(), loginVo.getPlatform().toString()); hashMap.put("userAccounts", hrUserAccounts); if (hrUserAccounts.size()==1){ - hashMap.put("token", JwtUtils.getJwtToken(StringUtils.join(hrUserAccounts.get(0).getId()))); + hashMap.put("token", JwtUtils.getJwtToken(StringUtils.join(hrUserAccounts.get(0).getId()),0L, loginVo.getPlatform())); } return hashMap; } @@ -981,7 +981,7 @@ public class HrUserInfoServiceImpl extends ServiceImpl roles = userRoleService.queryAccountRoles(id); @@ -1339,7 +1339,7 @@ public class HrUserInfoServiceImpl extends ServiceImpl 0 && addAccount > 0){ LoginDTO loginDTO = new LoginDTO(); - loginDTO.setToken(JwtUtils.getJwtToken(userAccount.getId().toString())); +// loginDTO.setToken(JwtUtils.getJwtToken(userAccount.getId().toString())); return R.ok().put("data", loginDTO); } @@ -1647,7 +1647,7 @@ public class HrUserInfoServiceImpl extends ServiceImpl