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

产值优化

parent c6dfb54a
......@@ -122,15 +122,15 @@ public class NormProductionController {
@ApiOperation("产值统计-标准产值-分页列表")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "startDate", value = "开始日期", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "endDate", value = "结束日期", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "start", value = "开始日期", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "end", value = "结束日期", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "userName", value = "姓名", paramType = "query", dataType = "String")
})
@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 {
return iPrecipriceService.normProductionStatistics(pageQuery, startDate, endDate, userName);
return iPrecipriceService.normProductionStatistics(pageQuery, start, end, userName);
} catch (Exception e) {
log.debug("产值统计-标准产值-分页列表{}", e);
}
......
......@@ -31,6 +31,10 @@ public class WeiXinController {
@Autowired
private WeiXinService weiXinService;
@Value("${spring.profiles.active}")
private String active;
@ApiOperation(value = "获取登录token-小程序端")
@GetMapping("/getToken")
public BaseResponse getToken(String code) {
......@@ -39,10 +43,14 @@ public class WeiXinController {
log.debug("code: {}", code);
log.debug("=============================================");
try {
//测试服务器
return weiXinService.getTestToken(code);
//正式服务器
// return weiXinService.getToken(code, "APP");
if(active.equals("prod")){
//正式服务器
return weiXinService.getToken(code, "APP");
}else{
//测试服务器
return weiXinService.getTestToken(code);
}
} catch (Exception e) {
log.debug("获取登录token{}", e);
}
......@@ -53,10 +61,14 @@ public class WeiXinController {
@GetMapping("/getPCToken")
public BaseResponse getPCToken(String code) {
try {
//测试服务器
return weiXinService.getTestToken(code);
//正式服务器
// return weiXinService.getToken(code, "PC");
if(active.equals("prod")){
//正式服务器
return weiXinService.getToken(code, "PC");
}else{
//测试服务器
return weiXinService.getTestToken(code);
}
} catch (Exception e) {
log.debug("获取登录token{}", e);
}
......
......@@ -459,6 +459,7 @@
LEFT JOIN team t ON t.id = sd.team_id
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.distribution_result is not null and sd.distribution_result <![CDATA[ <> ]]> ''
<if test="start != null and end != null">
AND (sd.finish_time between #{start} and #{end})
</if>
......@@ -484,6 +485,7 @@
LEFT JOIN team t ON t.id = sd.team_id
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.distribution_result is not null and sd.distribution_result <![CDATA[ <> ]]> ''
<if test="start != null and end != null">
AND (sd.finish_time between #{start} and #{end})
</if>
......@@ -515,6 +517,7 @@
,(select @i:=0)t
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.distribution_result is not null and sd.distribution_result <![CDATA[ <> ]]> ''
<if test="start != null and end != null">
AND (sd.finish_time between #{start} and #{end})
</if>
......
......@@ -6,6 +6,7 @@ import io.swagger.models.auth.In;
import lombok.Data;
import sun.java2d.loops.GeneralRenderer;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
......@@ -37,6 +38,7 @@ public class SampleTmpQuery {
private String samplePhoto;
@ApiModelProperty("样品重量")
@Size(max =10, min=1)
private BigDecimal weight;
@ApiModelProperty("样品重量计量单位(1微克,2毫克,3克,4千克,5吨)")
......
......@@ -46,6 +46,7 @@ import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
/**
......@@ -318,6 +319,11 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
if (sampleTmpQuery.getWeight() == null) {
return BaseResponse.errorMsg("请填写样品重量");
}
if (sampleTmpQuery.getWeight().toString().length()>10) {
return BaseResponse.errorMsg("样品重量输入过长");
}
if (sampleTmpQuery.getWeightType() == null) {
return BaseResponse.errorMsg("请选择重量单位");
}
......@@ -571,6 +577,10 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
if (sampleQuery.getWeight() == null) {
return BaseResponse.errorMsg("请填写样品重量");
}
if (sampleQuery.getWeight().toString().length()>10) {
return BaseResponse.errorMsg("样品重量输入过长");
}
if (sampleQuery.getWeightType() == null) {
return BaseResponse.errorMsg("请选择重量单位");
}
......
......@@ -364,7 +364,7 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr
List<Preciprice> teamlist = list.stream().filter(arg ->(arg.getType()==2)).collect(Collectors.toList());
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()){
NormProduction.NormProductionUserDetail UserDetailRts = new NormProduction.NormProductionUserDetail();
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