fix-联动删除
This commit is contained in:
parent
071483db7c
commit
575e54536a
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.bjcj220907.dao;
|
||||
|
||||
import com.engine.bjcj220907.entity.CountMonthBonus;
|
||||
import com.engine.bjcj220907.entity.CountMonthBonusParam;
|
||||
import com.engine.bjcj220907.entity.DepartureInfo;
|
||||
import com.engine.bjcj220907.entity.JwCZInfoDetail;
|
||||
import weaver.conn.RecordSet;
|
||||
|
|
@ -182,7 +183,7 @@ public class MonthBonusDAO {
|
|||
* @author Harryxzy
|
||||
* @date 2022/9/13 11:01
|
||||
*/
|
||||
public void insertList(List<CountMonthBonus> result,List<Integer> departureUsers,Date bonusSendMonth) {
|
||||
public void insertList(List<CountMonthBonus> result,List<Integer> departureUsers,Date bonusSendMonth,Integer id) {
|
||||
RecordSetTrans rst = new RecordSetTrans();
|
||||
//事务处理,默认不自动提交
|
||||
rst.setAutoCommit(false);
|
||||
|
|
@ -198,15 +199,15 @@ public class MonthBonusDAO {
|
|||
SimpleDateFormat sdf3 = new SimpleDateFormat("HH:mm:ss");
|
||||
String currTime = sdf3.format(new Date());
|
||||
String currDate = TimeUtil.getCurrentDateString();
|
||||
String firstSql="insert into uf_jxdj(formmodeid,modedatacreater,modedatacreatertype,modedatacreatedate,modedatacreatetime,XM,YFJE,SFZH,KQYF,KQJD,SCQ,YCQ,QQ,JJJSKQ,KHJD,FFYF,XCDJ,JJJS,grjxdj,grjxxs) " +
|
||||
String firstSql="insert into uf_jxdj(formmodeid,modedatacreater,modedatacreatertype,modedatacreatedate,modedatacreatetime,XM,YFJE,SFZH,KQYF,KQJD,SCQ,YCQ,QQ,JJJSKQ,KHJD,FFYF,XCDJ,JJJS,grjxdj,grjxxs,jxrqid) " +
|
||||
"select '"+fieldValue+"','1','0','"+currDate+"','"+currTime+"'," + first.getXm() +","+first.getYfje()+",'"+first.getSfzh()+"','"+sdf.format(first.getKqyf())+"',"+first.getKqjd()+","+first.getScq()+","+
|
||||
first.getYcq()+","+first.getQq()+","+first.getJjjskq()+","+first.getKhjd()+",'"+ sdf.format(first.getFfyf())+"','"+first.getXcdj()+"',"+
|
||||
first.getYdjjjxjs()+","+first.getGrjxdj()+","+first.getGrjxxs()+" from dual ";
|
||||
first.getYdjjjxjs()+","+first.getGrjxdj()+","+first.getGrjxxs()+","+id+" from dual ";
|
||||
StringBuilder sql=new StringBuilder(firstSql);
|
||||
|
||||
for(int i=1;i<result.size();i++){
|
||||
CountMonthBonus r = result.get(i);
|
||||
sql.append(" union select '"+fieldValue+"','1','0','"+currDate+"','"+currTime+"'," +r.getXm() +","+r.getYfje()+",'"+r.getSfzh()+"','"+sdf.format(r.getKqyf())+"',"+r.getKqjd()+","+r.getScq()+","+r.getYcq()+","+r.getQq()+","+r.getJjjskq()+","+r.getKhjd()+",'"+sdf.format(r.getFfyf())+"','"+r.getXcdj()+"',"+r.getYdjjjxjs()+","+r.getGrjxdj()+","+r.getGrjxxs()+" from dual ");
|
||||
sql.append(" union select '"+fieldValue+"','1','0','"+currDate+"','"+currTime+"'," +r.getXm() +","+r.getYfje()+",'"+r.getSfzh()+"','"+sdf.format(r.getKqyf())+"',"+r.getKqjd()+","+r.getScq()+","+r.getYcq()+","+r.getQq()+","+r.getJjjskq()+","+r.getKhjd()+",'"+sdf.format(r.getFfyf())+"','"+r.getXcdj()+"',"+r.getYdjjjxjs()+","+r.getGrjxdj()+","+r.getGrjxxs()+","+id+" from dual ");
|
||||
}
|
||||
// 更新人员标识
|
||||
StringBuilder sql3 = null;
|
||||
|
|
@ -376,4 +377,25 @@ public class MonthBonusDAO {
|
|||
}
|
||||
return departure;
|
||||
}
|
||||
|
||||
/***
|
||||
* @description 获取绩效日期的ID
|
||||
* @return Integer
|
||||
* @author Harryxzy
|
||||
* @date 2022/9/20 15:12
|
||||
*/
|
||||
public Integer getydjxID(CountMonthBonusParam param) {
|
||||
RecordSet rs = new RecordSet();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
|
||||
String sendMonth = sdf.format(param.getBonusSendMonth());
|
||||
String month = sdf.format(param.getBonusMonth());
|
||||
String sql="select id from uf_ydjxzj where jxssyf='"+month+"' and jxffyf= '"+sendMonth+"'";
|
||||
rs.execute(sql);
|
||||
while (rs.next()){
|
||||
int id = rs.getInt("id");
|
||||
return id;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@ public class MonthBonusCountServiceImpl extends Service implements MonthBonusCou
|
|||
*/
|
||||
@Override
|
||||
public String countMonthBonus(CountMonthBonusParam param) {
|
||||
// 获取绩效日期的ID
|
||||
Integer id = getMonthBonusDAO().getydjxID(param);
|
||||
Date bonusMonth = param.getBonusMonth();
|
||||
Date bonusSendMonth = param.getBonusSendMonth();
|
||||
// 绩效所属季度
|
||||
|
|
@ -43,7 +45,6 @@ public class MonthBonusCountServiceImpl extends Service implements MonthBonusCou
|
|||
bonusCal.setTime(bonusMonth);
|
||||
int bonusYear = bonusCal.get(Calendar.YEAR);
|
||||
int bonusSeason =bonusCal.get(Calendar.MONTH)/3+1;
|
||||
|
||||
// 获取已经离职并且已经发放过绩效的人员信息
|
||||
baseBean.writeLog("获取已经离职并且已经发放过绩效的人员信息");
|
||||
List<Integer> haveSendDepartureInfo = getMonthBonusDAO().getHaveSendDepartureInfo().stream().map(i->i.getXm()).collect(Collectors.toList());
|
||||
|
|
@ -269,7 +270,7 @@ public class MonthBonusCountServiceImpl extends Service implements MonthBonusCou
|
|||
// 将数据插入建模中
|
||||
List<Integer> departureUsers = departureInfo.stream().map(i -> i.getXm()).collect(Collectors.toList());
|
||||
baseBean.writeLog("将数据插入建模中共:"+result.size());
|
||||
getMonthBonusDAO().insertList(result,departureUsers,bonusSendMonth);
|
||||
getMonthBonusDAO().insertList(result,departureUsers,bonusSendMonth,id);
|
||||
|
||||
return "null";
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue