Commit 464448a6 authored by 竹天卫's avatar 竹天卫

校核详情导出 & 标签导出

parent f40d98be
......@@ -855,51 +855,33 @@ public class EntrustController {
}
@ApiOperation(value = "查看样品标签")
@GetMapping("/getSampleLabelList")
public BaseResponse getSampleLabelList(Integer entrustId) {
try {
return entrustService.getSampleLabelList(entrustId);
} catch (Exception e) {
log.debug("查看样品标签{}", e);
}
return BaseResponse.errorMsg("失败!");
}
//todo 导出样品标签功能待完善
@PostMapping("/exportSampleLabel/{entrustId}")
@ApiOperation("导出样品标签")
@PostMapping("/exportSampleLabel/{entrustId}")
public void exportSampleLabel(@PathVariable("entrustId") Integer entrustId,
HttpServletResponse response) {
Map<String, Object> map = entrustService.getSampleLabelList(entrustId).getData();
if (map == null) {
return;
}
List<Sample> sampleList = (List<Sample>)map.get("list");
if (sampleList == null || sampleList.size()==0) {
return;
}
Entrust entrust = (Entrust)map.get("entrust");
Map<String, Object> beanParams = new HashMap<>(5);
String fileName, HttpServletResponse response) {
try {
entrustService.exportSampleLabel(entrustId, fileName, response);
//(不包含平行样)
List<SampleLabelVo> sampleLabelVoList = new ArrayList<>();
for(int i=0; i<sampleList.size(); i++){
SampleLabelVo sampleLabelVo = new SampleLabelVo();
i=i+4;
} catch (Exception e) {
log.debug("导出样品标签{}", e);
}
beanParams.put("list", sampleList);
WordUtil.writeWordReport(entrust.getEntrustCode() +"-"+ entrust.getProjectName() + "-样品标签",
"sampleFlow.ftl",
beanParams, response, FileExt.DOC);
}
@ApiOperation("导出-委托单校核详情")
@PostMapping("/exportCheckDetail/{entrustId}")
public void exportCheckDetail(@PathVariable("entrustId") Integer entrustId,
String fileName, HttpServletResponse response) {
try {
entrustService.exportCheckDetail(entrustId, fileName, response);
} catch (Exception e) {
log.debug("导出-委托单校核详情{}", e);
}
}
......
......@@ -57,7 +57,7 @@ public interface SampleMapper extends BaseMapper<Sample> {
@Select("select * from sample where entrust_id = #{entrustId} and cement_code= #{cementCode}")
List<Sample> getByCementCode(@Param("entrustId") Integer entrustId, @Param("cementCode") String cementCode);
@Select("select * from sample where entrust_id = #{entrustId} order by id asc")
@Select("select * from sample where entrust_id = #{entrustId} order by cement_code asc ")
List<Sample> getSampleCheckList(Integer entrustId);
List<SampleSaveDto> getSampleSaveList();
......
......@@ -45,7 +45,7 @@
<select id="exportList" resultType="java.util.HashMap">
SELECT
IF(ISNULL(na.id),'',na.id) as 序号,
(@i:=@i+1) as 序号,
IF(ISNULL(su.name),'',su.name) as 姓名,
IF(ISNULL(su.username),'',su.username) as 账户,
IF(ISNULL(na.statistical),'',na.statistical) as 统计日期,
......@@ -62,6 +62,7 @@
)as 状态
FROM nonstandard_apply na
left join sys_user su on na.user_id = su.id
,(select @i:=0)aa
<include refid="where"/>
order by na.start_time desc
</select>
......
......@@ -170,4 +170,7 @@
where sd.entrust_id = #{entrustId}
group by sd.sample_id,sd.user_id
</select>
</mapper>
......@@ -13,28 +13,18 @@ import lombok.Data;
@ApiModel("委托-样品标签打印Vo")
public class SampleLabelVo {
@ApiModelProperty("样品名")
private String sampleName1;
@ApiModelProperty("平行样编号")
private String parallelCode1;
@ApiModelProperty("样品名")
private String sampleName2;
@ApiModelProperty("平行样编号")
private String parallelCode2;
@ApiModelProperty("样品名")
private String sampleName3;
@ApiModelProperty("平行样编号")
private String parallelCode3;
@ApiModelProperty("样品名")
private String sampleName4;
@ApiModelProperty("平行样编号")
private String parallelCode4;
}
......@@ -180,15 +180,13 @@ public interface IEntrustService extends IService<Entrust> {
*/
BaseResponse<Map<String, Object>> getSampleFlowList(Integer entrustId);
/**
* 查看样品标签
* @param entrustId
* @return
*/
BaseResponse<Map<String, Object>> getSampleLabelList(Integer entrustId);
void exportSampleLabel(Integer entrustId,
String fileName, HttpServletResponse response);
void exportCheckDetail(Integer entrustId,
String fileName, HttpServletResponse response);
......
......@@ -380,6 +380,7 @@ public class DataStatisticsServiceImpl implements IDataStatisticsService {
QueryWrapper<Team> teamQueryWrapper = new QueryWrapper<>();
teamQueryWrapper.eq("is_display", 1);
teamQueryWrapper.eq("status", 1);
teamQueryWrapper.orderByAsc("group_id","sort_no");
List<Team> teamList = teamService.list(teamQueryWrapper);
//转化成id为key的map
......
......@@ -326,6 +326,9 @@ public class ExcelUtil {
public static XSSFRichTextString applyFontsub(String sub, XSSFFont xxsfFont) {
XSSFRichTextString richString = new XSSFRichTextString();
if (sub.contains("<sup>") || sub.contains("</sup>")) {
sub = sub.replaceAll("<sup>-</sup>", "⁻");
}
if (sub.contains("<sub>") || sub.contains("</sub>")) {
xxsfFont.setTypeOffset(FontFormatting.SS_SUB);
richString.setString(sub.replaceAll("</sub>", "<sub>").replaceAll("<sub>", ""));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment