邮寄接口及保存方法
This commit is contained in:
parent
7e2639610f
commit
2265029245
@ -29,6 +29,8 @@ import apx.com.amarsoft.als.user.change.initiate.service.impl.ApplyChangeService
|
||||
import apx.com.amarsoft.als.user.change.initiate.service.impl.ApplyChangesServiceServiceImpl;
|
||||
import apx.com.amarsoft.als.user.change.initiate.service.impl.ApplyGuarantorServiceImpl;
|
||||
import apx.com.amarsoft.als.user.change.initiate.service.impl.ApplyVehicleServiceImpl;
|
||||
import apx.com.amarsoft.als.user.change.mail.service.ApplyMailService;
|
||||
import apx.com.amarsoft.als.user.change.mail.service.impl.ApplyMailServiceImpl;
|
||||
@Path("/change")
|
||||
public class ApplyChangeController {
|
||||
//业务变更发起
|
||||
@ -324,4 +326,65 @@ public class ApplyChangeController {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//未邮寄全部合同
|
||||
@Path("/business/mail")
|
||||
@POST
|
||||
public Map<String, Object> applyMail(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca) throws Exception {
|
||||
ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca);
|
||||
ARE.getLog().info(
|
||||
"[CONTROLLER] ApplyChangeController run .................");
|
||||
ARE.getLog().info("[Path] /change/business/mail" + " run .................");
|
||||
|
||||
ApplyMailService service = new ApplyMailServiceImpl();
|
||||
try {
|
||||
return service.applyMail(request, response, tx, sqlca, ReturnMapUtil);
|
||||
} catch (Exception e) {
|
||||
return ReturnMapUtil.rollback(e);
|
||||
}
|
||||
}
|
||||
|
||||
//保存
|
||||
@Path("/save/mail")
|
||||
@POST
|
||||
public Map<String, Object> saveapplyMail(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca) throws Exception {
|
||||
ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca);
|
||||
ARE.getLog().info(
|
||||
"[CONTROLLER] ApplyChangeController run .................");
|
||||
ARE.getLog().info("[Path] /change/save/mail" + " run .................");
|
||||
|
||||
ApplyMailService service = new ApplyMailServiceImpl();
|
||||
try {
|
||||
return service.saveapplyMail(request, response, tx, sqlca, ReturnMapUtil);
|
||||
} catch (Exception e) {
|
||||
return ReturnMapUtil.rollback(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//附件上传
|
||||
/* @Path("/business/applyAttachment")
|
||||
@POST
|
||||
public Map<String, Object> applyAttachment(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca) throws Exception {
|
||||
ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca);
|
||||
ARE.getLog().info(
|
||||
"[CONTROLLER] ApplyChangeController run .................");
|
||||
ARE.getLog().info("[Path] /change/business/applyAttachment" + " run .................");
|
||||
|
||||
ApplyAttachmentService service = new ApplyAttachmentServiceImpl();
|
||||
try {
|
||||
return service.applyAttachment(request, response, tx, sqlca, ReturnMapUtil);
|
||||
} catch (Exception e) {
|
||||
return ReturnMapUtil.rollback(e);
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,22 @@
|
||||
package apx.com.amarsoft.als.user.change.mail.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.core.Context;
|
||||
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
|
||||
public interface ApplyMailService {
|
||||
Map<String, Object> applyMail(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil)
|
||||
throws Exception;
|
||||
Map<String, Object> saveapplyMail(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil)
|
||||
throws Exception;
|
||||
}
|
||||
@ -0,0 +1,95 @@
|
||||
package apx.com.amarsoft.als.user.change.mail.service.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.amarsoft.are.jbo.BizObject;
|
||||
import com.amarsoft.are.jbo.BizObjectManager;
|
||||
import com.amarsoft.are.jbo.JBOFactory;
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.amarsoft.context.ASUser;
|
||||
import com.base.constant.RestfullConstant;
|
||||
import com.base.util.DateUtil;
|
||||
import com.base.util.MultipartDataUtil;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
import com.tenwa.comm.util.jboutil.DataOperatorUtil;
|
||||
|
||||
import apx.com.amarsoft.als.user.change.mail.service.ApplyMailService;
|
||||
import jbo.app.tenwa.doc.LB_FILE_MAILARCHIVING_INFO_TEMP;
|
||||
import jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO;
|
||||
//未全部邮寄合同
|
||||
public class ApplyMailServiceImpl implements ApplyMailService{
|
||||
private Map<String, Object> fieldMap;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public Map<String, Object> applyMail(HttpServletRequest request, HttpServletResponse response, JBOTransaction tx,
|
||||
Transaction sqlca, ReturnMapUtil ReturnMapUtil) throws Exception {
|
||||
Map<String, Object> testMap = (Map<String, Object>) MultipartDataUtil
|
||||
.readRequestParam(request, "UTF-8");
|
||||
fieldMap = (Map<String, Object>) testMap.get("fieldMap");
|
||||
String flowunid = fieldMap.get("flowunid") == null ? "" : fieldMap.get("flowunid").toString();
|
||||
String sql = "select O.CONTRACT_NUMBER,PROJECT_NAME,lfi.ALLSTATUS,O.flowunid from LB_CONTRACT_INFO O left join LB_FILE_MAILARCHIVING_INFO lfi on lfi.contract_id = O.id left join ORG_INFO oi on oi.orgid = O.PROJECT_DEPT left join LC_CALC_CONDITION lcc on lcc.contract_id = O.id where (lfi.ALLHANDOVERSTATUS is null or lfi.ALLHANDOVERSTATUS = 'part' or lfi.ALLHANDOVERSTATUS = 'none') and not exists (select 1 from LB_FILE_MAILARCHIVING_INFO_TEMP lfmit where lfmit.contract_id = O.id and lfmit.is_flowing = '0') where O.flowunid='"+flowunid+"'";
|
||||
List<Map<String, String>> dataList = DataOperatorUtil.getDataBySql(sql);
|
||||
|
||||
Map<String, Object> body = new HashMap<String, Object>();
|
||||
if(dataList.size()>0){
|
||||
for (Map<String, String> map : dataList) {
|
||||
body.put(map.get("CONTRACT_NUMBER"),map.get("CONTRACT_NUMBER"));
|
||||
body.put(map.get("PROJECT_NAME"),map.get("PROJECT_NAME"));
|
||||
body.put(map.get("ALLSTATUS"),map.get("ALLSTATUS"));
|
||||
}
|
||||
}
|
||||
ReturnMapUtil.setReturnMap(body,RestfullConstant.baseProperty.get("success").toString(), "");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public Map<String, Object> saveapplyMail(HttpServletRequest request, HttpServletResponse response,
|
||||
JBOTransaction tx, Transaction sqlca, ReturnMapUtil ReturnMapUtil) throws Exception {
|
||||
|
||||
Map<String, Object> testMap = (Map<String, Object>) MultipartDataUtil.readRequestParam(request, "UTF-8");
|
||||
BizObjectManager catManage = JBOFactory.getBizObjectManager(LB_CONTRACT_INFO.CLASS_NAME,sqlca);
|
||||
fieldMap = (Map<String, Object>) testMap.get("fieldMap"); // 参数
|
||||
String flowunid = fieldMap.get("flowunid") == null ? "" : fieldMap.get("flowunid").toString();
|
||||
String userid = fieldMap.get("userid") == null ? "" : fieldMap.get("userid").toString();
|
||||
ASUser CurUser = new ASUser(userid, sqlca);
|
||||
|
||||
BizObject cat = catManage.createQuery(" flowunid =:flowunid").setParameter("flowunid", flowunid).getSingleResult(true);
|
||||
if( cat == null ){
|
||||
cat = catManage.newObject();
|
||||
cat.setAttributeValue("inputuserid", userid);
|
||||
cat.setAttributeValue("inputorgid", CurUser.getOrgID());
|
||||
cat.setAttributeValue("inputtime", DateUtil.getSystemTimeByFormat("yyyy/MM/dd HH:mm:ss"));
|
||||
BizObject lult = this.getLult(flowunid);
|
||||
if( lult != null){
|
||||
cat.setAttributeValue("ALLSTATUS", lult.getAttribute("ALLSTATUS"));
|
||||
}else{
|
||||
System.out.print("邮寄数据不存在");
|
||||
}
|
||||
}else{
|
||||
cat.setAttributeValue("updateuserid", userid);
|
||||
cat.setAttributeValue("updateorgid", CurUser.getOrgID());
|
||||
cat.setAttributeValue("updatetime", DateUtil.getSystemTimeByFormat("yyyy/MM/dd HH:mm:ss"));
|
||||
}
|
||||
cat.setAttributeValue("CONTRACT_NUMBER", fieldMap.get("CONTRACT_NUMBER") == null ? "" : fieldMap.get("CONTRACT_NUMBER").toString());
|
||||
cat.setAttributeValue("PROJECT_NAME", fieldMap.get("PROJECT_NAME") == null ? "" : fieldMap.get("PROJECT_NAME").toString());
|
||||
cat.setAttributeValue("flowunid",flowunid);
|
||||
catManage.saveObject(cat);
|
||||
ReturnMapUtil.setReturnMap(null,
|
||||
RestfullConstant.baseProperty.get("success").toString(), "");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
//获取档案邮寄归档基本信息表
|
||||
public BizObject getLult (String flowunid) throws Exception{
|
||||
BizObjectManager lultManage = JBOFactory.getBizObjectManager(LB_FILE_MAILARCHIVING_INFO_TEMP.CLASS_NAME);
|
||||
return lultManage.createQuery(" flowunid=:flowunid ").setParameter("flowunid", flowunid).getSingleResult(false);
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user