Browse Source

update: 更新演练&培训&会议模块部分逻辑

zhongwei
liwen 11 months ago
parent
commit
f169e1c657
  1. 2
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/constants/SafeProductConstant.java
  2. 2
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/ConferenceRecordEntity.java
  3. 56
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/BaseController.java
  4. 22
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java
  5. 8
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferencePlanMapper.xml
  6. 2
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalPlanMapper.xml
  7. 4
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferencePlanServiceImpl.java

2
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/constants/SafeProductConstant.java

@ -8,6 +8,8 @@ package com.hnac.hzims.safeproduct.constants;
*/
public interface SafeProductConstant {
String TENANT_ID = "200000";
int SUCCESS = 1;
int FAILURE = 0;

2
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/ConferenceRecordEntity.java

@ -37,7 +37,7 @@ public class ConferenceRecordEntity extends BaseEntity {
@ApiModelProperty("会议实际结束时间")
private Date actualEndTime;
@Size(max = 250, message = "记录人字段长度不能超过250")
@Size(max = 20, message = "记录人字段长度不能超过20")
@ApiModelProperty("记录人")
private String recorder;

56
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/BaseController.java

@ -0,0 +1,56 @@
package com.hnac.hzims.safeproduct.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.safeproduct.constants.SafeProductConstant;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.tool.api.R;
import org.springblade.system.feign.ISysClient;
import org.springblade.system.user.entity.User;
import org.springblade.system.user.feign.IUserClient;
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 liwen
* @date 2023-12-28
*/
@RestController
@AllArgsConstructor
@RequestMapping("/base")
@Api(value = "公用业务", tags = "公用业务接口")
public class BaseController extends BladeController {
private final ISysClient sysClient;
private final IUserClient userClient;
@GetMapping("/getDeptName")
@ApiOperation(value = "获取所属机构名")
@ApiOperationSupport(order = 1)
public R<String> getDeptName() {
BladeUser bladeUser = getUser();
String deptId = bladeUser.getDeptId();
if (StringUtils.isNotBlank(deptId)) {
return sysClient.getDeptName(Long.valueOf(deptId));
}
return R.data(null, "所属机构为空");
}
@GetMapping("/getUserList")
@ApiOperation(value = "获取用户列表")
@ApiOperationSupport(order = 2)
public R<List<User>> getUserList(@RequestParam String name) {
return userClient.userListByCodeAndNameAndAccount(SafeProductConstant.TENANT_ID, null, name, null);
}
}

22
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java

@ -21,12 +21,9 @@ import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.tool.api.R;
import org.springblade.system.feign.ISysClient;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
@ -55,8 +52,6 @@ public class TrainController extends BladeController {
private final ITestScoreService testScoreService;
private final ISysClient sysClient;
@PostMapping("/saveTrainPlan")
@ApiOperation(value = "新增培训计划")
@ApiOperationSupport(order = 1)
@ -224,18 +219,6 @@ public class TrainController extends BladeController {
return R.data(page);
}
@GetMapping("/getDeptName")
@ApiOperation(value = "获取所属机构名")
@ApiOperationSupport(order = 22)
public R<String> getDeptName() {
BladeUser bladeUser = getUser();
String deptId = bladeUser.getDeptId();
if (StringUtils.isNotBlank(deptId)) {
return sysClient.getDeptName(Long.valueOf(deptId));
}
return R.data(null, "所属机构为空");
}
@GetMapping("/exportTrainPlanData")
@ApiImplicitParams({
@ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"),
@ -243,7 +226,7 @@ public class TrainController extends BladeController {
@ApiImplicitParam(name = "scheduledEndTime", value = "计划结束时间", dataType = "query", paramType = "string")
})
@ApiOperation(value = "培训计划数据导出")
@ApiOperationSupport(order = 23)
@ApiOperationSupport(order = 22)
public void exportTrainPlanData(@ApiIgnore @RequestParam Map<String, Object> param, HttpServletResponse response) {
trainPlanService.exportTrainPlanData(param, response);
}
@ -253,9 +236,8 @@ public class TrainController extends BladeController {
@ApiImplicitParam(name = "trainPlanId", value = "培训计划id", dataType = "query", paramType = "string")
})
@ApiOperation(value = "培训记录数据导出")
@ApiOperationSupport(order = 24)
@ApiOperationSupport(order = 23)
public void exportTrainRecordData(@ApiIgnore @RequestParam Map<String, Object> param, HttpServletResponse response) {
trainRecordService.exportTrainRecordData(param, response);
}
}

8
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferencePlanMapper.xml

@ -10,13 +10,13 @@
LEFT JOIN hzims_conference_record t2 ON t1.id = t2.conference_plan_id
WHERE
t1.is_deleted = 0
<if test="unit != null and unit != ''">
AND t1.unit = #{unit}
<if test="unit != 'null' and unit != ''">
AND t1.unit like concat('%', #{unit}, '%')
</if>
<if test="startTime != null and startTime != ''">
<if test="startTime != 'null' and startTime != ''">
AND t1.scheduled_start_time >= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
<if test="endTime != 'null' and endTime != ''">
AND t1.scheduled_end_time &lt; #{endTime}
</if>
</select>

2
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalPlanMapper.xml

@ -72,7 +72,7 @@
WHERE
t1.is_deleted = 0
<if test="unit != 'null' and unit != ''">
AND t1.unit like #{unit}
AND t1.unit like concat('%', #{unit}, '%')
</if>
<if test="startTime != 'null' and startTime != ''">
AND t1.scheduled_start_time >= #{startTime}

4
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferencePlanServiceImpl.java

@ -10,11 +10,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.common.utils.Condition;
import com.hnac.hzims.safeproduct.dto.ConferenceExportDTO;
import com.hnac.hzims.safeproduct.dto.RehearsalExportDTO;
import com.hnac.hzims.safeproduct.entity.ConferencePlanEntity;
import com.hnac.hzims.safeproduct.enums.ConferenceMethodEnum;
import com.hnac.hzims.safeproduct.enums.ConferenceStatusEnum;
import com.hnac.hzims.safeproduct.enums.RehearsalStatusEnum;
import com.hnac.hzims.safeproduct.mapper.ConferencePlanMapper;
import com.hnac.hzims.safeproduct.service.IConferencePlanService;
import com.hnac.hzims.safeproduct.service.IConferenceRecordService;
@ -67,7 +65,7 @@ public class ConferencePlanServiceImpl extends ServiceImpl<ConferencePlanMapper,
String startTime = String.valueOf(param.get("startTime"));
String endTime = String.valueOf((param.get("endTime")));
if (!unit.equals("null") && !unit.equals("")) {
queryWrapper.lambda().eq(ConferencePlanEntity::getUnit, unit);
queryWrapper.lambda().like(ConferencePlanEntity::getUnit, unit);
}
if (!startTime.equals("null") && !startTime.equals("")) {
queryWrapper.lambda().ge(ConferencePlanEntity::getScheduledStartTime, startTime);

Loading…
Cancel
Save