Commit b33db56d authored by 竹天卫's avatar 竹天卫

产值优化

parent c6dfb54a
...@@ -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);
} }
......
...@@ -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.getTestToken(code); //正式服务器
//正式服务器 return weiXinService.getToken(code, "APP");
// return weiXinService.getToken(code, "APP"); }else{
//测试服务器
return weiXinService.getTestToken(code);
}
} 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 {
//测试服务器
return weiXinService.getTestToken(code); if(active.equals("prod")){
//正式服务器 //正式服务器
// return weiXinService.getToken(code, "PC"); return weiXinService.getToken(code, "PC");
}else{
//测试服务器
return weiXinService.getTestToken(code);
}
} catch (Exception e) { } catch (Exception e) {
log.debug("获取登录token{}", e); log.debug("获取登录token{}", e);
} }
......
...@@ -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>
......
...@@ -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吨)")
......
...@@ -46,6 +46,7 @@ import java.time.LocalDate; ...@@ -46,6 +46,7 @@ import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
import java.util.regex.Pattern;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -318,6 +319,11 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -318,6 +319,11 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
if (sampleTmpQuery.getWeight() == null) { if (sampleTmpQuery.getWeight() == null) {
return BaseResponse.errorMsg("请填写样品重量"); return BaseResponse.errorMsg("请填写样品重量");
} }
if (sampleTmpQuery.getWeight().toString().length()>10) {
return BaseResponse.errorMsg("样品重量输入过长");
}
if (sampleTmpQuery.getWeightType() == null) { if (sampleTmpQuery.getWeightType() == null) {
return BaseResponse.errorMsg("请选择重量单位"); return BaseResponse.errorMsg("请选择重量单位");
} }
...@@ -571,6 +577,10 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -571,6 +577,10 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
if (sampleQuery.getWeight() == null) { if (sampleQuery.getWeight() == null) {
return BaseResponse.errorMsg("请填写样品重量"); return BaseResponse.errorMsg("请填写样品重量");
} }
if (sampleQuery.getWeight().toString().length()>10) {
return BaseResponse.errorMsg("样品重量输入过长");
}
if (sampleQuery.getWeightType() == null) { if (sampleQuery.getWeightType() == null) {
return BaseResponse.errorMsg("请选择重量单位"); return BaseResponse.errorMsg("请选择重量单位");
} }
......
...@@ -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);
......
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