|
@@ -6,13 +6,19 @@ import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageInfo;
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
+import com.idea.buildManage.mapper.ParkInfoMapper;
|
|
import com.idea.buildManage.mapper.ParkRoomMapper;
|
|
import com.idea.buildManage.mapper.ParkRoomMapper;
|
|
|
|
+import com.idea.buildManage.model.ParkInfo;
|
|
import com.idea.buildManage.model.ParkRoom;
|
|
import com.idea.buildManage.model.ParkRoom;
|
|
|
|
+import com.idea.buildManage.response.ParkRoomResponse;
|
|
import com.idea.customerManagement.dto.CustomerManagementDto;
|
|
import com.idea.customerManagement.dto.CustomerManagementDto;
|
|
|
|
+import com.idea.customerManagement.dto.RoomSelectionInfoDto;
|
|
import com.idea.customerManagement.mapper.CustomerManagementExtendMapper;
|
|
import com.idea.customerManagement.mapper.CustomerManagementExtendMapper;
|
|
import com.idea.customerManagement.mapper.CustomerManagementMapper;
|
|
import com.idea.customerManagement.mapper.CustomerManagementMapper;
|
|
import com.idea.customerManagement.mapper.RoomSelectionInfoMapper;
|
|
import com.idea.customerManagement.mapper.RoomSelectionInfoMapper;
|
|
import com.idea.customerManagement.model.*;
|
|
import com.idea.customerManagement.model.*;
|
|
|
|
+import com.idea.util.DateUtils;
|
|
|
|
+import com.idea.util.ReplaceWord;
|
|
import com.rockstar.common.base.BaseService;
|
|
import com.rockstar.common.base.BaseService;
|
|
import com.rockstar.frame.model.FrameUser;
|
|
import com.rockstar.frame.model.FrameUser;
|
|
import com.rockstar.frame.model.extend.DateTrans;
|
|
import com.rockstar.frame.model.extend.DateTrans;
|
|
@@ -25,9 +31,9 @@ import org.apache.commons.collections.CollectionUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import java.util.Arrays;
|
|
|
|
-import java.util.Date;
|
|
|
|
-import java.util.List;
|
|
|
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
|
+import java.util.*;
|
|
|
|
|
|
@Service
|
|
@Service
|
|
public class CustomerManagementService implements BaseService<CustomerManagement, CustomerManagementExample> {
|
|
public class CustomerManagementService implements BaseService<CustomerManagement, CustomerManagementExample> {
|
|
@@ -47,6 +53,8 @@ public class CustomerManagementService implements BaseService<CustomerManagement
|
|
private RoomSelectionInfoMapper roomSelectionInfoMapper;
|
|
private RoomSelectionInfoMapper roomSelectionInfoMapper;
|
|
@Autowired
|
|
@Autowired
|
|
private ParkRoomMapper parkRoomMapper;
|
|
private ParkRoomMapper parkRoomMapper;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ParkInfoMapper parkInfoMapper;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public int deleteByPrimaryKey(String s) {
|
|
public int deleteByPrimaryKey(String s) {
|
|
@@ -295,5 +303,54 @@ public class CustomerManagementService implements BaseService<CustomerManagement
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 选房通知单下载
|
|
|
|
+ * @param id
|
|
|
|
+ * @param response
|
|
|
|
+ */
|
|
|
|
+ public void downLoad(String id, HttpServletResponse response) {
|
|
|
|
+
|
|
|
|
+ String filePath = "/home/project/settleDown/tem/houseSelectionNotice.docx";
|
|
|
|
+ String fileName = "选房通知单.docx";
|
|
|
|
+ CustomerManagement customerManagement = selectByPrimaryKey(id);
|
|
|
|
+ BuyerExample buyerExample = new BuyerExample();
|
|
|
|
+ buyerExample.setOrderByClause("order_num asc");
|
|
|
|
+ buyerExample.createCriteria().andCustomerManagementIdEqualTo(id);
|
|
|
|
+ List<Buyer> buyers = buyerService.selectByExample(buyerExample);
|
|
|
|
+ if(CollectionUtils.isNotEmpty(buyers)){
|
|
|
|
+ Buyer buyer = buyers.get(0);
|
|
|
|
+ String name = buyer.getName();
|
|
|
|
+ String identityCard = buyer.getIdentityCard();
|
|
|
|
+ String roomSelectionNumber = customerManagement.getRoomSelectionNumber();
|
|
|
|
+ Date roomSelectionDate = customerManagement.getRoomSelectionDate();
|
|
|
|
+ String year = DateUtils.parseDateToStr(DateUtils.YYYY, roomSelectionDate);
|
|
|
|
+ String month = DateUtils.parseDateToStr(DateUtils.MM, roomSelectionDate);
|
|
|
|
+ String date = DateUtils.parseDateToStr(DateUtils.DD, roomSelectionDate);
|
|
|
|
+ ParkInfo parkInfo = parkInfoMapper.selectByPrimaryKey(customerManagement.getGroupId());
|
|
|
|
+ String region = "";
|
|
|
|
+ String dictLabel = sysDictService.getDictLabel("REGIONALISM_CODE", parkInfo.getRegionalismCode());
|
|
|
|
+ if(StringUtils.isNotEmpty(dictLabel)){
|
|
|
|
+ region = dictLabel;
|
|
|
|
+ }
|
|
|
|
+ Map<String, Object> data = new HashMap<>();
|
|
|
|
+ Map<String, Object> picData = new HashMap<>();
|
|
|
|
+ Map<String, Object> sealData = new HashMap<>();
|
|
|
|
+ data.put("${name}", name);
|
|
|
|
+ data.put("${identityCard}", identityCard);
|
|
|
|
+ data.put("${roomSelectionNumber}", roomSelectionNumber);
|
|
|
|
+ data.put("${year}", year);
|
|
|
|
+ data.put("${month}", month);
|
|
|
|
+ data.put("${date}", date);
|
|
|
|
+ data.put("${region}", region);
|
|
|
|
+ ReplaceWord.operateWord(response,filePath,fileName,data, picData,sealData);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
}
|
|
}
|