bug修复
This commit is contained in:
parent
935b22c059
commit
8cf04475f9
|
|
@ -8,6 +8,7 @@ import com.bonus.gs.sub.evaluate.manager.controller.BaseController;
|
|||
import com.bonus.gs.sub.evaluate.manager.utils.AjaxRes;
|
||||
import com.bonus.gs.sub.evaluate.manager.utils.GlobalConst;
|
||||
import com.bonus.gs.sub.evaluate.manager.utils.UserUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
|
@ -84,6 +85,9 @@ public class EvalSummaryController extends BaseController<EvaluateBean> {
|
|||
public AjaxRes evalSummaryList(EvalSummaryBean bean) {
|
||||
AjaxRes ar = getAjaxRes();
|
||||
try {
|
||||
if (StringUtils.isNotBlank(bean.getSearchDate())){
|
||||
bean.setStartDate(bean.getSearchDate());
|
||||
}
|
||||
List<OutSourceBean> list = service.getEvalSummaryList(bean);
|
||||
ar.setListSucceed(list);
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
|
|
@ -24,6 +24,10 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
|||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.OutputStream;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.*;
|
||||
|
||||
@Controller
|
||||
|
|
@ -58,6 +62,7 @@ public class OutsourcerEvaluateController extends BaseController<EvaluateSubBean
|
|||
AjaxRes ar = outsourcerEvaluateService.getCollectData(o);
|
||||
return ar;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/getTotalTitle", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public AjaxRes getTotalTitle(EvaluateSubBean o) {
|
||||
|
|
@ -65,6 +70,7 @@ public class OutsourcerEvaluateController extends BaseController<EvaluateSubBean
|
|||
AjaxRes ar = outsourcerEvaluateService.getTotalTitle(o);
|
||||
return ar;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/getCollectTitle", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public AjaxRes getCollectTitle(EvaluateSubBean o) {
|
||||
|
|
@ -97,6 +103,7 @@ public class OutsourcerEvaluateController extends BaseController<EvaluateSubBean
|
|||
|
||||
/**
|
||||
* 外包商评价
|
||||
*
|
||||
* @param o
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -152,6 +159,122 @@ public class OutsourcerEvaluateController extends BaseController<EvaluateSubBean
|
|||
return ar;
|
||||
}
|
||||
|
||||
@RequestMapping("exportExcelData")
|
||||
public void exportability(HttpServletRequest request, HttpServletResponse response, OutSourceBean o) {
|
||||
String filename = "退场班组评价";
|
||||
// 导出所有人员基本信息
|
||||
try {
|
||||
o.setDeptId(UserUtil.getLoginUser().getDeptId());
|
||||
String isBusinessDivision = outsourcerEvaluateDao.getIsBusinessDivision(o.getDeptId());
|
||||
if (!StringUtils.isBlank(isBusinessDivision) && "1".equals(isBusinessDivision)) {
|
||||
o.setIsBusinessDivision("1");
|
||||
} else {
|
||||
o.setIsBusinessDivision("0");
|
||||
}
|
||||
List<OutSourceBean> list = outsourcerEvaluateService.getEvaluateAuditList(o);
|
||||
excelOut(response, list, filename, "退场班组评价");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void excelOut(HttpServletResponse response, List<OutSourceBean> registlist, String filename, String sheetname)
|
||||
throws Exception {
|
||||
if (registlist != null) {
|
||||
List<Map<String, Object>> results = new ArrayList<Map<String, Object>>();
|
||||
int size = registlist.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
OutSourceBean bean = registlist.get(i);
|
||||
Map<String, Object> maps = outVehicleOilBeanMap(i, bean, sheetname);
|
||||
results.add(maps);
|
||||
}
|
||||
List<String> headers = outVehicleOilHeaders(sheetname);
|
||||
HSSFWorkbook workbook = POIOutputHelperNumBer.excel(results, headers, filename);
|
||||
OutputStream out = null;
|
||||
response.setContentType("application/vnd.ms-excel;charset=UTF-8");
|
||||
response.addHeader("Content-Disposition",
|
||||
"attachment;filename=" + URLEncoder.encode(filename, "UTF-8") + ".xls");
|
||||
response.setHeader("Pragma", "No-cache");
|
||||
out = response.getOutputStream();
|
||||
workbook.write(out);
|
||||
out.flush();
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
|
||||
private List<String> outVehicleOilHeaders(String sheetname) {
|
||||
ArrayList<String> list = new ArrayList<String>();
|
||||
list.add("序号");
|
||||
|
||||
switch (sheetname) {
|
||||
case "退场班组评价":
|
||||
list.add("评价事业部");
|
||||
list.add("评价标题");
|
||||
list.add("评价年月");
|
||||
list.add("项目数量");
|
||||
list.add("外包商数量");
|
||||
list.add("评价状态");
|
||||
list.add("审核状态");
|
||||
list.add("驳回原因");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
private Map<String, Object> outVehicleOilBeanMap(int i, OutSourceBean bean, String sheetname) {
|
||||
Map<String, Object> maps = new LinkedHashMap<String, Object>();
|
||||
maps.put("id", i + 1);
|
||||
switch (sheetname) {
|
||||
case "退场班组评价":
|
||||
maps.put("evaluateDept", bean.getEvaluateDept());
|
||||
maps.put("evaluateTitle", bean.getEvaluateTitle());
|
||||
maps.put("evaluateMonth", bean.getEvaluateMonth());
|
||||
maps.put("projectNum", bean.getProjectNum());
|
||||
maps.put("outsourcerNum", bean.getOutsourcerNum());
|
||||
if (bean.getIsApprove() == null) {
|
||||
bean.setIsApprove("0");
|
||||
}
|
||||
if (bean.getEvaluateNum() == null) {
|
||||
bean.setEvaluateNum("0");
|
||||
}
|
||||
if (bean.getIsAuditTask() == null) {
|
||||
bean.setIsAuditTask("0");
|
||||
}
|
||||
|
||||
if (Integer.parseInt(bean.getEvaluateNum()) > 0 && StringUtils.isNotBlank(bean.getRejectReason())) {
|
||||
maps.put("evaluateStatus", "评价驳回");
|
||||
} else if (Integer.parseInt(bean.getEvaluateNum()) > 0 && Integer.parseInt(bean.getIsAuditTask()) > 0) {
|
||||
maps.put("evaluateStatus", "已评价");
|
||||
} else if (Integer.parseInt(bean.getEvaluateNum()) > 0 && Integer.parseInt(bean.getIsAuditTask()) == 0) {
|
||||
maps.put("evaluateStatus", "评价中");
|
||||
} else {
|
||||
maps.put("evaluateStatus", "未评价");
|
||||
}
|
||||
|
||||
if (bean.getRejectReason() != null && !bean.getRejectReason().trim().isEmpty()) {
|
||||
maps.put("auditStatus", "已驳回");
|
||||
} else {
|
||||
if (Integer.parseInt(bean.getIsApprove()) > 0 && StringUtils.isNotBlank(bean.getRejectReason())) {
|
||||
maps.put("auditStatus", "已驳回");
|
||||
} else if (Integer.parseInt(bean.getIsApprove()) == 1) {
|
||||
maps.put("auditStatus", "已通过");
|
||||
} else if (Integer.parseInt(bean.getEvaluateNum()) > 0 && Integer.parseInt(bean.getIsApprove()) == 0) {
|
||||
maps.put("auditStatus", "待审批");
|
||||
} else {
|
||||
maps.put("auditStatus", "待评价");
|
||||
}
|
||||
}
|
||||
maps.put("rejectReason", bean.getRejectReason());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return maps;
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/getAuditTitleData", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public AjaxRes getAuditTitleData(EvaluateSubBean o) {
|
||||
|
|
@ -242,8 +365,10 @@ public class OutsourcerEvaluateController extends BaseController<EvaluateSubBean
|
|||
|
||||
return ar;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加到月度排名表
|
||||
*
|
||||
* @param o
|
||||
*/
|
||||
private void addMonthRank(EvaluateDataBean o) {
|
||||
|
|
@ -374,6 +499,7 @@ public class OutsourcerEvaluateController extends BaseController<EvaluateSubBean
|
|||
|
||||
/**
|
||||
* 查看第一级是否审核
|
||||
*
|
||||
* @param o
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -391,6 +517,7 @@ public class OutsourcerEvaluateController extends BaseController<EvaluateSubBean
|
|||
|
||||
/**
|
||||
* 查看第二级是否审核
|
||||
*
|
||||
* @param o
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -417,8 +544,10 @@ public class OutsourcerEvaluateController extends BaseController<EvaluateSubBean
|
|||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
/**
|
||||
* 专员审核
|
||||
*
|
||||
* @param o
|
||||
* @return
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -111,6 +111,15 @@ public class TeamEvaluateServiceImpl implements TeamEvaluateService {
|
|||
List<TeamEvaluateBean> list = null;
|
||||
try {
|
||||
bean.setEvUserId(Integer.parseInt(String.valueOf(UserUtil.getLoginUser().getId())));
|
||||
if ("5".equals(UserUtil.getLoginUser().getRoleId()) || Arrays.asList(UserUtil.getLoginUser().getRoleId().split(",")).contains("5")) {
|
||||
bean.setRoleId("5");
|
||||
} else if ("6".equals(UserUtil.getLoginUser().getRoleId()) || Arrays.asList(UserUtil.getLoginUser().getRoleId().split(",")).contains("6")) {
|
||||
bean.setRoleId("6");
|
||||
}else if ("1".equals(UserUtil.getLoginUser().getRoleId()) || Arrays.asList(UserUtil.getLoginUser().getRoleId().split(",")).contains("1")) {
|
||||
bean.setRoleId("1");
|
||||
}else{
|
||||
bean.setRoleId("0");
|
||||
}
|
||||
list = dao.getTeamEvaluateList(bean);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
|
|
|||
|
|
@ -58,8 +58,8 @@
|
|||
<if test="evaluateDeptId != null and evaluateDeptId != ''">
|
||||
and per.dept_id = #{evaluateDeptId}
|
||||
</if>
|
||||
<if test="searchDate != null and searchDate != ''">
|
||||
and per.year_and_month = #{searchDate}
|
||||
<if test="startDate != null and startDate != ''">
|
||||
and per.year_and_month = #{startDate}
|
||||
</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and per.evaluate_name like concat('%', #{keyWord}, '%' )
|
||||
|
|
@ -143,8 +143,8 @@
|
|||
<if test="evaluateDeptId != null and evaluateDeptId != ''">
|
||||
and per.dept_id = #{evaluateDeptId}
|
||||
</if>
|
||||
<if test="searchDate != null and searchDate != ''">
|
||||
and per.year_and_month = #{searchDate}
|
||||
<if test="startDate != null and startDate != ''">
|
||||
and per.year_and_month = #{startDate}
|
||||
</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and per.evaluate_name like concat('%', #{keyWord}, '%' )
|
||||
|
|
|
|||
|
|
@ -54,7 +54,8 @@
|
|||
</div>
|
||||
<div class="layui-inline" id="timeRange">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" autocomplete="off" id="startDate" class="layui-input" placeholder="请选择评价年月">
|
||||
<input type="text" autocomplete="off" id="startDate" class="layui-input"
|
||||
placeholder="请选择评价年月">
|
||||
</div>
|
||||
</div>
|
||||
<input type="text" name="operType" id="operType" value="1" hidden>
|
||||
|
|
@ -121,12 +122,24 @@
|
|||
keyWord: $("#keyWord").val(),
|
||||
evaluateDeptId: $("#evaluateDeptId").val(),
|
||||
evStatus: $("#evStatus").val(),
|
||||
auditStatus: $("#auditStatus").val(),
|
||||
startDate: $("#startDate").val(),
|
||||
endDate: $("#endDate").val(),
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function exportData() {
|
||||
let keyWord = $("#keyWord").val();
|
||||
let evaluateDeptId = $("#evaluateDeptId").val();
|
||||
let evStatus = $("#evStatus").val();
|
||||
let auditStatus = $("#auditStatus").val();
|
||||
let token = localStorage.getItem("token")
|
||||
let startDate = $("#startDate").val();
|
||||
let params = "?keyWord=" + keyWord + "&evStatus=" + evStatus + "&auditStatus=" + auditStatus + "&evaluateDeptId=" + evaluateDeptId + "&startDate=" + startDate + '&token=' + token;
|
||||
$(location).attr("href", ctxPath + '/outsourcer/exportExcelData' + params);
|
||||
}
|
||||
|
||||
function initTable() {
|
||||
let loginUser = localStorage.getItem("loginUser");
|
||||
let user = JSON.parse(loginUser);
|
||||
|
|
@ -136,8 +149,7 @@
|
|||
, url: ctxPath + '/outsourcer/getEvaluateAuditList' //数据接口
|
||||
, method: 'get' //方式默认是get
|
||||
, toolbar: 'default' //开启工具栏,此处显示默认图标,可以自定义模板,详见文档
|
||||
, where: {
|
||||
} //post请求必须加where ,post请求需要的参数
|
||||
, where: {} //post请求必须加where ,post请求需要的参数
|
||||
, cellMinWidth: 80
|
||||
, cols: [[ //表头
|
||||
{
|
||||
|
|
@ -251,7 +263,8 @@
|
|||
content: url,
|
||||
maxmin: false,
|
||||
area: ['90%', '95%'],
|
||||
success: function (layero, index) { },
|
||||
success: function (layero, index) {
|
||||
},
|
||||
end: function () {
|
||||
table.reload('baseTable', {
|
||||
url: ctxPath + '/outsourcer/getEvaluateAuditList',
|
||||
|
|
|
|||
Loading…
Reference in New Issue