Commit 84b4285e authored by 竹天卫's avatar 竹天卫

禅道bug修复

parent 447160ae
...@@ -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);
} }
......
...@@ -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);
} }
...@@ -537,9 +537,9 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -537,9 +537,9 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
BeanUtils.copyProperties(query, entrust); BeanUtils.copyProperties(query, entrust);
//生成委托编号 //生成委托编号
// String entrustCode = commonService.createNo("WT", entrustMapper.counts()); // String entrustCode = commonService.createNo("WT", entrustMapper.counts());
if (entrust.getUserId() == loginUser.getId()) { if (entrust.getUserId() == loginUser.getId() && entrust.getStatus() == 2) {
entrust.setStatus(0); //未评审 entrust.setStatus(0); //未评审
} else if (approvalIdList.contains(loginUser.getId())) { } else if (approvalIdList.contains(loginUser.getId()) && entrust.getStatus() == 0 ) {
if (StringUtils.isEmpty(query.getProjectType())) { if (StringUtils.isEmpty(query.getProjectType())) {
return BaseResponse.errorMsg("请选择项目类型"); return BaseResponse.errorMsg("请选择项目类型");
} }
...@@ -651,7 +651,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -651,7 +651,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
} }
if (approvalIdList.contains(loginUser.getId())) { if (approvalIdList.contains(loginUser.getId()) && entrust.getStatus() == 9) {
//当前平行样编号最大值 //当前平行样编号最大值
String redisMaxCementCode = getMaxCementCode().getData(); String redisMaxCementCode = getMaxCementCode().getData();
//保存样品信息 //保存样品信息
...@@ -669,7 +669,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -669,7 +669,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
logsService.saveLog(SysLogs.ObjType.ENTRUST_LOG, entrust.getId(), "修改委托单", null); logsService.saveLog(SysLogs.ObjType.ENTRUST_LOG, entrust.getId(), "修改委托单", null);
//如果是委托人修改的 //如果是委托人修改的
if (entrust.getUserId() == loginUser.getId()) { if (entrust.getUserId() == loginUser.getId() && entrust.getStatus() == 0) {
//委托人员修改委托,提示评审人员查看 //委托人员修改委托,提示评审人员查看
String userIds = ""; String userIds = "";
for (Integer approvalId : approvalIdList) { for (Integer approvalId : approvalIdList) {
...@@ -692,7 +692,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -692,7 +692,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
System.out.println("**************************content**********************"); System.out.println("**************************content**********************");
System.out.println(content); System.out.println(content);
weiXinService.sendTextMessage(userIds, content); weiXinService.sendTextMessage(userIds, content);
} else if (approvalIdList.contains(loginUser.getId())) { } else if (approvalIdList.contains(loginUser.getId()) && entrust.getStatus() == 9) {
//如果是评审人员修改 //如果是评审人员修改
//评审人员修改委托,提示委托人查看 //评审人员修改委托,提示委托人查看
SysUser createUser = userService.getById(entrust.getUserId()); SysUser createUser = userService.getById(entrust.getUserId());
...@@ -1722,6 +1722,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -1722,6 +1722,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
if (integerLastCode <= integerMaxCode) { if (integerLastCode <= integerMaxCode) {
return BaseResponse.errorMsg("本所编号必须大于最大值"); return BaseResponse.errorMsg("本所编号必须大于最大值");
} }
//当前本所编号 截取的年份 //当前本所编号 截取的年份
String yearStr = commonService.getIntegerYear(lastCementCode); String yearStr = commonService.getIntegerYear(lastCementCode);
//平行样的集合(乱序) //平行样的集合(乱序)
...@@ -1735,8 +1736,10 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -1735,8 +1736,10 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
} }
} }
} }
for (SampleQuery sampleQuery : sampleQueryList) { for (SampleQuery sampleQuery : sampleQueryList) {
if (StringUtils.isEmpty(sampleQuery.getCementCode())) { if (StringUtils.isEmpty(sampleQuery.getCementCode())) {
return BaseResponse.errorMsg("本所编号不能为空"); return BaseResponse.errorMsg("本所编号不能为空");
} }
...@@ -5025,9 +5028,9 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -5025,9 +5028,9 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
if(StringUtils.isNoneBlank(methodNumbers)){ if(StringUtils.isNoneBlank(methodNumbers)){
String[] methodSplit = methodNumbers.split("、"); String[] methodSplit = methodNumbers.split("、");
for (String idStr : methodSplit) { for (String idStr : methodSplit) {
String id = Integer.parseInt(idStr) + ""; // String id = Integer.parseInt(idStr) + "";
methods.forEach(opt -> { methods.forEach(opt -> {
if (id.equals(opt.getNumber())) { if (idStr.equals(opt.getNumber())) {
if (StrUtil.isBlank(arg.getMethodName())) { if (StrUtil.isBlank(arg.getMethodName())) {
arg.setMethodName(opt.getName() + " " + opt.getStandard()); arg.setMethodName(opt.getName() + " " + opt.getStandard());
} else { } else {
......
...@@ -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,
......
...@@ -8,7 +8,7 @@ spring: ...@@ -8,7 +8,7 @@ spring:
active: dev active: dev
datasource: datasource:
# 192.168.110.85 admin!@#123 sinoma_tcdri 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_tcdri?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
driverClassName: com.mysql.cj.jdbc.Driver driverClassName: com.mysql.cj.jdbc.Driver
......
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