Browse Source

#检修工作票预览

zhongwei
yang_shj 1 month ago
parent
commit
5ccdd5d1d8
  1. 9
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/accessTicket/constants/AccessTicketConstants.java
  2. 5
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/accessTicket/vo/AccessTicketMeasureVo.java
  3. 27
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/accessTicket/vo/AccessTicketPreviewVo.java
  4. 10
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/controller/AccessTicketController.java
  5. 4
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/service/AccessTicketService.java
  6. 47
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/service/impl/AccessTicketServiceImpl.java
  7. 1
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/utils/AsposeUtil.java
  8. BIN
      hzims-service/ticket/src/main/resources/template/accessTicket/access_ticket_template.docx

9
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/accessTicket/constants/AccessTicketConstants.java

@ -17,4 +17,13 @@ public interface AccessTicketConstants {
// 检修延期
String ACCESS_EXTENSION = "extension";
String MEASURE_CODE_ONE = "1";
String MEASURE_CODE_TWO = "2";
String MEASURE_CODE_THREE = "3";
String MEASURE_CODE_FOUR = "4";
}

5
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/accessTicket/vo/AccessTicketMeasureVo.java

@ -13,5 +13,8 @@ public class AccessTicketMeasureVo {
private String code;
@ApiModelProperty("措施描述")
private String measures;
private String measure;
@ApiModelProperty("措施描述")
private String editMark;
}

27
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/accessTicket/vo/AccessTicketPreviewVo.java

@ -131,4 +131,31 @@ public class AccessTicketPreviewVo {
@ApiModelProperty("验收时间: 分")
private Integer chmi;
@ApiModelProperty("检修措施: 第一项")
private String measureContentOne;
@ApiModelProperty("检修措施勾选:第一项 ")
private String markOne;
@ApiModelProperty("检修措施: 第二项")
private String measureContentTwo;
@ApiModelProperty("检修措施勾选:第二项 ")
private String markTwo;
@ApiModelProperty("检修措施: 第三项")
private String measureContentThree;
@ApiModelProperty("检修措施勾选:第三项 ")
private String markThree;
@ApiModelProperty("检修措施: 第四项")
private String measureContentFour;
@ApiModelProperty("检修措施勾选:第四项 ")
private String markFour;
@ApiModelProperty("检修措施确认人")
private String measuresConfirmPersonnel;
}

10
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/controller/AccessTicketController.java

@ -16,8 +16,11 @@ import lombok.extern.slf4j.Slf4j;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.system.user.entity.User;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @author ysj
*/
@ -65,4 +68,11 @@ public class AccessTicketController extends BladeController {
public R<Boolean> revoke(@RequestParam("ticketId") Long ticketId) {
return R.status(accessTicketService.revoke(ticketId));
}
@GetMapping("/roleQueryUser")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "撤销报修")
public R<List<User>> roleQueryUser(@RequestParam("roleAlias") String roleAlias) {
return R.data(accessTicketService.roleQueryUser(roleAlias));
}
}

4
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/service/AccessTicketService.java

@ -10,8 +10,10 @@ import com.hnac.hzims.ticket.accessTicket.dto.response.AccessTicketDetailRspDTO;
import com.hnac.hzims.ticket.accessTicket.dto.response.AccessTicketPageRspDTO;
import com.hnac.hzims.ticket.accessTicket.entity.AccessTicketEntity;
import org.springblade.core.mp.support.Query;
import org.springblade.system.user.entity.User;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* @author ysj
@ -29,4 +31,6 @@ public interface AccessTicketService extends IService<AccessTicketEntity> {
boolean revoke(Long ticketId);
void preview(Long id);
List<User> roleQueryUser(String roleAlias);
}

47
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/service/impl/AccessTicketServiceImpl.java

@ -19,6 +19,7 @@ import com.hnac.hzims.ticket.accessTicket.dto.response.AccessTicketPageRspDTO;
import com.hnac.hzims.ticket.accessTicket.entity.AccessTicketEntity;
import com.hnac.hzims.ticket.accessTicket.mapper.AccessTicketMapper;
import com.hnac.hzims.ticket.accessTicket.service.AccessTicketService;
import com.hnac.hzims.ticket.accessTicket.vo.AccessTicketMeasureVo;
import com.hnac.hzims.ticket.accessTicket.vo.AccessTicketPreviewVo;
import com.hnac.hzims.ticket.utils.AsposeUtil;
import com.hnac.hzims.ticket.utils.PdfUtils;
@ -27,6 +28,7 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.*;
@ -412,6 +414,35 @@ public class AccessTicketServiceImpl extends ServiceImpl<AccessTicketMapper, Acc
params.setChd(check.get(Calendar.DAY_OF_MONTH));
params.setChh(check.get(Calendar.HOUR_OF_DAY));
params.setChmi(check.get(Calendar.MINUTE));
// 检修措施
params.setMeasuresConfirmPersonnel(access.getMeasuresConfirmPersonnel());
if(StringUtils.isNotEmpty(access.getMeasures())){
List<AccessTicketMeasureVo> measures = JSONObject.parseArray(access.getMeasures(),AccessTicketMeasureVo.class);
log.info("measures: {}",measures);
if(CollectionUtil.isNotEmpty(measures)){
measures.stream().sorted(Comparator.comparing(AccessTicketMeasureVo::getCode)).forEach(measure->{
switch (measure.getCode()) {
case AccessTicketConstants.MEASURE_CODE_ONE:
params.setMeasureContentOne(measure.getMeasure());
params.setMarkOne("true".equals(measure.getEditMark()) ? "√" : "");
break;
case AccessTicketConstants.MEASURE_CODE_TWO:
params.setMeasureContentTwo(measure.getMeasure());
params.setMarkTwo("true".equals(measure.getEditMark()) ? "√" : "");
break;
case AccessTicketConstants.MEASURE_CODE_THREE:
params.setMeasureContentThree(measure.getMeasure());
params.setMarkThree("true".equals(measure.getEditMark()) ? "√" : "");
break;
case AccessTicketConstants.MEASURE_CODE_FOUR:
params.setMeasureContentFour(measure.getMeasure());
params.setMarkFour("true".equals(measure.getEditMark()) ? "√" : "");
break;
}
});
}
}
return params;
}
@ -438,4 +469,20 @@ public class AccessTicketServiceImpl extends ServiceImpl<AccessTicketMapper, Acc
.eq(AccessTicketEntity::getId,ticketId)
);
}
/**
* 根据角色别名查询用户
* @param roleAlias
* @return
*/
@Override
public List<User> roleQueryUser(String roleAlias) {
BladeUser user = AuthUtil.getUser();
R<List<User>> users = userClient.queryUserByRoleAlias(user.getTenantId(), Long.valueOf(user.getDeptId()),roleAlias);
if(!users.isSuccess() || CollectionUtil.isEmpty(users.getData())){
return new ArrayList<>();
}
return users.getData();
}
}

1
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/utils/AsposeUtil.java

@ -10,6 +10,7 @@ import lombok.SneakyThrows;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.util.Arrays;
public class AsposeUtil {
/**

BIN
hzims-service/ticket/src/main/resources/template/accessTicket/access_ticket_template.docx

Binary file not shown.
Loading…
Cancel
Save