|
@@ -1,17 +1,22 @@
|
|
|
package com.sooka.sponest.data.housingconstruction.service.impl;
|
|
|
|
|
|
import com.ruoyi.common.core.utils.DateUtils;
|
|
|
+import com.ruoyi.common.core.utils.StringUtils;
|
|
|
import com.ruoyi.common.core.utils.uuid.IdUtils;
|
|
|
import com.ruoyi.common.datascope.annotation.DataScopeMutiDept;
|
|
|
import com.ruoyi.common.security.utils.SecurityUtils;
|
|
|
import com.sooka.sponest.data.base.service.impl.BaseServiceImpl;
|
|
|
import com.sooka.sponest.data.housingconstruction.domain.CenterdataTHousingconstructionDeliveryPersonnel;
|
|
|
import com.sooka.sponest.data.housingconstruction.mapper.CenterdataTHousingconstructionDeliveryPersonnelMapper;
|
|
|
+import com.sooka.sponest.data.housingconstruction.service.ICenterdataTHousingconstructionAttachService;
|
|
|
import com.sooka.sponest.data.housingconstruction.service.ICenterdataTHousingconstructionDeliveryPersonnelService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* 配送人员Service业务层处理
|
|
@@ -24,6 +29,9 @@ public class CenterdataTHousingconstructionDeliveryPersonnelServiceImpl extends
|
|
|
@Autowired
|
|
|
private CenterdataTHousingconstructionDeliveryPersonnelMapper centerdataTHousingconstructionDeliveryPersonnelMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ICenterdataTHousingconstructionAttachService attachService;
|
|
|
+
|
|
|
/**
|
|
|
* 查询配送人员
|
|
|
*
|
|
@@ -32,7 +40,23 @@ public class CenterdataTHousingconstructionDeliveryPersonnelServiceImpl extends
|
|
|
*/
|
|
|
@Override
|
|
|
public CenterdataTHousingconstructionDeliveryPersonnel selectCenterdataTHousingconstructionDeliveryPersonnelById(String id) {
|
|
|
- return centerdataTHousingconstructionDeliveryPersonnelMapper.selectCenterdataTHousingconstructionDeliveryPersonnelById(id);
|
|
|
+ CenterdataTHousingconstructionDeliveryPersonnel deliveryPersonnel = centerdataTHousingconstructionDeliveryPersonnelMapper.selectCenterdataTHousingconstructionDeliveryPersonnelById(id);
|
|
|
+ Map<String, Object> attachToMap = attachService.getAttachToMap(id);
|
|
|
+ if (attachToMap != null) {
|
|
|
+ if (attachToMap.containsKey("laborContract")) {
|
|
|
+ deliveryPersonnel.setLaborContract(attachToMap.get("laborContract").toString());
|
|
|
+ }
|
|
|
+ if (attachToMap.containsKey("insurance")) {
|
|
|
+ deliveryPersonnel.setInsurance(attachToMap.get("insurance").toString());
|
|
|
+ }
|
|
|
+ if (attachToMap.containsKey("assessment")) {
|
|
|
+ deliveryPersonnel.setAssessment(attachToMap.get("assessment").toString());
|
|
|
+ }
|
|
|
+ if (attachToMap.containsKey("airCard")) {
|
|
|
+ deliveryPersonnel.setAirCard(attachToMap.get("airCard").toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return deliveryPersonnel;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -60,6 +84,7 @@ public class CenterdataTHousingconstructionDeliveryPersonnelServiceImpl extends
|
|
|
centerdataTHousingconstructionDeliveryPersonnel.setCreateBy(SecurityUtils.getUserId().toString());
|
|
|
centerdataTHousingconstructionDeliveryPersonnel.setCreateName(SecurityUtils.getLoginUser().getSysUser().getNickName());
|
|
|
centerdataTHousingconstructionDeliveryPersonnel.setCreateTime(DateUtils.getNowDate());
|
|
|
+ extracted(centerdataTHousingconstructionDeliveryPersonnel);
|
|
|
return centerdataTHousingconstructionDeliveryPersonnelMapper.insertCenterdataTHousingconstructionDeliveryPersonnel(centerdataTHousingconstructionDeliveryPersonnel);
|
|
|
}
|
|
|
|
|
@@ -74,9 +99,42 @@ public class CenterdataTHousingconstructionDeliveryPersonnelServiceImpl extends
|
|
|
centerdataTHousingconstructionDeliveryPersonnel.setUpdateBy(SecurityUtils.getUserId());
|
|
|
centerdataTHousingconstructionDeliveryPersonnel.setUpdateName(SecurityUtils.getLoginUser().getSysUser().getNickName());
|
|
|
centerdataTHousingconstructionDeliveryPersonnel.setUpdateTime(DateUtils.getNowDate());
|
|
|
+ extracted(centerdataTHousingconstructionDeliveryPersonnel);
|
|
|
return centerdataTHousingconstructionDeliveryPersonnelMapper.updateCenterdataTHousingconstructionDeliveryPersonnel(centerdataTHousingconstructionDeliveryPersonnel);
|
|
|
}
|
|
|
|
|
|
+ private void extracted(CenterdataTHousingconstructionDeliveryPersonnel centerdataTHousingconstructionDeliveryPersonnel) {
|
|
|
+ attachService.delAttachByBusId(centerdataTHousingconstructionDeliveryPersonnel.getId());
|
|
|
+ List<Map<String,Object>> list = new ArrayList<>();
|
|
|
+ if (StringUtils.isNotEmpty(centerdataTHousingconstructionDeliveryPersonnel.getLaborContract())) {
|
|
|
+ Map<String,Object> photo = new HashMap<>();
|
|
|
+ photo.put("key","laborContract");
|
|
|
+ photo.put("value",centerdataTHousingconstructionDeliveryPersonnel.getLaborContract());
|
|
|
+ list.add(photo);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(centerdataTHousingconstructionDeliveryPersonnel.getInsurance())) {
|
|
|
+ Map<String,Object> workPhoto = new HashMap<>();
|
|
|
+ workPhoto.put("key","insurance");
|
|
|
+ workPhoto.put("value",centerdataTHousingconstructionDeliveryPersonnel.getInsurance());
|
|
|
+ list.add(workPhoto);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(centerdataTHousingconstructionDeliveryPersonnel.getAssessment())) {
|
|
|
+ Map<String,Object> workPhoto = new HashMap<>();
|
|
|
+ workPhoto.put("key","assessment");
|
|
|
+ workPhoto.put("value",centerdataTHousingconstructionDeliveryPersonnel.getAssessment());
|
|
|
+ list.add(workPhoto);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(centerdataTHousingconstructionDeliveryPersonnel.getAirCard())) {
|
|
|
+ Map<String,Object> workPhoto = new HashMap<>();
|
|
|
+ workPhoto.put("key","airCard");
|
|
|
+ workPhoto.put("value",centerdataTHousingconstructionDeliveryPersonnel.getAirCard());
|
|
|
+ list.add(workPhoto);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(list)) {
|
|
|
+ attachService.addAttach(list, centerdataTHousingconstructionDeliveryPersonnel.getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 批量删除配送人员
|
|
|
*
|