Commit b0deefc5 authored by shulidong's avatar shulidong

Merge remote-tracking branch 'origin/master'

parents 0e4af394 84b4285e
...@@ -283,7 +283,6 @@ public class EntrustController { ...@@ -283,7 +283,6 @@ public class EntrustController {
//*******************样品检测***************************************** //*******************样品检测*****************************************
@ApiOperation(value = "派发样品检测-委托详情") @ApiOperation(value = "派发样品检测-委托详情")
@GetMapping("/getPFDtail/{id}") @GetMapping("/getPFDtail/{id}")
public BaseResponse getPFDtail(@PathVariable Integer id) { public BaseResponse getPFDtail(@PathVariable Integer id) {
......
...@@ -97,9 +97,17 @@ public class NonStandardValueController { ...@@ -97,9 +97,17 @@ public class NonStandardValueController {
@ApiOperation("导出-产值统计-非标产值信息列表") @ApiOperation("导出-产值统计-非标产值信息列表")
@PostMapping("/exportList") @PostMapping("/exportList")
public void exportList(String filename, Integer userId, String name, HttpServletResponse response) { public void exportList(String start, String end, Integer groups, String name, String filename, HttpServletResponse response) {
try { try {
inonStandardValueService.exportList(filename, userId, name, response); Date startParse = null;
if (StrUtil.isNotBlank(start)) {
startParse = DateUtil.parse(start);
}
Date endParse = null;
if (StrUtil.isNotBlank(end)) {
endParse = DateUtil.parse(end);
}
inonStandardValueService.exportList(startParse, endParse, groups, name, filename, response);
} catch (Exception e) { } catch (Exception e) {
log.debug("导出-产值统计-非标产值信息列表{}", e); log.debug("导出-产值统计-非标产值信息列表{}", e);
} }
......
...@@ -122,15 +122,15 @@ public class NormProductionController { ...@@ -122,15 +122,15 @@ public class NormProductionController {
@ApiOperation("产值统计-标准产值-分页列表") @ApiOperation("产值统计-标准产值-分页列表")
@ApiImplicitParams(value = { @ApiImplicitParams(value = {
@ApiImplicitParam(name = "startDate", value = "开始日期", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "start", value = "开始日期", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "endDate", value = "结束日期", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "end", value = "结束日期", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "userName", value = "姓名", paramType = "query", dataType = "String") @ApiImplicitParam(name = "userName", value = "姓名", paramType = "query", dataType = "String")
}) })
@GetMapping("/statistics") @GetMapping("/statistics")
public BaseResponse statistics(PageQuery pageQuery, String startDate, String endDate, String userName) { public BaseResponse statistics(PageQuery pageQuery, String start, String end, String userName) {
try { try {
return iPrecipriceService.normProductionStatistics(pageQuery, startDate, endDate, userName); return iPrecipriceService.normProductionStatistics(pageQuery, start, end, userName);
} catch (Exception e) { } catch (Exception e) {
log.debug("产值统计-标准产值-分页列表{}", e); log.debug("产值统计-标准产值-分页列表{}", e);
} }
......
...@@ -129,14 +129,18 @@ public class ReportController { ...@@ -129,14 +129,18 @@ public class ReportController {
private String getFirstSet(Set<String> set) { private String getFirstSet(Set<String> set) {
if(set != null && set.size()>0){
Iterator<String> iterator = set.iterator(); Iterator<String> iterator = set.iterator();
if (iterator.hasNext()) { if (iterator.hasNext()) {
return iterator.next(); return iterator.next();
} }
}
return ""; return "";
} }
private static Set<String> moveFirst(Set<String> set) { private static Set<String> moveFirst(Set<String> set) {
if(set != null && set.size()>0){
Set<String> newSet = new HashSet<>(set.size()); Set<String> newSet = new HashSet<>(set.size());
Iterator<String> iterator = set.iterator(); Iterator<String> iterator = set.iterator();
if (iterator.hasNext()) { if (iterator.hasNext()) {
...@@ -145,6 +149,7 @@ public class ReportController { ...@@ -145,6 +149,7 @@ public class ReportController {
newSet.remove(next); newSet.remove(next);
return newSet; return newSet;
} }
}
return null; return null;
} }
......
...@@ -31,6 +31,10 @@ public class WeiXinController { ...@@ -31,6 +31,10 @@ public class WeiXinController {
@Autowired @Autowired
private WeiXinService weiXinService; private WeiXinService weiXinService;
@Value("${spring.profiles.active}")
private String active;
@ApiOperation(value = "获取登录token-小程序端") @ApiOperation(value = "获取登录token-小程序端")
@GetMapping("/getToken") @GetMapping("/getToken")
public BaseResponse getToken(String code) { public BaseResponse getToken(String code) {
...@@ -39,10 +43,14 @@ public class WeiXinController { ...@@ -39,10 +43,14 @@ public class WeiXinController {
log.debug("code: {}", code); log.debug("code: {}", code);
log.debug("============================================="); log.debug("=============================================");
try { try {
if(active.equals("prod")){
//正式服务器
return weiXinService.getToken(code, "APP");
}else{
//测试服务器 //测试服务器
return weiXinService.getTestToken(code); return weiXinService.getTestToken(code);
//正式服务器 }
// return weiXinService.getToken(code, "APP");
} catch (Exception e) { } catch (Exception e) {
log.debug("获取登录token{}", e); log.debug("获取登录token{}", e);
} }
...@@ -53,10 +61,14 @@ public class WeiXinController { ...@@ -53,10 +61,14 @@ public class WeiXinController {
@GetMapping("/getPCToken") @GetMapping("/getPCToken")
public BaseResponse getPCToken(String code) { public BaseResponse getPCToken(String code) {
try { try {
if(active.equals("prod")){
//正式服务器
return weiXinService.getToken(code, "PC");
}else{
//测试服务器 //测试服务器
return weiXinService.getTestToken(code); return weiXinService.getTestToken(code);
//正式服务器 }
// return weiXinService.getToken(code, "PC");
} catch (Exception e) { } catch (Exception e) {
log.debug("获取登录token{}", e); log.debug("获取登录token{}", e);
} }
......
...@@ -134,7 +134,7 @@ public class Sample implements Serializable { ...@@ -134,7 +134,7 @@ public class Sample implements Serializable {
*/ */
public static String weight2Kg(String weight,Integer weightType){ public static String weight2Kg(String weight,Integer weightType){
String result = ""; String result = "";
if(StringUtils.isNotBlank(weight)){ if(StringUtils.isNotBlank(weight) && weightType != null ){
if(weightType == 1){ if(weightType == 1){
result = new BigDecimal(weight).divide(new BigDecimal(1000000000)).toString(); result = new BigDecimal(weight).divide(new BigDecimal(1000000000)).toString();
}else if(weightType == 2){ }else if(weightType == 2){
......
...@@ -28,6 +28,9 @@ public interface SampleDistributionMapper extends BaseMapper<SampleDistribution> ...@@ -28,6 +28,9 @@ public interface SampleDistributionMapper extends BaseMapper<SampleDistribution>
List<SampleDistributionTeamVo> getDistributionTeamList(@Param("sampleId") Integer sampleId, List<SampleDistributionTeamVo> getDistributionTeamList(@Param("sampleId") Integer sampleId,
@Param("userId") Integer userId); @Param("userId") Integer userId);
List<SampleDistributionTeamVo> getDistributionTeamList2(@Param("sampleId") Integer sampleId,
@Param("userId") Integer userId);
List<SampleDistributionTeamVo> getDistributionTeamResultList(@Param("sampleId") Integer sampleId, List<SampleDistributionTeamVo> getDistributionTeamResultList(@Param("sampleId") Integer sampleId,
@Param("userId") Integer userId); @Param("userId") Integer userId);
......
...@@ -459,6 +459,7 @@ ...@@ -459,6 +459,7 @@
LEFT JOIN team t ON t.id = sd.team_id LEFT JOIN team t ON t.id = sd.team_id
WHERE s.is_check = 1 and s.cement_code = s.parallel_code WHERE s.is_check = 1 and s.cement_code = s.parallel_code
and sd.status = 4 and sd.check_id is not null and sd.status = 4 and sd.check_id is not null
and sd.distribution_result is not null and sd.distribution_result <![CDATA[ <> ]]> ''
<if test="start != null and end != null"> <if test="start != null and end != null">
AND (sd.finish_time between #{start} and #{end}) AND (sd.finish_time between #{start} and #{end})
</if> </if>
...@@ -484,6 +485,7 @@ ...@@ -484,6 +485,7 @@
LEFT JOIN team t ON t.id = sd.team_id LEFT JOIN team t ON t.id = sd.team_id
WHERE s.is_check = 1 and s.cement_code = s.parallel_code WHERE s.is_check = 1 and s.cement_code = s.parallel_code
and sd.status = 4 and sd.check_id is not null and sd.status = 4 and sd.check_id is not null
and sd.distribution_result is not null and sd.distribution_result <![CDATA[ <> ]]> ''
<if test="start != null and end != null"> <if test="start != null and end != null">
AND (sd.finish_time between #{start} and #{end}) AND (sd.finish_time between #{start} and #{end})
</if> </if>
...@@ -515,6 +517,7 @@ ...@@ -515,6 +517,7 @@
,(select @i:=0)t ,(select @i:=0)t
WHERE s.is_check = 1 and s.cement_code = s.parallel_code WHERE s.is_check = 1 and s.cement_code = s.parallel_code
and sd.status = 4 and sd.check_id is not null and sd.status = 4 and sd.check_id is not null
and sd.distribution_result is not null and sd.distribution_result <![CDATA[ <> ]]> ''
<if test="start != null and end != null"> <if test="start != null and end != null">
AND (sd.finish_time between #{start} and #{end}) AND (sd.finish_time between #{start} and #{end})
</if> </if>
......
...@@ -77,6 +77,33 @@ ...@@ -77,6 +77,33 @@
order by t.id asc order by t.id asc
</select> </select>
<select id="getDistributionTeamList2" resultType="cn.wise.sc.cement.business.model.vo.SampleDistributionTeamVo">
select t.id as distributionId, su.id as userId, su.name as userName,
t.team_group_id as teamGroupId, tg.name as teamGroupName, s.id as teamId, s.name as teamName,
t.status as status,
(
CASE t.status
WHEN 0 THEN '未接受'
WHEN 1 THEN '接受'
WHEN 2 THEN '待校核'
WHEN 3 THEN '退回'
WHEN 4 THEN '校核通过'
WHEN 5 THEN '校核退回'
ELSE ''
END
) as statusValue
from sample_distribution t
left join sys_user su on su.id = t.user_id
left join team s on s.id = t.team_id
left join team_group tg on tg.id = t.team_group_id
where t.sample_id = #{sampleId}
<if test="userId != null">
and t.user_id = #{userId}
</if>
order by t.id asc
</select>
<select id="getDistributionTeamResultList" resultType="cn.wise.sc.cement.business.model.vo.SampleDistributionTeamVo"> <select id="getDistributionTeamResultList" resultType="cn.wise.sc.cement.business.model.vo.SampleDistributionTeamVo">
select t.id as distributionId, su.id as userId, su.name as userName, select t.id as distributionId, su.id as userId, su.name as userName,
t.team_group_id as teamGroupId, tg.name as teamGroupName, s.id as teamId, s.name as teamName, t.team_group_id as teamGroupId, tg.name as teamGroupName, s.id as teamId, s.name as teamName,
...@@ -111,7 +138,7 @@ ...@@ -111,7 +138,7 @@
t.team_id as teamId t.team_id as teamId
from sample_distribution t from sample_distribution t
left join sys_user su on su.id = t.user_id left join sys_user su on su.id = t.user_id
where t.sample_id = #{sampleId} where t.sample_id = #{sampleId} and t.status = 2
<if test="userId != null"> <if test="userId != null">
and t.user_id = #{userId} and t.user_id = #{userId}
</if> </if>
......
...@@ -6,6 +6,7 @@ import io.swagger.models.auth.In; ...@@ -6,6 +6,7 @@ import io.swagger.models.auth.In;
import lombok.Data; import lombok.Data;
import sun.java2d.loops.GeneralRenderer; import sun.java2d.loops.GeneralRenderer;
import javax.validation.constraints.Size;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
...@@ -37,6 +38,7 @@ public class SampleTmpQuery { ...@@ -37,6 +38,7 @@ public class SampleTmpQuery {
private String samplePhoto; private String samplePhoto;
@ApiModelProperty("样品重量") @ApiModelProperty("样品重量")
@Size(max =10, min=1)
private BigDecimal weight; private BigDecimal weight;
@ApiModelProperty("样品重量计量单位(1微克,2毫克,3克,4千克,5吨)") @ApiModelProperty("样品重量计量单位(1微克,2毫克,3克,4千克,5吨)")
......
...@@ -40,7 +40,8 @@ public interface INonStandardValueService extends IService<NonStandardValue> { ...@@ -40,7 +40,8 @@ public interface INonStandardValueService extends IService<NonStandardValue> {
BaseResponse<List<NonStandardValueVo>> getList(Date start, Date end, Integer groups, String name); BaseResponse<List<NonStandardValueVo>> getList(Date start, Date end, Integer groups, String name);
void exportList(String filename, Integer userId, String name, HttpServletResponse response);
void exportList(Date start, Date end, Integer groups, String name, String filename, HttpServletResponse response);
void exportDetailList(Date start, Date end, Integer userId, String name, String filename,HttpServletResponse response); void exportDetailList(Date start, Date end, Integer userId, String name, String filename,HttpServletResponse response);
} }
...@@ -480,7 +480,7 @@ public class DataStatisticsServiceImpl implements IDataStatisticsService { ...@@ -480,7 +480,7 @@ public class DataStatisticsServiceImpl implements IDataStatisticsService {
} }
} }
} }
ExcelUtil.excelExportNew(fileName == null || fileName.trim().length() <= 0 ? "委托列表" : fileName, wb, response); ExcelUtil.excelExportNew(fileName == null || fileName.trim().length() <= 0 ? "委托单进展统计" : fileName, wb, response);
} }
......
...@@ -175,6 +175,8 @@ public class NonStandardApplyServiceImpl extends ServiceImpl<NonStandardApplyMap ...@@ -175,6 +175,8 @@ public class NonStandardApplyServiceImpl extends ServiceImpl<NonStandardApplyMap
ExcelUtil.excelExport( ExcelUtil.excelExport(
filename == null || filename.trim().length() <= 0 ? "非标产值申请" : filename, headers, filename == null || filename.trim().length() <= 0 ? "非标产值申请" : filename, headers,
datas, response); datas, response);
}else{
Assert.notNull(loginUser, "不存在数据!");
} }
......
...@@ -163,8 +163,8 @@ public class NonStandardApprovalServiceImpl extends ServiceImpl<NonStandardAppro ...@@ -163,8 +163,8 @@ public class NonStandardApprovalServiceImpl extends ServiceImpl<NonStandardAppro
headers[3] = "统计日期"; headers[3] = "统计日期";
headers[4] = "上报工日"; headers[4] = "上报工日";
headers[5] = "审批工日"; headers[5] = "审批工日";
headers[6] = "状态"; headers[6] = "最终产值";
headers[7] = "最终产值"; headers[7] = "状态";
List<Object[]> datas = new ArrayList<>(list.size()); List<Object[]> datas = new ArrayList<>(list.size());
for (Map<String, Object> m : list) { for (Map<String, Object> m : list) {
......
...@@ -7,6 +7,7 @@ import cn.wise.sc.cement.business.model.BaseResponse; ...@@ -7,6 +7,7 @@ import cn.wise.sc.cement.business.model.BaseResponse;
import cn.wise.sc.cement.business.model.PageQuery; import cn.wise.sc.cement.business.model.PageQuery;
import cn.wise.sc.cement.business.model.vo.NonStandardApplyVo; import cn.wise.sc.cement.business.model.vo.NonStandardApplyVo;
import cn.wise.sc.cement.business.model.vo.NonStandardValueVo; import cn.wise.sc.cement.business.model.vo.NonStandardValueVo;
import cn.wise.sc.cement.business.model.vo.ProductionVo;
import cn.wise.sc.cement.business.service.INonStandardValueService; import cn.wise.sc.cement.business.service.INonStandardValueService;
import cn.wise.sc.cement.business.service.ISysUserService; import cn.wise.sc.cement.business.service.ISysUserService;
import cn.wise.sc.cement.business.util.ExcelUtil; import cn.wise.sc.cement.business.util.ExcelUtil;
...@@ -149,21 +150,19 @@ public class NonStandardValueServiceImpl extends ServiceImpl<NonStandardValueMap ...@@ -149,21 +150,19 @@ public class NonStandardValueServiceImpl extends ServiceImpl<NonStandardValueMap
/** /**
* 导出-产值统计-非标产值-信息列表 * 导出-产值统计-非标产值-信息列表
* @param filename 文件名 * @param start
* @param userId 用户id * @param end
* @param name 姓名 * @param groups
* @param name
* @param filename
* @param response * @param response
*/ */
@Override @Override
public void exportList(String filename, Integer userId, String name, HttpServletResponse response) { public void exportList(Date start, Date end, Integer groups, String name, String filename, HttpServletResponse response) {
List<NonStandardValue> list = nonValue(start, end, groups,name).getData();
Map<String, Object> params = new HashMap<>();
params.put("userId", userId);
params.put("name", name);
List<Map<String, Object>> list = nonStandardValueMapper.exportList(params);
if (!CollectionUtils.isEmpty(list)) { if (!CollectionUtils.isEmpty(list)) {
Map<String, Object> map = list.get(0); // Map<String, Object> map = list.get(0);
String[] headers = new String[6]; String[] headers = new String[6];
headers[0] = "序号"; headers[0] = "序号";
headers[1] = "姓名"; headers[1] = "姓名";
...@@ -172,17 +171,16 @@ public class NonStandardValueServiceImpl extends ServiceImpl<NonStandardValueMap ...@@ -172,17 +171,16 @@ public class NonStandardValueServiceImpl extends ServiceImpl<NonStandardValueMap
headers[4] = "审批工日"; headers[4] = "审批工日";
headers[5] = "最终产值"; headers[5] = "最终产值";
List<Object[]> datas = new ArrayList<>(list.size()); List<Object[]> datas = new ArrayList<>(list.size());
for (Map<String, Object> m : list) { int i = 0;
Object[] objects = new Object[headers.length]; for (NonStandardValue target : list) {
for (int j = 0; j < headers.length; j++) { Object[] objs = new Object[6];
String obj = m.get(headers[j]) == null ? "" : m.get(headers[j]).toString(); objs[0] = i++;
if (j == 0 && obj != null) { objs[1] = target.getName();
obj = obj.split("\\.")[0]; objs[2] = target.getAccount();
} objs[3] = target.getReportedHours();
objects[j] = obj; objs[4] = target.getApprovalHours();
} objs[5] = target.getFinalValue();
datas.add(objs);
datas.add(objects);
} }
ExcelUtil.excelExport( ExcelUtil.excelExport(
filename == null || filename.trim().length() <= 0 ? "非标产值" : filename, headers, filename == null || filename.trim().length() <= 0 ? "非标产值" : filename, headers,
......
...@@ -123,9 +123,7 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper, ...@@ -123,9 +123,7 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
if(normProduction.getType() == null){ if(normProduction.getType() == null){
return BaseResponse.errorMsg("类型不允许为空!"); return BaseResponse.errorMsg("类型不允许为空!");
} }
if(normProduction.getAssessId() == null){
return BaseResponse.errorMsg("对象id不允许为空!");
}
//如果是处理项 只能添加一次 //如果是处理项 只能添加一次
if(normProduction.getType() == 0){ if(normProduction.getType() == 0){
normProduction.setAssessId(null); normProduction.setAssessId(null);
...@@ -137,6 +135,9 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper, ...@@ -137,6 +135,9 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
return BaseResponse.errorMsg("当前处理项标准产值已存在!"); return BaseResponse.errorMsg("当前处理项标准产值已存在!");
} }
}else{ }else{
if(normProduction.getAssessId() == null){
return BaseResponse.errorMsg("对象id不允许为空!");
}
//判断配置项目是否已存在 //判断配置项目是否已存在
QueryWrapper<NormProduction> qw = new QueryWrapper<>(); QueryWrapper<NormProduction> qw = new QueryWrapper<>();
qw.eq("type", normProduction.getType()); qw.eq("type", normProduction.getType());
...@@ -216,9 +217,6 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper, ...@@ -216,9 +217,6 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
if(normProduction.getType() == null){ if(normProduction.getType() == null){
return BaseResponse.errorMsg("类型不允许为空!"); return BaseResponse.errorMsg("类型不允许为空!");
} }
if(normProduction.getAssessId() == null){
return BaseResponse.errorMsg("对象id不允许为空!");
}
NormProduction normProductionOld = this.getById(normProduction.getId()); NormProduction normProductionOld = this.getById(normProduction.getId());
if(normProductionOld == null){ if(normProductionOld == null){
return BaseResponse.errorMsg("信息错误!"); return BaseResponse.errorMsg("信息错误!");
...@@ -236,6 +234,9 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper, ...@@ -236,6 +234,9 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
return BaseResponse.errorMsg("当前处理项标准产值已存在!"); return BaseResponse.errorMsg("当前处理项标准产值已存在!");
} }
}else{ }else{
if(normProduction.getAssessId() == null){
return BaseResponse.errorMsg("对象id不允许为空!");
}
//判断配置项目是否已存在 //判断配置项目是否已存在
QueryWrapper<NormProduction> qw = new QueryWrapper<>(); QueryWrapper<NormProduction> qw = new QueryWrapper<>();
qw.eq("assess_id", normProduction.getAssessId()); qw.eq("assess_id", normProduction.getAssessId());
......
...@@ -131,7 +131,7 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr ...@@ -131,7 +131,7 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr
throw new IllegalArgumentException("联系管理员.配置产值信息!"); throw new IllegalArgumentException("联系管理员.配置产值信息!");
} }
preciprice.setAnalyseRate(BigDecimal.valueOf(normProduction.getAnalyseRate())); preciprice.setAnalyseRate(BigDecimal.valueOf(normProduction.getAnalyseRate()));
preciprice.setAssessRate(BigDecimal.valueOf(normProduction.getAssessId())); preciprice.setAssessRate(BigDecimal.valueOf(normProduction.getAssessRate()));
preciprice.setAssessValue(BigDecimal.valueOf(normProduction.getAssessValue())); preciprice.setAssessValue(BigDecimal.valueOf(normProduction.getAssessValue()));
preciprice.setReportedAnalyseResult(BigDecimal.valueOf(normProduction.getReportedAnalyseResult())); preciprice.setReportedAnalyseResult(BigDecimal.valueOf(normProduction.getReportedAnalyseResult()));
preciprice.setReportedResultRate(BigDecimal.valueOf(normProduction.getReportedResultRate())); preciprice.setReportedResultRate(BigDecimal.valueOf(normProduction.getReportedResultRate()));
...@@ -323,7 +323,7 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr ...@@ -323,7 +323,7 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr
if (!BeanUtil.isEmpty(userId)) { if (!BeanUtil.isEmpty(userId)) {
qw.eq("user_id", userId); qw.eq("user_id", userId);
} }
qw.eq("status", 1); // qw.eq("status", 1);
qw.orderByDesc("create_time"); qw.orderByDesc("create_time");
List<Preciprice> list = this.list(qw); List<Preciprice> list = this.list(qw);
List<NormProduction.NormProductionUserDetail> rts = new ArrayList<>(list.size()); List<NormProduction.NormProductionUserDetail> rts = new ArrayList<>(list.size());
...@@ -364,7 +364,7 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr ...@@ -364,7 +364,7 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr
List<Preciprice> teamlist = list.stream().filter(arg ->(arg.getType()==2)).collect(Collectors.toList()); List<Preciprice> teamlist = list.stream().filter(arg ->(arg.getType()==2)).collect(Collectors.toList());
if(teamlist != null && teamlist.size()>0){ if(teamlist != null && teamlist.size()>0){
Map<Integer, List<Preciprice>> mapByTeamId = teamGrouplist.stream().collect(Collectors.groupingBy(Preciprice::getTargetId, Collectors.toList())); Map<Integer, List<Preciprice>> mapByTeamId = teamlist.stream().collect(Collectors.groupingBy(Preciprice::getTargetId, Collectors.toList()));
for(Map.Entry<Integer, List<Preciprice>> entry : mapByTeamId.entrySet()){ for(Map.Entry<Integer, List<Preciprice>> entry : mapByTeamId.entrySet()){
NormProduction.NormProductionUserDetail UserDetailRts = new NormProduction.NormProductionUserDetail(); NormProduction.NormProductionUserDetail UserDetailRts = new NormProduction.NormProductionUserDetail();
UserDetailRts.setType(2); UserDetailRts.setType(2);
...@@ -408,7 +408,7 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr ...@@ -408,7 +408,7 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr
if (!BeanUtil.isEmpty(userId)) { if (!BeanUtil.isEmpty(userId)) {
qw.eq("user_id", userId); qw.eq("user_id", userId);
} }
qw.eq("status", 1); // qw.eq("status", 1);
qw.orderByDesc("create_time"); qw.orderByDesc("create_time");
List<Preciprice> list = this.list(qw); List<Preciprice> list = this.list(qw);
List<NormProduction.NormProductionUserDetail> rts = new ArrayList<>(list.size()); List<NormProduction.NormProductionUserDetail> rts = new ArrayList<>(list.size());
...@@ -472,7 +472,7 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr ...@@ -472,7 +472,7 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr
headers[3] = "数量"; headers[3] = "数量";
headers[4] = "合计"; headers[4] = "合计";
headers[5] = "产值设置:"; headers[5] = "产值设置参数:";
headers[6] = "额定工日"; headers[6] = "额定工日";
headers[7] = "报出对应分析结果"; headers[7] = "报出对应分析结果";
...@@ -497,13 +497,15 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr ...@@ -497,13 +497,15 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr
NormProductionVo vo = null; NormProductionVo vo = null;
if(target.getType() == 0){ if(target.getType() == 0){
vo =normProductions.stream() vo =normProductions.stream()
.filter(arg -> (arg.getType().equals("处理项") && arg.getAssessId()==null)).findFirst().get(); .filter(arg -> (arg.getType().equals("处理项") && arg.getAssessId()==null)).findFirst().orElse(null);
}else if(target.getType() == 1){ }else if(target.getType() == 1){
vo =normProductions.stream() vo = normProductions.stream()
.filter(arg -> (arg.getType().equals("检测组") && arg.getAssessId().equals(target.getObjId()))).findFirst().get(); .filter(arg -> (arg.getType().equals("检测组") && arg.getAssessId().equals(target.getObjId())))
.findFirst().orElse(null);
}else if(target.getType() == 2){ }else if(target.getType() == 2){
vo =normProductions.stream() vo =normProductions.stream()
.filter(arg -> (arg.getType().equals("检测项") && arg.getAssessId().equals(target.getObjId()))).findFirst().get(); .filter(arg -> (arg.getType().equals("检测项") && arg.getAssessId().equals(target.getObjId()))).findFirst().orElse(null);
} }
if(vo != null){ if(vo != null){
...@@ -568,7 +570,7 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr ...@@ -568,7 +570,7 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr
}else{ }else{
qw.eq("target_id", objId); qw.eq("target_id", objId);
} }
qw.eq("status", 1); // qw.eq("status", 1);
qw.orderByDesc("create_time"); qw.orderByDesc("create_time");
List<Preciprice> list = this.list(qw); List<Preciprice> list = this.list(qw);
List<NormProduction.NormProductionDetail> rts = new ArrayList<>(list.size()); List<NormProduction.NormProductionDetail> rts = new ArrayList<>(list.size());
...@@ -643,7 +645,7 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr ...@@ -643,7 +645,7 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr
}); });
//找到非标产值里面的数据 //找到非标产值里面的数据
nonStandardValues.forEach(opt -> { nonStandardValues.forEach(opt -> {
if (arg.equals(opt.getUserId())) { if (arg.equals(opt.getUserId().toString())) {
productionVo.setNonProductionValue(opt.getFinalValue()); productionVo.setNonProductionValue(opt.getFinalValue());
} }
}); });
...@@ -737,8 +739,8 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr ...@@ -737,8 +739,8 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr
BigDecimal analyseRateBig = BigDecimal.valueOf(rate); //分析占比 BigDecimal analyseRateBig = BigDecimal.valueOf(rate); //分析占比
return quotaDayBig.multiply(coefficientBig) return quotaDayBig.multiply(coefficientBig)
.divide(reportedAnalyseRtsBig, 2, RoundingMode.HALF_DOWN) .divide(reportedAnalyseRtsBig, 10,BigDecimal.ROUND_HALF_UP)
.multiply(assessValueBig).multiply(analyseRateBig) .multiply(assessValueBig).multiply(analyseRateBig)
.setScale(2, RoundingMode.HALF_DOWN); .setScale(2, BigDecimal.ROUND_HALF_UP);
} }
} }
...@@ -34,51 +34,6 @@ import java.util.List; ...@@ -34,51 +34,6 @@ import java.util.List;
* @author zhutianwei * @author zhutianwei
*/ */
public class ExcelUtil { public class ExcelUtil {
public static void excelLocal(String path, String fileName, String[] headers, List<Object[]> datas) {
Workbook workbook = getWorkbook(headers, datas);
if (workbook != null) {
ByteArrayOutputStream byteArrayOutputStream = null;
FileOutputStream fileOutputStream = null;
try {
byteArrayOutputStream = new ByteArrayOutputStream();
workbook.write(byteArrayOutputStream);
String suffix = ".xls";
File file = new File(path + File.separator + fileName + suffix);
if (!file.getParentFile().exists()) {
file.getParentFile().mkdirs();
}
fileOutputStream = new FileOutputStream(file);
fileOutputStream.write(byteArrayOutputStream.toByteArray());
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (fileOutputStream != null) {
fileOutputStream.close();
}
} catch (IOException e) {
e.printStackTrace();
}
try {
if (byteArrayOutputStream != null) {
byteArrayOutputStream.close();
}
} catch (IOException e) {
e.printStackTrace();
}
try {
workbook.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
/** /**
* 导出excel * 导出excel
* *
...@@ -217,11 +172,11 @@ public class ExcelUtil { ...@@ -217,11 +172,11 @@ public class ExcelUtil {
font.setBold(true); font.setBold(true);
font.setFontHeightInPoints((short) 13); font.setFontHeightInPoints((short) 13);
style.setFont(font); style.setFont(font);
style.setWrapText(true);
maxColumn = headers.length; maxColumn = headers.length;
for (int i = 0; i < maxColumn; i++) { for (int i = 0; i < maxColumn; i++) {
cell = row.createCell(i); cell = row.createCell(i);
sheet.setColumnWidth(i, Math.min(255*256, sheet.getColumnWidth(i) * 12 / 10));
XSSFFont xxsfFont = workbook.createFont(); XSSFFont xxsfFont = workbook.createFont();
//表头处理上下标 //表头处理上下标
...@@ -252,6 +207,7 @@ public class ExcelUtil { ...@@ -252,6 +207,7 @@ public class ExcelUtil {
if (datas != null && datas.size() > 0) {// 渲染数据 if (datas != null && datas.size() > 0) {// 渲染数据
CellStyle style = workbook.createCellStyle(); CellStyle style = workbook.createCellStyle();
style.setWrapText(true);
XSSFFont xxsfFont = workbook.createFont(); XSSFFont xxsfFont = workbook.createFont();
for (int index = 0, size = datas.size(); index < size; index++) { for (int index = 0, size = datas.size(); index < size; index++) {
...@@ -305,6 +261,8 @@ public class ExcelUtil { ...@@ -305,6 +261,8 @@ public class ExcelUtil {
for (int i = 0; i < maxColumn; i++) { for (int i = 0; i < maxColumn; i++) {
sheet.autoSizeColumn(i); sheet.autoSizeColumn(i);
//单元格自适应宽度
sheet.setColumnWidth(i, Math.max(15 * 256, Math.min(255 * 256, sheet.getColumnWidth(i) * 12 / 10)));
} }
return workbook; return workbook;
...@@ -411,6 +369,8 @@ public class ExcelUtil { ...@@ -411,6 +369,8 @@ public class ExcelUtil {
for (int i = 0; i < maxColumn; i++) { for (int i = 0; i < maxColumn; i++) {
sheet.autoSizeColumn(i); sheet.autoSizeColumn(i);
//单元格自适应宽度
sheet.setColumnWidth(i, Math.max(15 * 256, Math.min(255 * 256, sheet.getColumnWidth(i) * 12 / 10)));
} }
return workbook; return workbook;
......
...@@ -7,7 +7,7 @@ spring: ...@@ -7,7 +7,7 @@ spring:
profiles: profiles:
active: dev active: dev
datasource: datasource:
# 192.168.110.85 admin!@#123 sinoma_zhengshiData sinoma_tmp # 192.168.110.85 admin!@#123 sinoma_tcdri sinoma_zhengshiData sinoma_tmp
url: jdbc:mysql://192.168.110.85:3306/sinoma_zhengshiData?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false url: jdbc:mysql://192.168.110.85:3306/sinoma_zhengshiData?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root username: root
password: admin!@#123 password: admin!@#123
......
...@@ -1807,15 +1807,14 @@ ...@@ -1807,15 +1807,14 @@
<Borders> <Borders>
<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
</Borders> </Borders>
<Font ss:FontName="楷体" x:CharSet="134" x:Family="Modern" ss:Size="14"/> <Font ss:FontName="Times New Roman" x:CharSet="134" x:Family="Modern" ss:Size="12" ss:Color="#FF0000"/>
</Style> </Style>
<Style ss:ID="s179"> <Style ss:ID="s179">
<Alignment ss:Vertical="Bottom"/> <Alignment ss:Vertical="Bottom"/>
<Borders> <Borders>
<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
</Borders> </Borders>
<Font ss:FontName="Times New Roman" x:Family="Roman" ss:Size="12" <Font ss:FontName="Times New Roman" x:CharSet="134" x:Family="Modern" ss:Size="12" ss:Color="#FF0000"/>
ss:Color="#FF0000"/>
</Style> </Style>
<Style ss:ID="s180"> <Style ss:ID="s180">
<Alignment ss:Vertical="Bottom"/> <Alignment ss:Vertical="Bottom"/>
...@@ -3963,10 +3962,11 @@ ...@@ -3963,10 +3962,11 @@
<Row ss:AutoFitHeight="0" ss:Height="20"> <Row ss:AutoFitHeight="0" ss:Height="20">
<Cell ss:MergeDown="14" ss:StyleID="s166"><Data ss:Type="String">检测依据</Data><NamedCell <Cell ss:MergeDown="14" ss:StyleID="s166"><Data ss:Type="String">检测依据</Data><NamedCell
ss:Name="_FilterDatabase"/></Cell> ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="s167"><ss:Data ss:Type="String" <Cell ss:StyleID="s167">
xmlns="http://www.w3.org/TR/REC-html40"> <ss:Data ss:Type="String" xmlns="http://www.w3.org/TR/REC-html40">
<Font html:Face="楷体" x:Family="Modern">${firstMethodName}</Font><Font> </Font></ss:Data><NamedCell <Font html:Face="楷体" x:Family="Modern">${firstMethodName}</Font>
ss:Name="_FilterDatabase"/></Cell> <Font> </Font>
</ss:Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:Index="4" ss:StyleID="s168"><NamedCell ss:Name="_FilterDatabase"/></Cell> <Cell ss:Index="4" ss:StyleID="s168"><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:Index="9" ss:StyleID="s122"/> <Cell ss:Index="9" ss:StyleID="s122"/>
<Cell ss:StyleID="s122"/> <Cell ss:StyleID="s122"/>
...@@ -4052,9 +4052,16 @@ ...@@ -4052,9 +4052,16 @@
</Row> </Row>
</#if> </#if>
</#if> </#if>
<#--如果检测依据信息为空--> <#--如果检测依据信息为空-->
<#if ! methodNames??> <#if ! methodNames??>
<#list 1..(2-12) as i> <Row ss:AutoFitHeight="0" ss:Height="20">
<Cell ss:Index="2" ss:MergeAcross="2" ss:StyleID="m2194692801716"><Data
ss:Type="String">以下空白</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:Index="9" ss:StyleID="s122"/>
<Cell ss:StyleID="s122"/>
<Cell ss:StyleID="s122"/>
</Row>
<#list 1..(2-14) as i>
<Row ss:AutoFitHeight="0" ss:Height="17.25"> <Row ss:AutoFitHeight="0" ss:Height="17.25">
<Cell ss:Index="2" ss:StyleID="s167"><NamedCell ss:Name="_FilterDatabase"/></Cell> <Cell ss:Index="2" ss:StyleID="s167"><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="s173"><NamedCell ss:Name="_FilterDatabase"/></Cell> <Cell ss:StyleID="s173"><NamedCell ss:Name="_FilterDatabase"/></Cell>
...@@ -4078,19 +4085,16 @@ ...@@ -4078,19 +4085,16 @@
</#if> </#if>
<#-- 仪器设备 9 --> <#-- 仪器设备 9 -->
<#--插入第一个设备--> <#--插入第一个设备-->
<Row ss:AutoFitHeight="0" ss:Height="18" ss:StyleID="s173"> <Row ss:AutoFitHeight="0" ss:Height="18" >
<Cell ss:MergeDown="8" ss:StyleID="s187"><Data ss:Type="String">主要仪器设备(编号)</Data><NamedCell <Cell ss:MergeDown="8" ss:StyleID="s187"><Data ss:Type="String">主要仪器设备(编号)</Data><NamedCell
ss:Name="_FilterDatabase"/></Cell> ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="s178"> <Cell ss:StyleID="s167">
<ss:Data ss:Type="String" <ss:Data ss:Type="String" xmlns="http://www.w3.org/TR/REC-html40">
xmlns="http://www.w3.org/TR/REC-html40"> <Font html:Size="12">${firstEquipment}</Font><Font <Font html:Face="楷体" x:Family="Modern">${firstEquipment}</Font>
html:Face="Times New Roman" x:Family="Roman" html:Size="12"> </Font></ss:Data> <Font > </Font>
<NamedCell </ss:Data> <NamedCell ss:Name="_FilterDatabase"/></Cell>
ss:Name="_FilterDatabase"/></Cell> <Cell ss:Index="4" ss:StyleID="s168"><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:Index="4" ss:StyleID="s562"><NamedCell ss:Name="_FilterDatabase"/></Cell> <Cell ss:Index="9" ss:StyleID="s122"/>
<Cell ss:Index="6" ss:StyleID="s185"><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:Index="8" ss:StyleID="s122"><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="s122"/>
<Cell ss:StyleID="s122"/> <Cell ss:StyleID="s122"/>
<Cell ss:StyleID="s122"/> <Cell ss:StyleID="s122"/>
</Row> </Row>
...@@ -4098,8 +4102,8 @@ ...@@ -4098,8 +4102,8 @@
<#--如果设备信息不为空--> <#--如果设备信息不为空-->
<#if equipmentNames??> <#if equipmentNames??>
<#list equipmentNames as item> <#list equipmentNames as item>
<Row ss:AutoFitHeight="0" ss:Height="18"> <Row ss:AutoFitHeight="0" ss:Height="18" ss:StyleID="s173">
<Cell ss:Index="2" ss:StyleID="s179"> <Cell ss:Index="2" ss:StyleID="s167">
<ss:Data ss:Type="String" xmlns="http://www.w3.org/TR/REC-html40"> <ss:Data ss:Type="String" xmlns="http://www.w3.org/TR/REC-html40">
<Font html:Size="12">${item}</Font> <Font html:Size="12">${item}</Font>
<Font html:Face="Times New Roman" x:Family="Roman" html:Size="12"> </Font> <Font html:Face="Times New Roman" x:Family="Roman" html:Size="12"> </Font>
...@@ -4142,11 +4146,29 @@ ...@@ -4142,11 +4146,29 @@
</#if> </#if>
<#--如果设备为空--> <#--如果设备为空-->
<#if ! equipmentNames??> <#if ! equipmentNames??>
<Row ss:AutoFitHeight="0" ss:Height="20">
<Cell ss:Index="2" ss:MergeAcross="2" ss:StyleID="m2194692801716"><Data
ss:Type="String">以下空白</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:Index="9" ss:StyleID="s122"/>
<Cell ss:StyleID="s122"/>
<Cell ss:StyleID="s122"/>
</Row>
<#list 1..(2-8) as i> <#list 1..(2-8) as i>
<Row ss:AutoFitHeight="0" ss:Height="18"> <Row ss:AutoFitHeight="0" ss:Height="17.25">
<Cell ss:Index="2" ss:StyleID="s179"><NamedCell ss:Name="_FilterDatabase"/></Cell> <Cell ss:Index="2" ss:StyleID="s167"><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:Index="4" ss:StyleID="s563"><NamedCell ss:Name="_FilterDatabase"/></Cell> <Cell ss:StyleID="s173"><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:Index="8" ss:StyleID="s122"><NamedCell ss:Name="_FilterDatabase"/></Cell> <Cell ss:StyleID="s174"><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="s122"><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="s122"><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="s122"><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="s122"><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:Index="11" ss:StyleID="Default"/>
<Cell ss:StyleID="s122"/>
<Cell ss:StyleID="s122"/>
<Cell ss:StyleID="s122"/>
<Cell ss:StyleID="s122"/>
<Cell ss:StyleID="s122"/>
<Cell ss:StyleID="s122"/>
<Cell ss:StyleID="s122"/> <Cell ss:StyleID="s122"/>
<Cell ss:StyleID="s122"/> <Cell ss:StyleID="s122"/>
<Cell ss:StyleID="s122"/> <Cell ss:StyleID="s122"/>
......
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