Commit d849732d by 彭祥礼

增加楼长薪水管理

parent 8bdf41b7
package com.winsun.bean;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import lombok.Data;
import java.io.Serializable;
/**
* 〈楼长薪水管理〉
*
* @author pxl
* @create 2020/4/29 14:08
*/
@Data
@TableName("hhr_lz_wage")
public class LzWage implements Serializable {
/**
*
*/
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
*
*/
@TableField("month")
private String month;
/**
*
*/
@TableField("user_id")
private Integer userId;
/**
*放号充值数
*/
@TableField("recharge_num")
private Integer rechargeNum;
/**
* 放号薪酬
*/
@TableField("recharge_wage")
private double rechargeWage;
/**
* kpi总值
*/
@TableField("kpi")
private double kpi;
/**
* kpi薪酬
*/
@TableField("kpi_wage")
private double kpiWage;
/**
* 总薪酬
*/
@TableField("wage")
private double wage;
}
package com.winsun.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.winsun.bean.LzWage;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
/**
* 〈楼长薪水Mapper〉
*
* @author pxl
* @create 2020/4/29 14:25
*/
@Mapper
@Component
public interface LzWageMpapper extends BaseMapper<LzWage> {
}
......@@ -57,10 +57,6 @@ public class LzKpiController extends BaseController {
/**
* KPI信息模板列名
*/
private static String SL_sysuName = "姓名(必填)";
private static String SL_account = "账号(必填)";
private static String SL_substName = "县分(必填)";
private static String SL_schoolName = "学校(必填)";
private static String SL_reportDaily = "汇总任务量";
private static String SL_collectiveSales = "参与集中营销";
private static String SL_weeklyMeeting = "组织周例会";
......@@ -68,6 +64,10 @@ public class LzKpiController extends BaseController {
private static String SL_designPlan = "组织培训";
private static String SL_kpi = "KPI总值";
private static String SL_month = "KPI月份";
private static String SL_sysuName = "姓名(必填)";
private static String SL_account = "账号(必填)";
private static String SL_substName = "县分";
private static String SL_schoolName = "学校";
@Autowired
private LzKpiMapper lzKpiMapper;
......@@ -83,18 +83,37 @@ public class LzKpiController extends BaseController {
/**
* 正则添加
*
* @param lzkpi 添加对象json字符串
* @param lzKpi 添加对象json字符串
* @return
*/
@Permission(menuname = "添加正则信息", value = "insert", method = RequestMethod.POST)
public ResponseData<String> insertProduct(@RequestParam("lzkpi") String lzkpi) {
public ResponseData<String> insertProduct(@RequestParam("lzKpi") String lzKpi) {
ShiroUser user = getShiroUser();
if (!user.getRoleNames().stream().anyMatch(roleName -> StringUtils.equalsAny(roleName, "超级管理员"))) {
return ResponseData.error("无数据权限");
}
LzKpi pro = JSON.parseObject(lzkpi, LzKpi.class);
lzKpiMapper.insert(pro);
return ResponseData.success("添加成功!");
HashMap hashMap = JSON.parseObject(lzKpi, HashMap.class);
Wrapper<SysUser> sysWrapper = new EntityWrapper<>();
String account = hashMap.get("account").toString();
String substName = hashMap.get("substName").toString();
sysWrapper.eq(StringUtils.isNotBlank(account),"account",account);
sysWrapper.eq(StringUtils.isNotBlank(substName),"name",substName);
List<SysUser> sysUserList = sysUserMapper.selectList(sysWrapper);
if(sysUserList.size()>0){
LzKpi kpi = new LzKpi();
kpi.setUserId(sysUserList.get(0).getId());
kpi.setDesignPlan(Integer.valueOf(hashMap.get("designPlan").toString()));
kpi.setOrganTraining(Integer.valueOf(hashMap.get("organTraining").toString()));
kpi.setReportDaily(Integer.valueOf(hashMap.get("reportDaily").toString()));
kpi.setWeeklyMeeting(Integer.valueOf(hashMap.get("weeklyMeeting").toString()));
kpi.setCollectiveSales(Integer.valueOf(hashMap.get("collectiveSales").toString()));
kpi.setKpi(Integer.valueOf(hashMap.get("kpi").toString()));
kpi.setMonth(hashMap.get("month").toString());
kpi.setIsDel("0");
lzKpiMapper.insert(kpi);
return ResponseData.success("添加成功!");
}
return ResponseData.error("账号不存在?");
}
/**
......@@ -108,12 +127,16 @@ public class LzKpiController extends BaseController {
if (!user.getRoleNames().stream().anyMatch(roleName -> StringUtils.equalsAny(roleName, "超级管理员"))) {
return ResponseData.error("无数据权限");
}
Wrapper wrapper = new EntityWrapper<>();
wrapper.eq("id", id);
Map<String, Object> dataMapping = new HashMap<>();
dataMapping.put("is_del", isdel);
lzKpiMapper.updateForSet(MyBatisPlusUpdateUtils.toUpdateSet(dataMapping), wrapper);
return ResponseData.success("操作成功!");
//Wrapper wrapper = new EntityWrapper<>();
//wrapper.eq(StringUtils.isNotBlank(id),"id", id);
//Map<String, Object> dataMapping = new HashMap<>();
//dataMapping.put("is_del", isdel);
//lzKpiMapper.updateForSet(MyBatisPlusUpdateUtils.toUpdateSet(dataMapping), wrapper);
if(StringUtils.isNotBlank(id)){
lzKpiMapper.deleteById(id);
return ResponseData.success("操作成功!");
}
return ResponseData.error("删除id不能为空!");
}
/**
......@@ -195,6 +218,7 @@ public class LzKpiController extends BaseController {
Page<Map<String,Object>> page = new Page<>(pageNo, pageSize);
List<Map<String,Object>> dataList = new ArrayList<>();
List<Map<String,Object>> list = new ArrayList<>();
//redisTemplate.opsForValue().set(hcmap, hcmap, 60, TimeUnit.MINUTES);
List<String> userIds1 = new ArrayList<>();
......@@ -239,7 +263,6 @@ public class LzKpiController extends BaseController {
}
}
}
List<Map<String,Object>> list = new ArrayList<>();
Wrapper<LzKpi> wrapper = new EntityWrapper();
if(month.length()>7){
month = month.substring(0,7);
......@@ -366,7 +389,6 @@ public class LzKpiController extends BaseController {
}
for (LzKpi lzKpi : lzKpis) {
Map<String,Object> map = new HashMap<>();
map.put("id",lzKpi.getId());
map.put("reportDaily",lzKpi.getReportDaily());
map.put("collectiveSales",lzKpi.getCollectiveSales());
map.put("weeklyMeeting",lzKpi.getWeeklyMeeting());
......@@ -438,17 +460,17 @@ public class LzKpiController extends BaseController {
try {
//创建工作表
XSSFSheet sheet = workbook.createSheet("楼长KPI管理信息");
sheet.setColumnWidth(0, 2000);
sheet.setColumnWidth(1, 2000);
sheet.setColumnWidth(2, 2000);
sheet.setColumnWidth(3, 2000);
sheet.setColumnWidth(4, 2000);
sheet.setColumnWidth(5, 2000);
sheet.setColumnWidth(0, 3000);
sheet.setColumnWidth(1, 3000);
sheet.setColumnWidth(2, 3000);
sheet.setColumnWidth(3, 3000);
sheet.setColumnWidth(4, 3000);
sheet.setColumnWidth(5, 3000);
sheet.setColumnWidth(6, 5000);
sheet.setColumnWidth(7, 4000);
sheet.setColumnWidth(7, 5000);
sheet.setColumnWidth(8, 6000);
sheet.setColumnWidth(9, 3000);
sheet.setColumnWidth(10, 9000);
sheet.setColumnWidth(9, 4000);
sheet.setColumnWidth(10, 4000);
//下拉选项
/*List<String> fengju = new ArrayList<>();
fengju.add("受理不成功");
......@@ -556,9 +578,9 @@ public class LzKpiController extends BaseController {
if (!listMap.get(0).get("k").toString().equals(SL_schoolName)) {
return ResponseData.error("模板不对,请选择正确的模板!");
}
if (listMap.get(0).size() != 11) {
/*if (listMap.get(0).size() != 11) {
return ResponseData.error("模板不对,请选择正确的模板!");
}
}*/
List<String> accountList = new LinkedList<>();
List<Map<String,Object>> sysUserList = new LinkedList<>();
......@@ -620,7 +642,7 @@ public class LzKpiController extends BaseController {
if (StringUtils.isBlank(temp.get("i").toString())) {
return ResponseData.error("第" + (i + 1) + "行的账号不能为空");
}
if (!temp.containsKey("j")) {
/*if (!temp.containsKey("j")) {
return ResponseData.error("第" + (i + 1) + "行的县分不能为空");
}
if (StringUtils.isBlank(temp.get("j").toString())) {
......@@ -631,7 +653,7 @@ public class LzKpiController extends BaseController {
}
if (StringUtils.isBlank(temp.get("k").toString())) {
return ResponseData.error("第" + (i + 1) + "行的学校名不能为空");
}
}*/
if (temp.containsKey("i")) {
accountList.add(temp.get("i").toString());
}
......@@ -688,7 +710,7 @@ public class LzKpiController extends BaseController {
lzKpi.setMonth(month);
String userId = map.get("h").toString();
lzKpi.setUserId(userId);
lzKpi.setIsDel("0");
String userId0 = null;
if (StringUtils.isNotBlank(map.get("h").toString())) {
userId0 = map.get("h").toString();
......
......@@ -83,8 +83,8 @@ public class ExcelDealUtils {
public static Map<String, Object> kpiExcel(String sheetName){
Map<String, Object> headMap = new LinkedHashMap<String, Object>();
headMap.put("kpiId", "id");
headMap.put("用户名", "sysuName");
headMap.put("账号", "account");
headMap.put("用户名(必填)", "sysuName");
headMap.put("账号(必填)", "account");
headMap.put("县分", "substName");
headMap.put("学校", "schoolName");
headMap.put("汇总任务量", "reportDaily");
......@@ -101,6 +101,25 @@ public class ExcelDealUtils {
return resultMap;
}
// kpi管理导出excel表头
public static Map<String, Object> wageExcel(String sheetName){
Map<String, Object> headMap = new LinkedHashMap<String, Object>();
headMap.put("KPI月份", "month");
headMap.put("县分", "substName");
headMap.put("学校", "schoolName");
headMap.put("姓名(必填)", "sysuName");
headMap.put("账号(必填)", "account");
headMap.put("放号充值数", "rechargeNum");
headMap.put("放号薪酬", "rechargeWage");
headMap.put("kpi总值", "kpi");
headMap.put("kpi薪酬", "kpiWage");
headMap.put("总薪酬", "wage");
Map<String, Object> resultMap = dealHeadMap(headMap);
resultMap.put("sheetName", sheetName);
return resultMap;
}
// 账单导出excel表头
public static Map<String, Object> billExcel(String sheetName){
......
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