Commit 96d3c777 by hongzhong

Merge remote-tracking branch 'origin/dev_20210330' into dev_20210330

parents 6440faba c5d34da6
...@@ -3,6 +3,7 @@ package com.yd.api.practitioner; ...@@ -3,6 +3,7 @@ package com.yd.api.practitioner;
import com.yd.api.practitioner.service.PractitionerBasicInfoService; import com.yd.api.practitioner.service.PractitionerBasicInfoService;
import com.yd.api.practitioner.service.PractitionerService; import com.yd.api.practitioner.service.PractitionerService;
import com.yd.api.practitioner.service.ScheduleTrackService; import com.yd.api.practitioner.service.ScheduleTrackService;
import com.yd.api.practitioner.vo.informed.*;
import com.yd.api.practitioner.vo.login.CanSeeSalaryListResponseVO; import com.yd.api.practitioner.vo.login.CanSeeSalaryListResponseVO;
import com.yd.api.practitioner.vo.login.PractitionerLoginRequestVO; import com.yd.api.practitioner.vo.login.PractitionerLoginRequestVO;
import com.yd.api.practitioner.vo.login.PractitionerLoginResponseVO; import com.yd.api.practitioner.vo.login.PractitionerLoginResponseVO;
...@@ -32,6 +33,8 @@ import com.yd.api.practitioner.vo.subordinate.QueryTeamMemberDetailRequestVO; ...@@ -32,6 +33,8 @@ import com.yd.api.practitioner.vo.subordinate.QueryTeamMemberDetailRequestVO;
import com.yd.api.practitioner.vo.subordinate.QueryTeamMemberDetailResponseVO; import com.yd.api.practitioner.vo.subordinate.QueryTeamMemberDetailResponseVO;
import com.yd.api.practitioner.vo.subordinate.SubordinateSystemMemberQueryRequestVO; import com.yd.api.practitioner.vo.subordinate.SubordinateSystemMemberQueryRequestVO;
import com.yd.api.practitioner.vo.subordinate.SubordinateSystemMemberQueryResponseVO; import com.yd.api.practitioner.vo.subordinate.SubordinateSystemMemberQueryResponseVO;
import com.yd.api.result.CommonResultIDResponseVO;
import com.yd.api.result.IDRequestVO;
import com.yd.api.result.JsonResult; import com.yd.api.result.JsonResult;
import com.yd.rmi.n22.policy.service.N22PolicyService; import com.yd.rmi.n22.policy.service.N22PolicyService;
import com.yd.rmi.n22.salary.pojo.searchstaffsalarydetails.SearchStaffSalaryDetailsRequestBody; import com.yd.rmi.n22.salary.pojo.searchstaffsalarydetails.SearchStaffSalaryDetailsRequestBody;
...@@ -673,4 +676,39 @@ public class PractitionerController { ...@@ -673,4 +676,39 @@ public class PractitionerController {
return result; return result;
} }
@RequestMapping("/saveInformedSheet")
public Object saveInformedSheet(@RequestBody SaveInformedSheetRequestVO requestVO) {
JsonResult result = new JsonResult();
CommonResultIDResponseVO responseVO = practitionerService.saveInformedSheet(requestVO);
result.addResult(responseVO);
result.setData(responseVO);
return result;
}
@RequestMapping("/queryInformedSheetById")
public Object queryInformedSheetById(@RequestBody IDRequestVO requestVO) {
JsonResult result = new JsonResult();
QueryInformedSheetByIdResponseVO responseVO = practitionerService.queryInformedSheetById(requestVO);
result.addResult(responseVO);
result.setData(responseVO);
return result;
}
@RequestMapping("/signInformedSheet")
public Object signInformedSheet(@RequestBody SignInformedSheetRequestVO requestVO) {
JsonResult result = new JsonResult();
CommonResultIDResponseVO responseVO = practitionerService.signInformedSheet(requestVO);
result.addResult(responseVO);
result.setData(responseVO);
return result;
}
@RequestMapping("/queryInformedSheetList")
public Object queryInformedSheetList(@RequestBody QueryInformedSheetListRequestVO requestVO) {
JsonResult result = new JsonResult();
QueryInformedSheetListResponseVO responseVO = practitionerService.queryInformedSheetList(requestVO);
result.addResult(responseVO);
result.setData(responseVO);
return result;
}
} }
package com.yd.api.practitioner.service; package com.yd.api.practitioner.service;
import com.yd.api.practitioner.vo.informed.*;
import com.yd.api.practitioner.vo.login.CanSeeSalaryListResponseVO; import com.yd.api.practitioner.vo.login.CanSeeSalaryListResponseVO;
import com.yd.api.practitioner.vo.practitionerCustomer.*;
import com.yd.api.practitioner.vo.recruit.PotentialGoalsActionsUpdateResponseVO;
import com.yd.api.practitioner.vo.recruit.PotentialGoalsQueryResponseVO;
import com.yd.api.practitioner.vo.login.PractitionerLoginRequestVO; import com.yd.api.practitioner.vo.login.PractitionerLoginRequestVO;
import com.yd.api.practitioner.vo.login.PractitionerLoginResponseVO; import com.yd.api.practitioner.vo.login.PractitionerLoginResponseVO;
import com.yd.api.practitioner.vo.media.MediaGetReqVO; import com.yd.api.practitioner.vo.media.MediaGetReqVO;
import com.yd.api.practitioner.vo.media.MediaGetRespVO; import com.yd.api.practitioner.vo.media.MediaGetRespVO;
import com.yd.api.practitioner.vo.opportunity.*; import com.yd.api.practitioner.vo.opportunity.*;
import com.yd.api.practitioner.vo.practitionerCustomer.*;
import com.yd.api.practitioner.vo.rank.PractitionerRankRequestVO; import com.yd.api.practitioner.vo.rank.PractitionerRankRequestVO;
import com.yd.api.practitioner.vo.rank.PractitionerRankResponseVO; import com.yd.api.practitioner.vo.rank.PractitionerRankResponseVO;
import com.yd.api.practitioner.vo.recruit.*; import com.yd.api.practitioner.vo.recruit.*;
...@@ -16,6 +15,9 @@ import com.yd.api.practitioner.vo.salestarget.*; ...@@ -16,6 +15,9 @@ import com.yd.api.practitioner.vo.salestarget.*;
import com.yd.api.practitioner.vo.setting.*; import com.yd.api.practitioner.vo.setting.*;
import com.yd.api.practitioner.vo.subordinate.SubordinateSystemMemberQueryRequestVO; import com.yd.api.practitioner.vo.subordinate.SubordinateSystemMemberQueryRequestVO;
import com.yd.api.practitioner.vo.subordinate.SubordinateSystemMemberQueryResponseVO; import com.yd.api.practitioner.vo.subordinate.SubordinateSystemMemberQueryResponseVO;
import com.yd.api.result.CommonResultIDResponseVO;
import com.yd.api.result.IDRequestVO;
import com.yd.dal.entity.customer.AgPoInformed;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
...@@ -246,4 +248,14 @@ public interface PractitionerService { ...@@ -246,4 +248,14 @@ public interface PractitionerService {
* @return * @return
*/ */
List<Long> getPractitionerIdBySidList(Long sId,String systemType,Integer isActive); List<Long> getPractitionerIdBySidList(Long sId,String systemType,Integer isActive);
CommonResultIDResponseVO saveInformedSheet(SaveInformedSheetRequestVO requestVO);
QueryInformedSheetByIdResponseVO queryInformedSheetById(IDRequestVO requestVO);
CommonResultIDResponseVO updateInformedSheetById(UpdateInformedSheetByIdRequestVO requestVO);
CommonResultIDResponseVO signInformedSheet(SignInformedSheetRequestVO requestVO);
QueryInformedSheetListResponseVO queryInformedSheetList(QueryInformedSheetListRequestVO requestVO);
} }
...@@ -546,6 +546,9 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring ...@@ -546,6 +546,9 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
} }
//获取头像流 //获取头像流
InputStream inputStream = (InputStream) input.get("is"); InputStream inputStream = (InputStream) input.get("is");
if (null == inputStream) {
return null;
}
String filePath = localDirectory + filename; String filePath = localDirectory + filename;
byte[] data = new byte[1024]; byte[] data = new byte[1024];
......
package com.yd.api.practitioner.service.impl; package com.yd.api.practitioner.service.impl;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.google.common.base.Strings;
import com.libs.pdf.PDFTemplate;
import com.yd.api.customer.service.CustomerService; import com.yd.api.customer.service.CustomerService;
import com.yd.api.customer.vo.register.RegisterRequestVO; import com.yd.api.customer.vo.register.RegisterRequestVO;
import com.yd.api.customer.vo.register.RegisterResponseVO; import com.yd.api.customer.vo.register.RegisterResponseVO;
import com.yd.api.practitioner.vo.hiring.CommonResultResponseVO;
import com.yd.api.practitioner.vo.informed.*;
import com.yd.api.practitioner.vo.login.CanSeeSalaryListResponseVO; import com.yd.api.practitioner.vo.login.CanSeeSalaryListResponseVO;
import com.yd.api.practitioner.vo.practitionerCustomer.*;
import com.yd.api.practitioner.vo.recruit.PotentialGoalsActionsUpdateResponseVO;
import com.yd.api.practitioner.vo.recruit.PotentialGoalsQueryResponseVO;
import com.yd.api.practitioner.vo.login.PractitionerLoginBasicInfo; import com.yd.api.practitioner.vo.login.PractitionerLoginBasicInfo;
import com.yd.api.practitioner.vo.login.PractitionerLoginRequestVO; import com.yd.api.practitioner.vo.login.PractitionerLoginRequestVO;
import com.yd.api.practitioner.vo.login.PractitionerLoginResponseVO; import com.yd.api.practitioner.vo.login.PractitionerLoginResponseVO;
import com.yd.api.practitioner.vo.media.MediaGetReqVO; import com.yd.api.practitioner.vo.media.MediaGetReqVO;
import com.yd.api.practitioner.vo.media.MediaGetRespVO; import com.yd.api.practitioner.vo.media.MediaGetRespVO;
import com.yd.api.practitioner.vo.opportunity.*; import com.yd.api.practitioner.vo.opportunity.*;
import com.yd.api.practitioner.vo.practitionerCustomer.*;
import com.yd.api.practitioner.vo.rank.AclCustomerFortuneStatistics; import com.yd.api.practitioner.vo.rank.AclCustomerFortuneStatistics;
import com.yd.api.practitioner.vo.rank.PractitionerInfoForAchievement;
import com.yd.api.practitioner.vo.rank.PractitionerRankRequestVO; import com.yd.api.practitioner.vo.rank.PractitionerRankRequestVO;
import com.yd.api.practitioner.vo.rank.PractitionerRankResponseVO; import com.yd.api.practitioner.vo.rank.PractitionerRankResponseVO;
import com.yd.api.practitioner.vo.rank.PractitionerInfoForAchievement;
import com.yd.api.practitioner.vo.recruit.*; import com.yd.api.practitioner.vo.recruit.*;
import com.yd.api.practitioner.vo.salestarget.*; import com.yd.api.practitioner.vo.salestarget.*;
import com.yd.api.practitioner.vo.setting.*; import com.yd.api.practitioner.vo.setting.*;
...@@ -26,37 +28,33 @@ import com.yd.api.practitioner.vo.subordinate.SubordinateSystemMemberQueryReques ...@@ -26,37 +28,33 @@ import com.yd.api.practitioner.vo.subordinate.SubordinateSystemMemberQueryReques
import com.yd.api.practitioner.vo.subordinate.SubordinateSystemMemberQueryResponseVO; import com.yd.api.practitioner.vo.subordinate.SubordinateSystemMemberQueryResponseVO;
import com.yd.api.practitioner.vo.subordinate.SubordinateSystemStatisticInfo; import com.yd.api.practitioner.vo.subordinate.SubordinateSystemStatisticInfo;
import com.yd.api.result.CommonResult; import com.yd.api.result.CommonResult;
import com.yd.api.result.CommonResultIDResponseVO;
import com.yd.api.result.IDRequestVO;
import com.yd.dal.entity.customer.*; import com.yd.dal.entity.customer.*;
import com.yd.dal.entity.customer.practitioner.*;
import com.yd.dal.entity.marketing.*; import com.yd.dal.entity.marketing.*;
import com.yd.dal.entity.meta.*; import com.yd.dal.entity.meta.*;
import com.yd.dal.entity.marketing.MktLeadsAssignedTrack;
import com.yd.dal.entity.marketing.MktLeadsAssigneds;
import com.yd.dal.entity.marketing.MktLeadsGoals;
import com.yd.dal.entity.marketing.MktLeadsPool;
import com.yd.dal.entity.order.CustomerPolicyInfo; import com.yd.dal.entity.order.CustomerPolicyInfo;
import com.yd.dal.entity.practitioner.opportunity.OwnOpportunityInfo;
import com.yd.dal.entity.order.PoOrder; import com.yd.dal.entity.order.PoOrder;
import com.yd.dal.entity.practitioner.opportunity.OwnOpportunityInfo;
import com.yd.dal.entity.practitioner.opportunity.PlayerSalesActivityInfo; import com.yd.dal.entity.practitioner.opportunity.PlayerSalesActivityInfo;
import com.yd.dal.entity.survey.SurveyCustomerAnswers; import com.yd.dal.entity.survey.SurveyCustomerAnswers;
import com.yd.dal.entity.user.AclUser; import com.yd.dal.entity.user.AclUser;
import com.yd.dal.mapper.customer.AclPolicyholderMapper; import com.yd.dal.mapper.customer.AclPolicyholderMapper;
import com.yd.dal.mapper.customer.AgPoInformedMapper;
import com.yd.dal.service.agms.AgmsDashboardDALService; import com.yd.dal.service.agms.AgmsDashboardDALService;
import com.yd.dal.service.customer.*; import com.yd.dal.service.customer.*;
import com.yd.dal.service.marketing.*; import com.yd.dal.service.marketing.*;
import com.yd.dal.service.marketing.MktLeadsAssignedTrackDALService;
import com.yd.dal.service.marketing.MktLeadsAssignedsDALService;
import com.yd.dal.service.marketing.MktLeadsGoalsDALService;
import com.yd.dal.service.meta.*; import com.yd.dal.service.meta.*;
import com.yd.dal.service.order.PoOrderDALService; import com.yd.dal.service.order.PoOrderDALService;
import com.yd.dal.service.survey.SurveyCustomerAnswersDALService; import com.yd.dal.service.survey.SurveyCustomerAnswersDALService;
import com.yd.dal.service.user.AclUserDALService; import com.yd.dal.service.user.AclUserDALService;
import com.yd.dal.entity.customer.practitioner.*;
import com.yd.dal.service.meta.MdCodeDALService;
import com.yd.dal.service.meta.MdDropOptionsDALService;
import com.yd.rmi.ali.mail.service.MailService; import com.yd.rmi.ali.mail.service.MailService;
import com.yd.rmi.ali.oss.service.OssService; import com.yd.rmi.ali.oss.service.OssService;
import com.yd.rmi.cache.SystemConfigService; import com.yd.rmi.cache.SystemConfigService;
import com.yd.rmi.n22.salary.pojo.*; import com.yd.rmi.n22.salary.pojo.Achieve;
import com.yd.rmi.n22.salary.pojo.SearchStaffAchievementRequestBody;
import com.yd.rmi.n22.salary.pojo.SearchStaffAchievementResponseVO;
import com.yd.rmi.n22.salary.service.N22SalaryService; import com.yd.rmi.n22.salary.service.N22SalaryService;
import com.yd.rmi.n22.staff.pojo.MyStaff; import com.yd.rmi.n22.staff.pojo.MyStaff;
import com.yd.rmi.n22.staff.pojo.MyStaffSearchRequestBody; import com.yd.rmi.n22.staff.pojo.MyStaffSearchRequestBody;
...@@ -69,13 +67,14 @@ import com.yd.rmi.tencent.wechatinterf.pojo.ticket.TicketRequest; ...@@ -69,13 +67,14 @@ import com.yd.rmi.tencent.wechatinterf.pojo.ticket.TicketRequest;
import com.yd.rmi.tencent.wechatinterf.pojo.token.TokenRequest; import com.yd.rmi.tencent.wechatinterf.pojo.token.TokenRequest;
import com.yd.util.CommonUtil; import com.yd.util.CommonUtil;
import com.yd.util.HttpUtil; import com.yd.util.HttpUtil;
import com.yd.util.PDFConfiguration;
import com.yd.util.config.ZHBErrorConfig; import com.yd.util.config.ZHBErrorConfig;
import org.apache.commons.beanutils.BeanPropertyValueEqualsPredicate; import org.apache.commons.beanutils.BeanPropertyValueEqualsPredicate;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
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 com.google.common.base.Strings;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
...@@ -181,6 +180,8 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -181,6 +180,8 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
private AgmsDashboardDALService agmsDashboardDALService; private AgmsDashboardDALService agmsDashboardDALService;
@Autowired @Autowired
private AclPolicyholderMapper aclPolicyholderMapper; private AclPolicyholderMapper aclPolicyholderMapper;
@Autowired
private AgPoInformedMapper informedMapper;
@Override @Override
public PractitionerLoginResponseVO practitionerLogin(PractitionerLoginRequestVO requestVO) { public PractitionerLoginResponseVO practitionerLogin(PractitionerLoginRequestVO requestVO) {
...@@ -3584,4 +3585,270 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -3584,4 +3585,270 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
resp.setCommonResult(new CommonResult(true,ZHBErrorConfig.getErrorInfo("800000"))); resp.setCommonResult(new CommonResult(true,ZHBErrorConfig.getErrorInfo("800000")));
return resp; return resp;
} }
@Override
public CommonResultIDResponseVO saveInformedSheet(SaveInformedSheetRequestVO requestVO) {
CommonResultIDResponseVO resp = new CommonResultIDResponseVO();
try {
// 数据库实体
AgPoInformed informed = new AgPoInformed();
BeanUtils.copyProperties(requestVO, informed);
informed.setStatus("0");
informed.setIsActive(1);
Date curDate = new Date();
informed.setCreatedAt(curDate);
informed.setUpdatedAt(curDate);
Long loginId = requestVO.getLoginId();
informed.setCreatedBy(loginId);
informed.setUpdatedBy(loginId);
informedMapper.insertSelective(informed);
resp.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
resp.setId(informed.getId());
} catch (Exception e) {
e.printStackTrace();
resp.setCommonResult(new CommonResult(false, e.getMessage()));
}
return resp;
}
@Override
public QueryInformedSheetByIdResponseVO queryInformedSheetById(IDRequestVO requestVO) {
QueryInformedSheetByIdResponseVO resp = new QueryInformedSheetByIdResponseVO();
try {
AgPoInformed informed = informedMapper.selectByPrimaryKey(requestVO.getId());
resp.setInformed(informed);
resp.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
} catch (Exception e) {
e.printStackTrace();
resp.setCommonResult(new CommonResult(false, e.getMessage()));
}
return resp;
}
@Override
public CommonResultIDResponseVO updateInformedSheetById(UpdateInformedSheetByIdRequestVO requestVO) {
CommonResultIDResponseVO resp = new CommonResultIDResponseVO();
try {
// AgPoInformed informed = informedMapper.selectByPrimaryKey(requestVO.getId());
// BeanUtils.copyProperties(requestVO, informed);
//
//
// informed.setUpdatedAt( new Date());
//
// Long loginId = requestVO.getLoginId();
// informed.setCreatedBy(loginId);
// informed.setUpdatedBy(loginId);
resp.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
// resp.setId(informed.getId());
} catch (Exception e) {
e.printStackTrace();
resp.setCommonResult(new CommonResult(false, e.getMessage()));
}
return resp;
}
@Override
public CommonResultIDResponseVO signInformedSheet(SignInformedSheetRequestVO requestVO) {
CommonResultIDResponseVO resp = new CommonResultIDResponseVO();
Long id = requestVO.getId();
String imgStr = requestVO.getImgStr();
try {
if (StringUtils.isBlank(imgStr)) {
resp.setCommonResult(new CommonResult(false, "file不可为空"));
return resp;
}
if (imgStr.indexOf("data:image/png;") != -1) {
imgStr = imgStr.replace("data:image/png;base64,", "");
}
byte[] fileBytes = Base64.getDecoder().decode(imgStr);
InputStream inputStream = new ByteArrayInputStream(fileBytes);
// 上传图片至阿里云
StringBuffer fileName = new StringBuffer();
fileName.append("InformedSheet/").append(id).append("/");
String originalFilename = generateKey(10);
String key = fileName.append(originalFilename).append(".png").toString();
String putFileToOss = ossService.putFileToOss(null, key, inputStream);
// 保存入库
AgPoInformed informed = informedMapper.selectByPrimaryKey(requestVO.getId());
informed.setId(id);
informed.setSignOssPath(putFileToOss);
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
String signDate = format.format(new Date());
informed.setSignDate(signDate);
informed.setStatus("1");
informedMapper.updateByPrimaryKeySelective(informed);
resp.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
// 生成pdf
new Thread(new Runnable() {
private String getImgTolocal(String localDirectory, String filename, String imgUrl) {
Map<String, Object> input = HttpUtil.getInput(imgUrl);
if (!(boolean) input.get("success")) {
return null;
}
//获取头像流
InputStream inputStream = (InputStream) input.get("is");
if (null == inputStream) {
return null;
}
String filePath = localDirectory + filename;
byte[] data = new byte[1024];
int len = 0;
FileOutputStream fileOutputStream = null;
try {
fileOutputStream = new FileOutputStream(filePath);
while ((len = inputStream.read(data)) != -1) {
fileOutputStream.write(data, 0, len);
}
return filePath;
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
if (fileOutputStream != null) {
try {
fileOutputStream.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
return null;
}
private String putContractFileToOSS(String businessType, String file, Long recordId) throws Exception {
StringBuffer directory = new StringBuffer();
directory.append(businessType).append("/").append(recordId).append("/");
File tempFile =new File(file.trim());
//数据源不存在
if(!tempFile.exists()) {
throw new RuntimeException("目标文件地址不存在!");
}
//非文件类型
if(!tempFile.isFile()) {
throw new RuntimeException("目标文件不是文件类型!");
}
InputStream is = null;
String ossPath = null;
try {
is = new BufferedInputStream(new FileInputStream(tempFile));//读取数据源
String fileName = tempFile.getName();
String key = directory.append(fileName).toString();
ossPath = ossService.putFileToOss(null, key, is);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}finally {
if(is != null) {
try {
is.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return ossPath;
}
@Override
public void run() {
AgPoInformed informed = informedMapper.selectByPrimaryKey(requestVO.getId());
if (informed != null) {
String templatePDF = PDFConfiguration.getProperty("informed.pdf.template");
//模板文件生成临时文件目录
String tmpPathPDF = PDFConfiguration.getProperty("informed.pdf.temp.path");
//PDF模板输出结果文件
String templateResultPDF = tmpPathPDF + informed.getId() + "-signedInformed.pdf";
//填充数据
Map<String, String> initDatas = new HashMap<>();
Map<String, String> initImages = new HashMap<>();
//下载图片
String signPicture = this.getImgTolocal(tmpPathPDF,"sign.png", informed.getSignOssPath());
initImages.put("p_name", signPicture);
String pDate = informed.getSignDate();
initDatas.put("p_date", pDate);
//按模板填充数据生成结果PDF
PDFTemplate.generatePDF(templatePDF, templateResultPDF, initDatas, initImages);
try {
//上传至oss ossService
String ossPath = this.putContractFileToOSS("informed", templateResultPDF, informed.getId());
informed.setInformedOssPath(ossPath);
informedMapper.updateByPrimaryKeySelective(informed);
}catch (Exception e) {
e.printStackTrace();
}
}
}
}).start();
} catch (Exception e) {
e.printStackTrace();
resp.setCommonResult(new CommonResult(false, "保存失败"));
}
return resp;
}
@Override
public QueryInformedSheetListResponseVO queryInformedSheetList(QueryInformedSheetListRequestVO requestVO) {
QueryInformedSheetListResponseVO resp = new QueryInformedSheetListResponseVO();
try {
AgPoInformed informed = new AgPoInformed();
BeanUtils.copyProperties(requestVO, informed);
List<AgPoInformed> list = informedMapper.selectByRecord(informed);
resp.setList(list);
resp.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
} catch (Exception e) {
e.printStackTrace();
resp.setCommonResult(new CommonResult(false, e.getMessage()));
}
return resp;
}
} }
package com.yd.api.practitioner.vo.informed;
import com.yd.api.result.CommonResult;
import com.yd.dal.entity.customer.AgPoInformed;
import lombok.Data;
@Data
public class QueryInformedSheetByIdResponseVO {
private AgPoInformed informed;
private CommonResult commonResult;
}
package com.yd.api.practitioner.vo.informed;
import lombok.Data;
@Data
public class QueryInformedSheetListRequestVO {
private Long practitionerId;
private String customerName;
private String customerMobile;
private String policyNo;
private String signDate;
}
package com.yd.api.practitioner.vo.informed;
import com.yd.api.result.CommonResult;
import com.yd.dal.entity.customer.AgPoInformed;
import lombok.Data;
import java.util.List;
@Data
public class QueryInformedSheetListResponseVO {
private CommonResult commonResult;
private List<AgPoInformed> list;
}
package com.yd.api.practitioner.vo.informed;
import lombok.Data;
@Data
public class SaveInformedSheetRequestVO {
private Long loginId;
private Long practitionerId;
private Long leadsAssignedId;
private String customerName;
private String customerMobile;
private Long customerId;
}
package com.yd.api.practitioner.vo.informed;
import lombok.Data;
@Data
public class SignInformedSheetRequestVO {
private Long id;
private String imgStr;
}
package com.yd.api.practitioner.vo.informed;
import lombok.Data;
@Data
public class UpdateInformedSheetByIdRequestVO {
private Long id;
private String imgStr;
}
package com.yd.api.result;
import lombok.Data;
@Data
public class CommonResultIDResponseVO {
private Long id;
private CommonResult commonResult;
}
package com.yd.api.result;
import lombok.Data;
@Data
public class IDRequestVO {
private Long id;
}
package com.yd.dal.entity.customer;
import java.io.Serializable;
import java.util.Date;
/**
* ag_po_informed
* @author
*/
public class AgPoInformed implements Serializable {
/**
* serial id
*/
private Long id;
/**
* 关联的商机id
*/
private Long leadsId;
/**
* 告知书编号
*/
private String informedNo;
/**
* 告知书url
*/
private String informedOssPath;
/**
* 客户customerId
*/
private Long customerId;
/**
* 客户姓名
*/
private String customerName;
/**
* 客户手机号
*/
private String customerMobile;
/**
* practitioner_id
*/
private Long practitionerId;
/**
* 保单号
*/
private String policyNo;
/**
* 签署日期, yyyy-MM-dd
*/
private String signDate;
/**
* 客户签名url
*/
private String signOssPath;
/**
* 签署状态, 0=未签署; 1=已签署;
*/
private String status;
/**
* 1=active 2=inactive
*/
private Integer isActive;
/**
* 备注
*/
private String remark;
/**
* 创建时间
*/
private Date createdAt;
/**
* FK ag_acl_user.id
*/
private Long createdBy;
/**
* 修改时间
*/
private Date updatedAt;
/**
* FK ag_acl_user.id
*/
private Long updatedBy;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getLeadsId() {
return leadsId;
}
public void setLeadsId(Long leadsId) {
this.leadsId = leadsId;
}
public String getInformedNo() {
return informedNo;
}
public void setInformedNo(String informedNo) {
this.informedNo = informedNo;
}
public String getInformedOssPath() {
return informedOssPath;
}
public void setInformedOssPath(String informedOssPath) {
this.informedOssPath = informedOssPath;
}
public Long getCustomerId() {
return customerId;
}
public void setCustomerId(Long customerId) {
this.customerId = customerId;
}
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public String getCustomerMobile() {
return customerMobile;
}
public void setCustomerMobile(String customerMobile) {
this.customerMobile = customerMobile;
}
public Long getPractitionerId() {
return practitionerId;
}
public void setPractitionerId(Long practitionerId) {
this.practitionerId = practitionerId;
}
public String getPolicyNo() {
return policyNo;
}
public void setPolicyNo(String policyNo) {
this.policyNo = policyNo;
}
public String getSignDate() {
return signDate;
}
public void setSignDate(String signDate) {
this.signDate = signDate;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public Integer getIsActive() {
return isActive;
}
public void setIsActive(Integer isActive) {
this.isActive = isActive;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Long getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Long createdBy) {
this.createdBy = createdBy;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Long getUpdatedBy() {
return updatedBy;
}
public void setUpdatedBy(Long updatedBy) {
this.updatedBy = updatedBy;
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
AgPoInformed other = (AgPoInformed) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getLeadsId() == null ? other.getLeadsId() == null : this.getLeadsId().equals(other.getLeadsId()))
&& (this.getInformedNo() == null ? other.getInformedNo() == null : this.getInformedNo().equals(other.getInformedNo()))
&& (this.getInformedOssPath() == null ? other.getInformedOssPath() == null : this.getInformedOssPath().equals(other.getInformedOssPath()))
&& (this.getCustomerId() == null ? other.getCustomerId() == null : this.getCustomerId().equals(other.getCustomerId()))
&& (this.getCustomerName() == null ? other.getCustomerName() == null : this.getCustomerName().equals(other.getCustomerName()))
&& (this.getCustomerMobile() == null ? other.getCustomerMobile() == null : this.getCustomerMobile().equals(other.getCustomerMobile()))
&& (this.getPractitionerId() == null ? other.getPractitionerId() == null : this.getPractitionerId().equals(other.getPractitionerId()))
&& (this.getPolicyNo() == null ? other.getPolicyNo() == null : this.getPolicyNo().equals(other.getPolicyNo()))
&& (this.getSignDate() == null ? other.getSignDate() == null : this.getSignDate().equals(other.getSignDate()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getIsActive() == null ? other.getIsActive() == null : this.getIsActive().equals(other.getIsActive()))
&& (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
&& (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()))
&& (this.getCreatedBy() == null ? other.getCreatedBy() == null : this.getCreatedBy().equals(other.getCreatedBy()))
&& (this.getUpdatedAt() == null ? other.getUpdatedAt() == null : this.getUpdatedAt().equals(other.getUpdatedAt()))
&& (this.getUpdatedBy() == null ? other.getUpdatedBy() == null : this.getUpdatedBy().equals(other.getUpdatedBy()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getLeadsId() == null) ? 0 : getLeadsId().hashCode());
result = prime * result + ((getInformedNo() == null) ? 0 : getInformedNo().hashCode());
result = prime * result + ((getInformedOssPath() == null) ? 0 : getInformedOssPath().hashCode());
result = prime * result + ((getCustomerId() == null) ? 0 : getCustomerId().hashCode());
result = prime * result + ((getCustomerName() == null) ? 0 : getCustomerName().hashCode());
result = prime * result + ((getCustomerMobile() == null) ? 0 : getCustomerMobile().hashCode());
result = prime * result + ((getPractitionerId() == null) ? 0 : getPractitionerId().hashCode());
result = prime * result + ((getPolicyNo() == null) ? 0 : getPolicyNo().hashCode());
result = prime * result + ((getSignDate() == null) ? 0 : getSignDate().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getIsActive() == null) ? 0 : getIsActive().hashCode());
result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
result = prime * result + ((getCreatedBy() == null) ? 0 : getCreatedBy().hashCode());
result = prime * result + ((getUpdatedAt() == null) ? 0 : getUpdatedAt().hashCode());
result = prime * result + ((getUpdatedBy() == null) ? 0 : getUpdatedBy().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", leadsId=").append(leadsId);
sb.append(", informedNo=").append(informedNo);
sb.append(", informedOssPath=").append(informedOssPath);
sb.append(", customerId=").append(customerId);
sb.append(", customerName=").append(customerName);
sb.append(", customerMobile=").append(customerMobile);
sb.append(", practitionerId=").append(practitionerId);
sb.append(", policyNo=").append(policyNo);
sb.append(", signDate=").append(signDate);
sb.append(", status=").append(status);
sb.append(", isActive=").append(isActive);
sb.append(", remark=").append(remark);
sb.append(", createdAt=").append(createdAt);
sb.append(", createdBy=").append(createdBy);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", updatedBy=").append(updatedBy);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
public String getSignOssPath() {
return signOssPath;
}
public void setSignOssPath(String signOssPath) {
this.signOssPath = signOssPath;
}
}
\ No newline at end of file
package com.yd.dal.mapper.customer;
import com.yd.dal.entity.customer.AgPoInformed;
import java.util.List;
public interface AgPoInformedMapper {
int deleteByPrimaryKey(Long id);
int insert(AgPoInformed record);
int insertSelective(AgPoInformed record);
AgPoInformed selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(AgPoInformed record);
int updateByPrimaryKey(AgPoInformed record);
List<AgPoInformed> selectByRecord(AgPoInformed record);
}
\ No newline at end of file
...@@ -548,7 +548,7 @@ ...@@ -548,7 +548,7 @@
<foreach collection="list" item="item" separator="," open="(" close=")"> <foreach collection="list" item="item" separator="," open="(" close=")">
#{item} #{item}
</foreach> </foreach>
<!-- and w.is_paid != 1--> and w.is_paid != 1
and (f.payout_batch_id = #{payoutBatchId,jdbcType=BIGINT} or w.withdraw_amount = 0) and (f.payout_batch_id = #{payoutBatchId,jdbcType=BIGINT} or w.withdraw_amount = 0)
group by w.customer_id group by w.customer_id
</select> </select>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yd.dal.mapper.customer.AgPoInformedMapper">
<resultMap id="BaseResultMap" type="com.yd.dal.entity.customer.AgPoInformed">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="leads_id" jdbcType="BIGINT" property="leadsId" />
<result column="informed_no" jdbcType="VARCHAR" property="informedNo" />
<result column="informed_oss_path" jdbcType="VARCHAR" property="informedOssPath" />
<result column="customer_id" jdbcType="BIGINT" property="customerId" />
<result column="customer_name" jdbcType="VARCHAR" property="customerName" />
<result column="customer_mobile" jdbcType="VARCHAR" property="customerMobile" />
<result column="practitioner_id" jdbcType="BIGINT" property="practitionerId" />
<result column="policy_no" jdbcType="VARCHAR" property="policyNo" />
<result column="sign_date" jdbcType="VARCHAR" property="signDate" />
<result column="status" jdbcType="VARCHAR" property="status" />
<result column="is_active" jdbcType="INTEGER" property="isActive" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="created_by" jdbcType="BIGINT" property="createdBy" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="updated_by" jdbcType="BIGINT" property="updatedBy" />
</resultMap>
<sql id="Base_Column_List">
id, leads_id, informed_no, informed_oss_path, customer_id, customer_name, customer_mobile,
practitioner_id, policy_no, sign_date, `status`, is_active, remark, created_at, created_by,
updated_at, updated_by
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_po_informed
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from ag_po_informed
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AgPoInformed" useGeneratedKeys="true">
insert into ag_po_informed (leads_id, informed_no, informed_oss_path,
customer_id, customer_name, customer_mobile,
practitioner_id, policy_no, sign_date,
`status`, is_active, remark,
created_at, created_by, updated_at,
updated_by)
values (#{leadsId,jdbcType=BIGINT}, #{informedNo,jdbcType=VARCHAR}, #{informedOssPath,jdbcType=VARCHAR},
#{customerId,jdbcType=BIGINT}, #{customerName,jdbcType=VARCHAR}, #{customerMobile,jdbcType=VARCHAR},
#{practitionerId,jdbcType=BIGINT}, #{policyNo,jdbcType=VARCHAR}, #{signDate,jdbcType=VARCHAR},
#{status,jdbcType=VARCHAR}, #{isActive,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR},
#{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=BIGINT}, #{updatedAt,jdbcType=TIMESTAMP},
#{updatedBy,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AgPoInformed" useGeneratedKeys="true">
insert into ag_po_informed
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="leadsId != null">
leads_id,
</if>
<if test="informedNo != null">
informed_no,
</if>
<if test="informedOssPath != null">
informed_oss_path,
</if>
<if test="customerId != null">
customer_id,
</if>
<if test="customerName != null">
customer_name,
</if>
<if test="customerMobile != null">
customer_mobile,
</if>
<if test="practitionerId != null">
practitioner_id,
</if>
<if test="policyNo != null">
policy_no,
</if>
<if test="signDate != null">
sign_date,
</if>
<if test="status != null">
`status`,
</if>
<if test="isActive != null">
is_active,
</if>
<if test="remark != null">
remark,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="createdBy != null">
created_by,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="updatedBy != null">
updated_by,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="leadsId != null">
#{leadsId,jdbcType=BIGINT},
</if>
<if test="informedNo != null">
#{informedNo,jdbcType=VARCHAR},
</if>
<if test="informedOssPath != null">
#{informedOssPath,jdbcType=VARCHAR},
</if>
<if test="customerId != null">
#{customerId,jdbcType=BIGINT},
</if>
<if test="customerName != null">
#{customerName,jdbcType=BIGINT},
</if>
<if test="customerMobile != null">
#{customerMobile,jdbcType=BIGINT},
</if>
<if test="practitionerId != null">
#{practitionerId,jdbcType=BIGINT},
</if>
<if test="policyNo != null">
#{policyNo,jdbcType=VARCHAR},
</if>
<if test="signDate != null">
#{signDate,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=VARCHAR},
</if>
<if test="isActive != null">
#{isActive,jdbcType=INTEGER},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="createdBy != null">
#{createdBy,jdbcType=BIGINT},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedBy != null">
#{updatedBy,jdbcType=BIGINT},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yd.dal.entity.customer.AgPoInformed">
update ag_po_informed
<set>
<if test="leadsId != null">
leads_id = #{leadsId,jdbcType=BIGINT},
</if>
<if test="informedNo != null">
informed_no = #{informedNo,jdbcType=VARCHAR},
</if>
<if test="informedOssPath != null">
informed_oss_path = #{informedOssPath,jdbcType=VARCHAR},
</if>
<if test="customerId != null">
customer_id = #{customerId,jdbcType=BIGINT},
</if>
<if test="customerName != null">
customer_name = #{customerName,jdbcType=VARCHAR},
</if>
<if test="customerMobile != null">
customer_mobile = #{customerMobile,jdbcType=VARCHAR},
</if>
<if test="practitionerId != null">
practitioner_id = #{practitionerId,jdbcType=BIGINT},
</if>
<if test="policyNo != null">
policy_no = #{policyNo,jdbcType=VARCHAR},
</if>
<if test="signDate != null">
sign_date = #{signDate,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=VARCHAR},
</if>
<if test="isActive != null">
is_active = #{isActive,jdbcType=INTEGER},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="createdBy != null">
created_by = #{createdBy,jdbcType=BIGINT},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedBy != null">
updated_by = #{updatedBy,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.yd.dal.entity.customer.AgPoInformed">
update ag_po_informed
set leads_id = #{leadsId,jdbcType=BIGINT},
informed_no = #{informedNo,jdbcType=VARCHAR},
informed_oss_path = #{informedOssPath,jdbcType=VARCHAR},
customer_id = #{customerId,jdbcType=BIGINT},
customer_name = #{customerName,jdbcType=VARCHAR},
customer_mobile = #{customerMobile,jdbcType=VARCHAR},
practitioner_id = #{practitionerId,jdbcType=BIGINT},
policy_no = #{policyNo,jdbcType=VARCHAR},
sign_date = #{signDate,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
is_active = #{isActive,jdbcType=INTEGER},
remark = #{remark,jdbcType=VARCHAR},
created_at = #{createdAt,jdbcType=TIMESTAMP},
created_by = #{createdBy,jdbcType=BIGINT},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
updated_by = #{updatedBy,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
<select id="selectByRecord" parameterType="com.yd.dal.entity.customer.AgPoInformed" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_po_informed
where 1=1
<if test="customerName != null">
and customer_name = #{customerName,jdbcType=VARCHAR}
</if>
<if test="customerMobile != null">
and customer_mobile = #{customerMobile,jdbcType=VARCHAR}
</if>
<if test="updatedAt != null">
and practitioner_id = #{updatedAt,jdbcType=BIGINT}
</if>
<if test="policyNo != null">
and policy_no = #{policyNo,jdbcType=VARCHAR}
</if>
<if test="signDate != null">
and sign_date = #{signDate,jdbcType=VARCHAR}
</if>
</select>
</mapper>
\ No newline at end of file
...@@ -8,9 +8,13 @@ pdf.uncheck=/opt/tomcat8/conf/ydpdf/pdfres/uncheck.png ...@@ -8,9 +8,13 @@ pdf.uncheck=/opt/tomcat8/conf/ydpdf/pdfres/uncheck.png
pdf.temp.path=/opt/tomcat8/temp/ pdf.temp.path=/opt/tomcat8/temp/
pdf.firstParty=上海银盾保险经纪有限公司 pdf.firstParty=\u4E0A\u6D77\u94F6\u76FE\u4FDD\u9669\u7ECF\u7EAA\u6709\u9650\u516C\u53F8
pdf.firstPartyResponser=Wan Shuang Lian pdf.firstPartyResponser=Wan Shuang Lian
pdf.firstPartyAddress=上海市浦东新区张杨路560号中融恒瑞国际西楼1706室 pdf.firstPartyAddress=\u4E0A\u6D77\u5E02\u6D66\u4E1C\u65B0\u533A\u5F20\u6768\u8DEF560\u53F7\u4E2D\u878D\u6052\u745E\u56FD\u9645\u897F\u697C1706\u5BA4
pdf.position.x=450 pdf.position.x=450
pdf.position.y=150 pdf.position.y=150
#\u5BA2\u6237\u544A\u77E5\u4E66\u76EE\u5F55
informed.pdf.template=/opt/tomcat8/conf/ydpdf/informed/templateInformed.pdf
informed.pdf.temp.path=/opt/tomcat8/conf/ydpdf/informed
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