generated from dxfeng/secondev-chapanda-feishu
65 lines
2.3 KiB
Java
65 lines
2.3 KiB
Java
|
|
package com.engine.recruit.service.impl;
|
||
|
|
|
||
|
|
import com.engine.core.impl.Service;
|
||
|
|
import com.engine.recruit.exception.CustomizeRunTimeException;
|
||
|
|
import com.engine.recruit.service.OfferService;
|
||
|
|
import org.apache.commons.lang3.StringUtils;
|
||
|
|
import weaver.conn.RecordSet;
|
||
|
|
import weaver.general.Util;
|
||
|
|
|
||
|
|
import java.util.HashMap;
|
||
|
|
import java.util.Map;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @author:dxfeng
|
||
|
|
* @createTime: 2023/10/30
|
||
|
|
* @version: 1.0
|
||
|
|
*/
|
||
|
|
public class OfferServiceImpl extends Service implements OfferService {
|
||
|
|
@Override
|
||
|
|
public Map<String, Object> getOfferMobileLink(Map<String, Object> param) {
|
||
|
|
return null;
|
||
|
|
}
|
||
|
|
|
||
|
|
@Override
|
||
|
|
public Map<String, Object> getOfferContent(Map<String, Object> param) {
|
||
|
|
Map<String, Object> returnMap = new HashMap<>();
|
||
|
|
String billId = Util.null2String(param.get("billid"));
|
||
|
|
String email = Util.null2String(param.get("dzyx"));
|
||
|
|
RecordSet rs = new RecordSet();
|
||
|
|
String offerContent = "";
|
||
|
|
rs.executeQuery("select tznr from uf_jcl_offer where id = ? and dzyx = ?", billId, email);
|
||
|
|
if (rs.next()) {
|
||
|
|
offerContent = rs.getString("tznr");
|
||
|
|
}
|
||
|
|
if (StringUtils.isAnyBlank(billId, email, offerContent)) {
|
||
|
|
throw new CustomizeRunTimeException("非法访问");
|
||
|
|
}
|
||
|
|
returnMap.put("content", offerContent);
|
||
|
|
return returnMap;
|
||
|
|
}
|
||
|
|
|
||
|
|
@Override
|
||
|
|
public Map<String, Object> updateOfferStatus(Map<String, Object> param) {
|
||
|
|
String status = Util.null2String(param.get("status"));
|
||
|
|
String email = Util.null2String(param.get("dzyx"));
|
||
|
|
String billId = Util.null2String(param.get("billid"));
|
||
|
|
if (StringUtils.isAnyBlank(billId, email, status) || !("2".equals(status) || "3".equals(status))) {
|
||
|
|
throw new CustomizeRunTimeException("非法操作");
|
||
|
|
}
|
||
|
|
RecordSet rs = new RecordSet();
|
||
|
|
// 判断是否已提交
|
||
|
|
rs.executeQuery("select zt from uf_jcl_offer where id = ? and dzyx = ? ", billId, email);
|
||
|
|
if (rs.next()) {
|
||
|
|
String zt = rs.getString("zt");
|
||
|
|
if ("2".equals(zt) || "3".equals(zt)) {
|
||
|
|
throw new CustomizeRunTimeException("此反馈已提交,请勿重复提交");
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
rs.executeUpdate("update uf_jcl_offer set zt = ? where id = ? and dzyx = ?", status, billId, email);
|
||
|
|
return null;
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|