Commit 3b1ef0ec authored by liufan's avatar liufan

修改:移装变更导出的文件地址

parent 43007619
......@@ -31,5 +31,5 @@ public interface IJgChangeRegistrationTransferService extends IService<JgChangeR
void revocation(String instanceId);
void exportUseRegistrationCertificate(String sequenceNbr);
String exportUseRegistrationCertificate(String sequenceNbr);
}
......@@ -62,6 +62,7 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.io.IOException;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
......@@ -242,10 +243,9 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
oldTransfer.setSupervisoryCode(supervisoryCode);
}
}
//使用登记编号
if (!ValidationUtil.isEmpty(dto2.get("USE_REGISTRATION_CODE"))) {
oldTransfer.setUseRegistrationCode((String) dto2.get("USE_REGISTRATION_CODE"));
if (!ValidationUtil.isEmpty(dto2.get("USE_ORG_CODE"))) {
oldTransfer.setUseRegistrationCode((String) dto2.get("USE_ORG_CODE"));
} else {
//使用登记编号
oldTransfer.setUseRegistrationCode(idxBizJgRegisterInfoMapper.getUseOrgCodeByEquip(equId));
......@@ -534,6 +534,53 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
*/
public Page<Map<String, Object>> queryListForPage(Page<Map<String, Object>> page, JgChangeRegistrationTransferDto params) {
Page<Map<String, Object>> listPage = this.baseMapper.getListPage(page, params, params.getRoleIds());
listPage.getRecords().stream().forEach(item->{
// 流程未走完时,移装地址需从 历史表中获取
if (item.containsKey("status") && !FlowStatusEnum.TO_BE_FINISHED.getName().equals(item.get("status").toString())) {
String fullAddress = "";
if(item.containsKey("equipId") && item.containsKey("applyNo")){
JgRegistrationHistory history = jgRegistrationHistoryService.getDteailByRecord(item.get("equipId").toString(), item.get("applyNo").toString());
if(!ValidationUtil.isEmpty(history)){
JSONObject newPosition = JSON.parseObject(history.getChangeData());
String province = newPosition.getString("province");
String city = newPosition.getString("city");
String county = newPosition.getString("county");
String street = newPosition.getString("street");
String address = newPosition.getString("address");
// 分割省市区街道字段
if (!ObjectUtils.isEmpty(province)) {
String[] provinceList = province.split("_");
if (provinceList.length > 1) {
fullAddress += provinceList[1];
}
}
if (!ObjectUtils.isEmpty(city)) {
String[] cityList = city.split("_");
if (cityList.length > 1) {
fullAddress += cityList[1];
}
}
if (!ObjectUtils.isEmpty(county)) {
String[] countyList = county.split("_");
if (countyList.length > 1) {
fullAddress += countyList[1];
}
}
if (!ObjectUtils.isEmpty(street)) {
String[] streetList = street.split("_");
if (streetList.length > 1) {
fullAddress += streetList[1];
}
}
if (!ObjectUtils.isEmpty(address)) {
fullAddress += address;
}
}
}
item.put("allAddress", fullAddress);
}
});
return listPage;
}
......@@ -781,7 +828,7 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
*
* @param sequenceNbr
*/
public void exportUseRegistrationCertificate(String sequenceNbr) {
public String exportUseRegistrationCertificate(String sequenceNbr) {
Map<String, Object> exportParamsMap = new HashMap<>();
//查询移装变更详情
JgChangeRegistrationTransfer transfer = this.getById(sequenceNbr);
......@@ -801,7 +848,10 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
//监管码
exportParamsMap.put("supervisoryCode", transfer.getSupervisoryCode());
//发证日期(当前时间)
exportParamsMap.put("issueData", new Date());
LocalDate today = LocalDate.now();
exportParamsMap.put("giveOutYear", today.getYear());
exportParamsMap.put("giveOutMonth", today.getMonthValue());
exportParamsMap.put("giveOutDay", today.getDayOfMonth());
//设备使用地址
if(!ValidationUtil.isEmpty(transferHistory)){
String fullAddress="";
......@@ -876,7 +926,7 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
if(!ValidationUtil.isEmpty(factoryInfo)){
exportParamsMap.put("factoryNum", factoryInfo.getFactoryNum());
}
//调用生成使用登记证
return commonService.generateCertificateReport(exportParamsMap);
}
}
\ No newline at end of file
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