UserWageServiceImpl.java 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497
  1. package cn.com.lzt.userwage.service.impl;
  2. import java.io.Serializable;
  3. import java.math.BigDecimal;
  4. import java.util.ArrayList;
  5. import java.util.HashMap;
  6. import java.util.List;
  7. import java.util.Map;
  8. import java.util.UUID;
  9. import org.apache.commons.collections.CollectionUtils;
  10. import org.apache.commons.lang3.StringUtils;
  11. import org.jeecgframework.core.common.model.json.AjaxJson;
  12. import org.jeecgframework.core.common.service.impl.CommonServiceImpl;
  13. import org.jeecgframework.core.constant.Globals;
  14. import org.jeecgframework.core.util.ApplicationContextUtil;
  15. import org.jeecgframework.core.util.JeecgDataAutorUtils;
  16. import org.jeecgframework.core.util.MyBeanUtils;
  17. import org.jeecgframework.core.util.MyClassLoader;
  18. import org.jeecgframework.core.util.StringUtil;
  19. import org.jeecgframework.minidao.annotation.Param;
  20. import org.jeecgframework.minidao.pojo.MiniDaoPage;
  21. import org.jeecgframework.web.cgform.enhance.CgformEnhanceJavaInter;
  22. import org.jeecgframework.web.system.pojo.base.TSDepart;
  23. import org.jeecgframework.web.system.pojo.base.TSUserOrg;
  24. import org.jeecgframework.web.system.service.SystemService;
  25. import org.springframework.beans.factory.annotation.Autowired;
  26. import org.springframework.stereotype.Service;
  27. import org.springframework.transaction.annotation.Transactional;
  28. import cn.com.lzt.arrangeduty.dto.ProjectDepartDto;
  29. import cn.com.lzt.userwage.dao.UserWageMinidaoDao;
  30. import cn.com.lzt.userwage.dto.UserWageDto;
  31. import cn.com.lzt.userwage.dto.UserWageViewDto;
  32. import cn.com.lzt.userwage.entity.UserWageEntity;
  33. import cn.com.lzt.userwage.service.UserWageServiceI;
  34. @Service("userWageService")
  35. @Transactional
  36. public class UserWageServiceImpl extends CommonServiceImpl implements UserWageServiceI {
  37. @Autowired
  38. UserWageMinidaoDao userWageMinidaoDao;
  39. @Autowired
  40. SystemService systemService;
  41. public void delete(UserWageEntity entity) throws Exception{
  42. super.delete(entity);
  43. //执行删除操作增强业务
  44. this.doDelBus(entity);
  45. }
  46. public Serializable save(UserWageEntity entity) throws Exception{
  47. Serializable t = super.save(entity);
  48. //执行新增操作增强业务
  49. this.doAddBus(entity);
  50. return t;
  51. }
  52. public void saveOrUpdate(UserWageEntity entity) throws Exception{
  53. super.saveOrUpdate(entity);
  54. //执行更新操作增强业务
  55. this.doUpdateBus(entity);
  56. }
  57. /**
  58. * 新增操作增强业务
  59. * @param t
  60. * @return
  61. */
  62. private void doAddBus(UserWageEntity t) throws Exception{
  63. //-----------------sql增强 start----------------------------
  64. //-----------------sql增强 end------------------------------
  65. //-----------------java增强 start---------------------------
  66. //-----------------java增强 end-----------------------------
  67. }
  68. /**
  69. * 更新操作增强业务
  70. * @param t
  71. * @return
  72. */
  73. private void doUpdateBus(UserWageEntity t) throws Exception{
  74. //-----------------sql增强 start----------------------------
  75. //-----------------sql增强 end------------------------------
  76. //-----------------java增强 start---------------------------
  77. //-----------------java增强 end-----------------------------
  78. }
  79. /**
  80. * 删除操作增强业务
  81. * @param id
  82. * @return
  83. */
  84. private void doDelBus(UserWageEntity t) throws Exception{
  85. //-----------------sql增强 start----------------------------
  86. //-----------------sql增强 end------------------------------
  87. //-----------------java增强 start---------------------------
  88. //-----------------java增强 end-----------------------------
  89. }
  90. private Map<String,Object> populationMap(UserWageEntity t){
  91. Map<String,Object> map = new HashMap<String,Object>();
  92. map.put("id", t.getId());
  93. map.put("userid", t.getUserid());
  94. map.put("belong_unitid", t.getBelongUnitid());
  95. map.put("dutiesid", t.getDutiesid());
  96. map.put("monthly", t.getMonthly());
  97. map.put("basic_wage", t.getBasicWage());
  98. map.put("duties_allowance", t.getDutiesAllowance());
  99. map.put("certificate_subsidy", t.getCertificateSubsidy());
  100. map.put("traffic_subsidy", t.getTrafficSubsidy());
  101. map.put("megathermal_subsidy", t.getMegathermalSubsidy());
  102. map.put("only_child_cost", t.getOnlyChildCost());
  103. map.put("other_subsidy", t.getOtherSubsidy());
  104. map.put("bonus", t.getBonus());
  105. map.put("project_performance", t.getProjectPerformance());
  106. map.put("meals_subsidy_day", t.getMealsSubsidyDay());
  107. map.put("meals_subsidy_night", t.getMealsSubsidyNight());
  108. map.put("meals_subsidy", t.getMealsSubsidy());
  109. map.put("overtimepay_timeout", t.getOvertimepayTimeout());
  110. map.put("overtimepay_fixed", t.getOvertimepayFixed());
  111. map.put("duty", t.getDuty());
  112. map.put("special_overtime", t.getSpecialOvertime());
  113. map.put("sick_leave_debit", t.getSickLeaveDebit());
  114. map.put("thing_leave_debit", t.getThingLeaveDebit());
  115. map.put("absence_debit", t.getAbsenceDebit());
  116. map.put("payment_subsidy", t.getPaymentSubsidy());
  117. map.put("social_security_debit", t.getSocialSecurityDebit());
  118. map.put("provident_fund_debit", t.getProvidentFundDebit());
  119. map.put("pre_tax_mone", t.getPreTaxMone());
  120. map.put("other_debit", t.getOtherDebit());
  121. map.put("daikou_debit", t.getDaikouDebit());
  122. map.put("reissue",t.getReissue());
  123. map.put("tax_money", t.getTaxMoney());
  124. map.put("actual_money", t.getActualMoney());
  125. map.put("status", t.getStatus());
  126. map.put("remark", t.getRemark());
  127. return map;
  128. }
  129. /**
  130. * 替换sql中的变量
  131. * @param sql
  132. * @param t
  133. * @return
  134. */
  135. public String replaceVal(String sql,UserWageEntity t){
  136. sql = sql.replace("#{id}",String.valueOf(t.getId()));
  137. sql = sql.replace("#{userid}",String.valueOf(t.getUserid()));
  138. sql = sql.replace("#{belong_unitid}",String.valueOf(t.getBelongUnitid()));
  139. sql = sql.replace("#{dutiesid}",String.valueOf(t.getDutiesid()));
  140. sql = sql.replace("#{monthly}",String.valueOf(t.getMonthly()));
  141. sql = sql.replace("#{basic_wage}",String.valueOf(t.getBasicWage()));
  142. sql = sql.replace("#{duties_allowance}",String.valueOf(t.getDutiesAllowance()));
  143. sql = sql.replace("#{certificate_subsidy}",String.valueOf(t.getCertificateSubsidy()));
  144. sql = sql.replace("#{traffic_subsidy}",String.valueOf(t.getTrafficSubsidy()));
  145. sql = sql.replace("#{megathermal_subsidy}",String.valueOf(t.getMegathermalSubsidy()));
  146. sql = sql.replace("#{only_child_cost}",String.valueOf(t.getOnlyChildCost()));
  147. sql = sql.replace("#{other_subsidy}",String.valueOf(t.getOtherSubsidy()));
  148. sql = sql.replace("#{bonus}",String.valueOf(t.getBonus()));
  149. sql = sql.replace("#{project_performance}",String.valueOf(t.getProjectPerformance()));
  150. sql = sql.replace("#{meals_subsidy_day}",String.valueOf(t.getMealsSubsidyDay()));
  151. sql = sql.replace("#{meals_subsidy_night}",String.valueOf(t.getMealsSubsidyNight()));
  152. sql = sql.replace("#{meals_subsidy}",String.valueOf(t.getMealsSubsidy()));
  153. sql = sql.replace("#{overtimepay_timeout}",String.valueOf(t.getOvertimepayTimeout()));
  154. sql = sql.replace("#{overtimepay_fixed}",String.valueOf(t.getOvertimepayFixed()));
  155. sql = sql.replace("#{duty}",String.valueOf(t.getDuty()));
  156. sql = sql.replace("#{special_overtime}",String.valueOf(t.getSpecialOvertime()));
  157. sql = sql.replace("#{sick_leave_debit}",String.valueOf(t.getSickLeaveDebit()));
  158. sql = sql.replace("#{thing_leave_debit}",String.valueOf(t.getThingLeaveDebit()));
  159. sql = sql.replace("#{absence_debit}",String.valueOf(t.getAbsenceDebit()));
  160. sql = sql.replace("#{payment_subsidy}",String.valueOf(t.getPaymentSubsidy()));
  161. sql = sql.replace("#{social_security_debit}",String.valueOf(t.getSocialSecurityDebit()));
  162. sql = sql.replace("#{provident_fund_debit}",String.valueOf(t.getProvidentFundDebit()));
  163. sql = sql.replace("#{pre_tax_mone}",String.valueOf(t.getPreTaxMone()));
  164. sql = sql.replace("#{other_debit}",String.valueOf(t.getOtherDebit()));
  165. sql = sql.replace("#{daikou_debit}",String.valueOf(t.getDaikouDebit()));
  166. sql = sql.replace("#{tax_money}",String.valueOf(t.getTaxMoney()));
  167. sql = sql.replace("#{actual_money}",String.valueOf(t.getActualMoney()));
  168. sql = sql.replace("#{reissue}",String.valueOf(t.getReissue()));
  169. sql = sql.replace("#{status}",String.valueOf(t.getStatus()));
  170. sql = sql.replace("#{remark}",String.valueOf(t.getRemark()));
  171. sql = sql.replace("#{UUID}",UUID.randomUUID().toString());
  172. return sql;
  173. }
  174. /**
  175. * 执行JAVA增强
  176. */
  177. private void executeJavaExtend(String cgJavaType,String cgJavaValue,Map<String,Object> data) throws Exception {
  178. if(StringUtil.isNotEmpty(cgJavaValue)){
  179. Object obj = null;
  180. try {
  181. if("class".equals(cgJavaType)){
  182. //因新增时已经校验了实例化是否可以成功,所以这块就不需要再做一次判断
  183. obj = MyClassLoader.getClassByScn(cgJavaValue).newInstance();
  184. }else if("spring".equals(cgJavaType)){
  185. obj = ApplicationContextUtil.getContext().getBean(cgJavaValue);
  186. }
  187. if(obj instanceof CgformEnhanceJavaInter){
  188. CgformEnhanceJavaInter javaInter = (CgformEnhanceJavaInter) obj;
  189. javaInter.execute("t_bus_user_wage",data);
  190. }
  191. } catch (Exception e) {
  192. e.printStackTrace();
  193. throw new Exception("执行JAVA增强出现异常!");
  194. }
  195. }
  196. }
  197. @Override
  198. public List<UserWageDto> getAllEntities(UserWageDto userWageDto,List<String> uidList,String moth,String authSql) {
  199. return userWageMinidaoDao.getAllEntities(userWageDto,uidList,moth,authSql);
  200. }
  201. @Override
  202. public MiniDaoPage<UserWageDto> getPagedEntities(UserWageDto userWageDto,List<String> uidList,String moth,int page, int rows, String authSql) {
  203. return userWageMinidaoDao.getPagedEntities(userWageDto,uidList,moth,page, rows,authSql);
  204. }
  205. @Override
  206. public List<UserWageDto> getAll(UserWageDto userWageDto,List<String> uidList,String moth,String authSql) {
  207. return userWageMinidaoDao.getAll(userWageDto,uidList,moth,authSql);
  208. }
  209. @Override
  210. public MiniDaoPage<UserWageViewDto> getViewEntities(UserWageViewDto userWageViewDto,List<String> uidList,int page, int rows,String authSql) {
  211. return userWageMinidaoDao.getViewEntities(userWageViewDto,uidList, page, rows, authSql);
  212. }
  213. @Override
  214. public Map<String, Integer> getMoneySUM(UserWageDto userWageDto,List<String> uidList,String moth) {
  215. return userWageMinidaoDao.getMoneySUM(userWageDto,uidList,moth);
  216. }
  217. @Override
  218. public BigDecimal getMoney(UserWageEntity userWageDto) {
  219. // if("ff8080816275ac02016283c8b3a30025".equals(userWageDto.getUserid())) {
  220. // System.out.println("ff8080816275ac02016283c8b3a30025");
  221. // }
  222. BigDecimal big = new BigDecimal(userWageDto.getBasicWage().toString());
  223. if(userWageDto.getDutiesAllowance() != null){
  224. big = big.add(userWageDto.getDutiesAllowance());
  225. }
  226. if(userWageDto.getCertificateSubsidy() != null){
  227. big = big.add(userWageDto.getCertificateSubsidy());
  228. }
  229. if(userWageDto.getTrafficSubsidy()!= null){
  230. big = big.add(userWageDto.getTrafficSubsidy());
  231. }
  232. if(userWageDto.getMegathermalSubsidy()!= null){
  233. big = big.add(userWageDto.getMegathermalSubsidy());
  234. }
  235. if(userWageDto.getOnlyChildCost()!= null){
  236. big = big.add(userWageDto.getOnlyChildCost());
  237. }
  238. if(userWageDto.getOtherSubsidy()!= null){
  239. big = big.add(userWageDto.getOtherSubsidy());
  240. }
  241. if(userWageDto.getDuty()!= null){
  242. big = big.add(userWageDto.getDuty());
  243. }
  244. if(userWageDto.getProjectPerformance()!= null){
  245. big = big.add(userWageDto.getProjectPerformance());
  246. }
  247. if(userWageDto.getMealsSubsidyDay()!= null){
  248. big = big.add(userWageDto.getMealsSubsidyDay());
  249. }
  250. if(userWageDto.getMealsSubsidyNight()!= null){
  251. big = big.add(userWageDto.getMealsSubsidyNight());
  252. }
  253. // // 奖金和项目绩效计入应发 zy 20180425
  254. if(userWageDto.getBonus()!= null){
  255. big = big.add(userWageDto.getBonus());
  256. }
  257. if(userWageDto.getProjectPerformance()!= null){
  258. big = big.add(userWageDto.getProjectPerformance());
  259. }
  260. if(userWageDto.getMealsSubsidy()!= null){
  261. big = big.add(userWageDto.getMealsSubsidy());
  262. }
  263. if(userWageDto.getOvertimepayTimeout()!= null){
  264. big = big.add(userWageDto.getOvertimepayTimeout());
  265. }
  266. if(userWageDto.getOvertimepayFixed()!= null){
  267. big = big.add(userWageDto.getOvertimepayFixed());
  268. }
  269. /* if(userWageDto.getDuty()!= null){
  270. big = big.add(userWageDto.getDuty());
  271. }*/
  272. if(userWageDto.getSpecialOvertime()!= null){
  273. big = big.add(userWageDto.getSpecialOvertime());
  274. }
  275. if(userWageDto.getSickLeaveDebit()!= null){
  276. big = big.subtract(userWageDto.getSickLeaveDebit());
  277. }
  278. if(userWageDto.getThingLeaveDebit()!= null){
  279. big = big.subtract(userWageDto.getThingLeaveDebit());
  280. }
  281. if(userWageDto.getAbsenceDebit()!= null){
  282. big = big.subtract(userWageDto.getAbsenceDebit());
  283. }
  284. /*if(userWageDto.getSocialSecurityDebit()!= null){
  285. big = big.subtract(userWageDto.getSocialSecurityDebit());
  286. }
  287. if(userWageDto.getProvidentFundDebit()!= null){
  288. big = big.subtract(userWageDto.getProvidentFundDebit());
  289. }*/
  290. if(userWageDto.getOtherDebit()!= null){
  291. big = big.subtract(userWageDto.getOtherDebit());
  292. }
  293. if(userWageDto.getDaikouDebit()!= null){
  294. big = big.subtract(userWageDto.getDaikouDebit());
  295. }
  296. if(userWageDto.getReissue()!= null){
  297. big = big.add(userWageDto.getReissue());
  298. }
  299. if(userWageDto.getPaymentSubsidy()!= null){
  300. big = big.add(userWageDto.getPaymentSubsidy());
  301. }
  302. return big;
  303. }
  304. /**
  305. * 保存新增/更新的行数据
  306. */
  307. @Override
  308. public AjaxJson addOrEdit(List<UserWageEntity> entitys) throws Exception {
  309. String message = null;
  310. AjaxJson j = new AjaxJson();
  311. if(CollectionUtils.isNotEmpty(entitys)){
  312. for(UserWageEntity jeecgDemo:entitys){
  313. if (StringUtil.isNotEmpty(jeecgDemo.getId())) {
  314. UserWageEntity t =systemService.get(UserWageEntity.class, jeecgDemo.getId());
  315. try {
  316. message = "员工工资核算: " + jeecgDemo.getUserid() + "被更新成功";
  317. MyBeanUtils.copyBeanNotNull2Bean(jeecgDemo, t);
  318. // t.setPreTaxMone(this.getMoney(t));
  319. t.recalculatePreTaxMoney();
  320. t.recalculateActualMoney();
  321. t.recalculateComCost();
  322. // if(StringUtils.isNotEmpty(t.getPreTaxMone().toString())){
  323. // t.setActualMoney(t.getPreTaxMone().subtract(t.getTaxMoney()));
  324. // }else{
  325. // t.setActualMoney(t.getPreTaxMone());
  326. // }
  327. //
  328. // if(t.getSocialSecurityDebit()!= null && t.getSocialSecurityDebit().intValue() > 0){
  329. // t.setActualMoney(t.getActualMoney().subtract(t.getSocialSecurityDebit()));
  330. // }
  331. // if(t.getProvidentFundDebit()!= null && t.getProvidentFundDebit().intValue() > 0){
  332. // t.setActualMoney(t.getActualMoney().subtract(t.getProvidentFundDebit()));
  333. // }
  334. //
  335. this.saveOrUpdate(t);
  336. systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
  337. } catch (Exception e) {
  338. e.printStackTrace();
  339. }
  340. } else {
  341. try {
  342. message = "JeecgDemo例子: " + jeecgDemo.getUserid() + "被添加成功";
  343. //jeecgDemo.setStatus("0");
  344. jeecgDemo.recalculatePreTaxMoney();
  345. jeecgDemo.recalculateActualMoney();
  346. jeecgDemo.recalculateComCost();
  347. this.save(jeecgDemo);
  348. systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
  349. } catch (Exception e) {
  350. e.printStackTrace();
  351. }
  352. }
  353. }
  354. }
  355. return j;
  356. }
  357. @Override
  358. public Map<String, Integer> getMoneyViewSUM(UserWageViewDto userWageiewDto,List<String> uidList) {
  359. return userWageMinidaoDao.getMoneyViewSUM(userWageiewDto,uidList);
  360. }
  361. /**
  362. * 工资进行确认和上报
  363. */
  364. @Override
  365. public AjaxJson updateStatus(List<String> idList,boolean status) {
  366. String message = null;
  367. AjaxJson j = new AjaxJson();
  368. if(CollectionUtils.isNotEmpty(idList)){
  369. for (String id : idList) {
  370. UserWageEntity t =systemService.get(UserWageEntity.class, id);
  371. if(t != null){
  372. j.setSuccess(true);
  373. if(status){
  374. message = t.getMonthly()+",员工id为:"+t.getUserid()+"的工资进行了上报";
  375. t.setStatus("1");
  376. }else{
  377. message = t.getMonthly()+",员工id为:"+t.getUserid()+"的工资进行了确认";
  378. t.setStatus("2");
  379. }
  380. systemService.saveOrUpdate(t);
  381. systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
  382. }
  383. }
  384. }
  385. return j;
  386. }
  387. @Override
  388. public List<UserWageEntity> getByuserid(String userid, String monthly) {
  389. return userWageMinidaoDao.getByuserid(userid, monthly);
  390. }
  391. @Override
  392. public List<ProjectDepartDto> getProjectDepartAll(ProjectDepartDto projectDepartDto,String userid) {
  393. List<ProjectDepartDto> projectDepartDtoList = new ArrayList<ProjectDepartDto>();
  394. if(StringUtils.isNotEmpty(userid)){
  395. List<TSUserOrg> ts = this.getSession().createQuery("from TSUserOrg where tsUser.id = :userId and status = 0").setParameter("userId",userid).list();
  396. if(!ts.isEmpty()){
  397. boolean temp = false;
  398. for (TSUserOrg tsUserOrg : ts) {
  399. TSDepart tss = get(TSDepart.class, tsUserOrg.getTsDepart().getId());
  400. if(tss != null && tss.getTSPDepart() != null){
  401. if("1".equals(tss.getTSPDepart().getOrgType())&&"2".equals(tss.getOrgType()) || "4".equals(tss.getOrgType())){
  402. temp = true;
  403. break;
  404. }
  405. }else{
  406. if("1".equals(tss.getOrgType())){
  407. temp = true;
  408. break;
  409. }
  410. }
  411. }
  412. if(temp){
  413. List<TSDepart> tsDepartsList = this.getSession().createQuery("from TSDepart where parentdepartid is null").list();
  414. List<String> idList = null;
  415. if(!tsDepartsList.isEmpty()){
  416. idList=new ArrayList<String>();
  417. for (TSDepart idTSDepart : tsDepartsList) {
  418. List<TSDepart> dt = this.getSession().createQuery("from TSDepart where parentdepartid = :parentdepartid and orgType = 2").setParameter("parentdepartid", idTSDepart.getId()).list();
  419. if(!dt.isEmpty()){
  420. for (TSDepart tsDepart : dt) {
  421. idList.add(tsDepart.getId());
  422. }
  423. }
  424. }
  425. projectDepartDto.getDepartIdList().addAll(idList);
  426. }
  427. List<String> orgTypeList=new ArrayList<String>();
  428. orgTypeList.add(Globals.org_type_3);
  429. orgTypeList.add(Globals.org_type_5);
  430. projectDepartDto.getOrgTypeList().addAll(orgTypeList);
  431. String authSql = JeecgDataAutorUtils.loadDataSearchConditonSQLString();
  432. projectDepartDtoList=userWageMinidaoDao.getProjectDepartAll(projectDepartDto, authSql);
  433. }else{
  434. List<String> idList=new ArrayList<String>();
  435. for (TSUserOrg tsUserOrg : ts) {
  436. TSDepart tss = get(TSDepart.class, tsUserOrg.getTsDepart().getId());
  437. idList.add(selectById(tss.getId()));
  438. }
  439. projectDepartDto.getDepartIdList().addAll(idList);
  440. String authSql = JeecgDataAutorUtils.loadDataSearchConditonSQLString();
  441. projectDepartDtoList=userWageMinidaoDao.getProjectDepartAll(projectDepartDto, authSql);
  442. }
  443. }
  444. }
  445. return projectDepartDtoList;
  446. }
  447. private String selectById(String id){
  448. String temp = "";
  449. TSDepart tsDepart = systemService.getEntity(TSDepart.class,id);
  450. if("3".equals(tsDepart.getOrgType()) || "5".equals(tsDepart.getOrgType())){
  451. temp = tsDepart.getId();
  452. }else{
  453. if(tsDepart.getTSPDepart() != null){
  454. selectById(tsDepart.getTSPDepart().getId());
  455. }
  456. }
  457. return temp;
  458. }
  459. }