添加app对应的GPDS“
This commit is contained in:
parent
17495d7006
commit
abb4cfa299
@ -110,7 +110,7 @@ public class ContractMakeServiceImpl implements ContractMakeService{
|
||||
Map<String, String> flowParms = ContractMakeControllerUtil.getFlowParms(flowUnid);
|
||||
String contractId = flowParms.get("ContractId");
|
||||
String projectId = flowParms.get("ProjectId");
|
||||
String contractNo = flowParms.get("ContractNo");
|
||||
String contractNo = flowParms.get("FlowKey");
|
||||
|
||||
|
||||
body.put("FlowUnid", flowUnid);
|
||||
|
||||
@ -119,4 +119,124 @@ public class FlowDataController {
|
||||
return ReturnMapUtil.rollback(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 삿혤GPS斤口斤口
|
||||
*/
|
||||
@Path("/get/gpsinfo")
|
||||
@POST
|
||||
public Map<String, Object> getGpsInfo(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca) throws Exception {
|
||||
ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca);
|
||||
ARE.getLog()
|
||||
.info("[CONTROLLER] FlowDataController run .................");
|
||||
ARE.getLog().info(
|
||||
"[Path] /flow/data/get/gpsinfo" + " run .................");
|
||||
try {
|
||||
return service.getGpsInfo(request, response, tx, sqlca, ReturnMapUtil);
|
||||
} catch (Exception e) {
|
||||
return ReturnMapUtil.rollback(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 괏닸瓊슥GPS탰데
|
||||
*/
|
||||
@Path("/submit/order")
|
||||
@POST
|
||||
public Map<String, Object> submitOrder(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca) throws Exception {
|
||||
ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca);
|
||||
ARE.getLog()
|
||||
.info("[CONTROLLER] FlowDataController run .................");
|
||||
ARE.getLog().info(
|
||||
"[Path] /flow/data/submit/order" + " run .................");
|
||||
try {
|
||||
return service.submitOrder(request, response, tx, sqlca, ReturnMapUtil);
|
||||
} catch (Exception e) {
|
||||
return ReturnMapUtil.rollback(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 꿴璂GPS묏데
|
||||
*/
|
||||
@Path("/query/order")
|
||||
@POST
|
||||
public Map<String, Object> queryOrder(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca) throws Exception {
|
||||
ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca);
|
||||
ARE.getLog()
|
||||
.info("[CONTROLLER] FlowDataController run .................");
|
||||
ARE.getLog().info(
|
||||
"[Path] /flow/data/query/order" + " run .................");
|
||||
try {
|
||||
return service.queryOrder(request, response, tx, sqlca, ReturnMapUtil);
|
||||
} catch (Exception e) {
|
||||
return ReturnMapUtil.rollback(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 錦맣GPS묏데
|
||||
*/
|
||||
@Path("/alter/order")
|
||||
@POST
|
||||
public Map<String, Object> alterOrder(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca) throws Exception {
|
||||
ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca);
|
||||
ARE.getLog()
|
||||
.info("[CONTROLLER] FlowDataController run .................");
|
||||
ARE.getLog().info(
|
||||
"[Path] /flow/data/alter/Order" + " run .................");
|
||||
try {
|
||||
return service.alterOrder(request, response, tx, sqlca, ReturnMapUtil);
|
||||
} catch (Exception e) {
|
||||
return ReturnMapUtil.rollback(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 혤句묏데
|
||||
*/
|
||||
@Path("/cancel/order")
|
||||
@POST
|
||||
public Map<String, Object> cancelOrder(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca) throws Exception {
|
||||
ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca);
|
||||
ARE.getLog()
|
||||
.info("[CONTROLLER] FlowDataController run .................");
|
||||
ARE.getLog().info(
|
||||
"[Path] /flow/data/cancel/order" + " run .................");
|
||||
try {
|
||||
return service.cancelOrder(request, response, tx, sqlca, ReturnMapUtil);
|
||||
} catch (Exception e) {
|
||||
return ReturnMapUtil.rollback(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 꿴였갛陋暠
|
||||
*/
|
||||
@Path("/show/gpsimage")
|
||||
@POST
|
||||
public Map<String, Object> showGPSImage(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca) throws Exception {
|
||||
ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca);
|
||||
ARE.getLog()
|
||||
.info("[CONTROLLER] FlowDataController run .................");
|
||||
ARE.getLog().info(
|
||||
"[Path] /flow/data/submit/order" + " run .................");
|
||||
try {
|
||||
return service.showGPSImage(request, response, tx, sqlca, ReturnMapUtil);
|
||||
} catch (Exception e) {
|
||||
return ReturnMapUtil.rollback(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,5 +33,30 @@ public interface FlowDataService {
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil)
|
||||
throws Exception;
|
||||
Map<String, Object> getGpsInfo(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil)
|
||||
throws Exception;
|
||||
|
||||
Map<String, Object> submitOrder(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil)
|
||||
throws Exception;
|
||||
|
||||
Map<String, Object> queryOrder(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil)
|
||||
throws Exception;
|
||||
Map<String, Object> alterOrder(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil)
|
||||
throws Exception;
|
||||
Map<String, Object> cancelOrder(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil)
|
||||
throws Exception;
|
||||
Map<String, Object> showGPSImage(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil)
|
||||
throws Exception;
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package apx.com.amarsoft.als.apzl.flow.data.service.Impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -12,8 +13,10 @@ import jbo.app.tenwa.customer.CUSTOMER_ACCOUNT_HIS;
|
||||
import jbo.app.tenwa.customer.CUSTOMER_ACCOUNT_TEMP;
|
||||
import jbo.app.tenwa.customer.CUSTOMER_INFO_TEMP;
|
||||
import jbo.app.tenwa.doc.LB_DOC_CONTRACT_LIST;
|
||||
import jbo.com.tenwa.lease.comm.LB_EQUIPMENT_CAR_TEMP;
|
||||
import jbo.com.tenwa.lease.comm.LB_UNION_LESSEE;
|
||||
import jbo.com.tenwa.lease.comm.LB_UNION_LESSEE_TEMP;
|
||||
import jbo.sys.LM_GPS_ORDER_TEMP;
|
||||
|
||||
import com.amarsoft.are.jbo.BizObject;
|
||||
import com.amarsoft.are.jbo.BizObjectManager;
|
||||
@ -21,12 +24,15 @@ 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.amarsoft.dict.als.manage.NameManager;
|
||||
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 com.tenwa.gps.GpsController;
|
||||
|
||||
import apx.com.amarsoft.als.apzl.apply.contract.make.util.ContractMakeControllerUtil;
|
||||
import apx.com.amarsoft.als.apzl.flow.data.service.FlowDataService;
|
||||
|
||||
public class FlowDataServiceImpl implements FlowDataService{
|
||||
@ -258,4 +264,323 @@ public class FlowDataServiceImpl implements FlowDataService{
|
||||
RestfullConstant.baseProperty.get("success").toString(), "");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getGpsInfo(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"); // 参数
|
||||
Map<String, Object> body = new HashMap<String, Object>();
|
||||
String flowunid = fieldMap.get("flowunid") == null ? "" : fieldMap.get("flowunid").toString();
|
||||
Map<String, String> flowParms = ContractMakeControllerUtil.getFlowParms(flowunid);
|
||||
String projectId = flowParms.get("ProjectId");
|
||||
BizObjectManager lectManage = JBOFactory.getFactory().getManager(LB_EQUIPMENT_CAR_TEMP.CLASS_NAME);
|
||||
BizObject lect = lectManage.createQuery(" FLOWUNID=:FlowUnid ").setParameter("FlowUnid", flowunid).getSingleResult(false);
|
||||
String distributor_id = sqlca.getString("select distributor_id from lb_project_info where id='"+projectId+"'");//获取经销商ID
|
||||
|
||||
|
||||
BizObjectManager lgtManage = JBOFactory.getFactory().getManager(LM_GPS_ORDER_TEMP.CLASS_NAME);
|
||||
BizObject lgt = lgtManage.createQuery(" flowunid=:flowunid ").setParameter("flowunid", flowunid).getSingleResult(false);
|
||||
|
||||
|
||||
if(lgt == null){
|
||||
body.put("APPLY_NO", flowParms.get("ProjectNo"));//申请编号
|
||||
body.put("CAR_VIN", lect == null ? "": lect.getAttribute("FRAME_NUMBER").toString());//车架号
|
||||
body.put("CONTACT_NAME", "");//现场联系人
|
||||
body.put("CONTACT_PHONE", "");//现场联系人电话
|
||||
body.put("INSTALL_TIME", "");//上门时间
|
||||
body.put("ADDRESS_CODE", "");//上门地址最新国标编码
|
||||
body.put("ADDRESS_DETAIL", "");//详细地址
|
||||
body.put("WIRED_NUM", "1");//有线设备数量
|
||||
body.put("WIRELESS_NUM", "1");//无线设备数量
|
||||
body.put("CAR_ACCOUNT", "");//拉车账号
|
||||
body.put("RESULT", "");//请求结果 MESSAGE
|
||||
body.put("MESSAGE", "");//处理信息
|
||||
body.put("STATUS", "未提交");//订单状态
|
||||
body.put("PROJECT_ID", projectId);//项目id
|
||||
body.put("CAR_ACCOUNT", sqlca.getString("select distributor_name from distributor_info where distributor_no='"+distributor_id+"'"));//项目id
|
||||
}else{
|
||||
body.put("APPLY_NO", lgt.getAttribute("APPLY_NO").toString());//申请编号
|
||||
body.put("CAR_VIN", lgt.getAttribute("CAR_VIN").toString());//车架号
|
||||
body.put("CONTACT_NAME", lgt.getAttribute("CONTACT_NAME").toString());//现场联系人
|
||||
body.put("CONTACT_PHONE", lgt.getAttribute("CONTACT_PHONE").toString());//现场联系人电话
|
||||
body.put("INSTALL_TIME", lgt.getAttribute("INSTALL_TIME").toString());//上门时间
|
||||
body.put("ADDRESS_CODE", lgt.getAttribute("ADDRESS_CODE").toString());//上门地址最新国标编码
|
||||
body.put("ADDRESS_DETAIL", lgt.getAttribute("ADDRESS_DETAIL").toString());//详细地址
|
||||
body.put("WIRED_NUM", lgt.getAttribute("WIRED_NUM").toString());//有线设备数量
|
||||
body.put("WIRELESS_NUM", lgt.getAttribute("WIRELESS_NUM").toString());//无线设备数量
|
||||
body.put("CAR_ACCOUNT", lgt.getAttribute("CAR_ACCOUNT").toString());//拉车账号
|
||||
body.put("RESULT", NameManager.getItemName("gps_result",lgt.getAttribute("RESULT").toString()));//请求结果 MESSAGE
|
||||
body.put("MESSAGE", lgt.getAttribute("MESSAGE").toString());//处理信息
|
||||
body.put("STATUS", NameManager.getItemName("gps_status",lgt.getAttribute("STATUS").toString()));//订单状态
|
||||
body.put("PROJECT_ID", lgt.getAttribute("PROJECT_ID").toString());//项目id
|
||||
body.put("CAR_ACCOUNT", lgt.getAttribute("CAR_ACCOUNT").toString());//项目id
|
||||
|
||||
}
|
||||
body.put("flowunid", flowunid);//流程id
|
||||
ReturnMapUtil.setReturnMap(body,
|
||||
RestfullConstant.baseProperty.get("success").toString(), "");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> submitOrder(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"); // 参数
|
||||
Map<String, Object> body = new HashMap<String, Object>();
|
||||
String flowunid = fieldMap.get("flowunid") == null ? "" : fieldMap.get("flowunid").toString();
|
||||
String userid = fieldMap.get("userid") == null ? "" : fieldMap.get("userid").toString();
|
||||
String applyNo = fieldMap.get("APPLY_NO") == null ? "" : fieldMap.get("APPLY_NO").toString();
|
||||
String projectId = fieldMap.get("PROJECT_ID") == null ? "" : fieldMap.get("PROJECT_ID").toString();
|
||||
|
||||
BizObjectManager lgtManage = JBOFactory.getFactory().getManager(LM_GPS_ORDER_TEMP.CLASS_NAME,tx);
|
||||
BizObject lgt = lgtManage.createQuery(" flowunid=:flowunid ").setParameter("flowunid", flowunid).getSingleResult(true);
|
||||
|
||||
if(lgt != null){
|
||||
String gpsStatus = lgt.getAttribute("STATUS")==null?"":lgt.getAttribute("STATUS").getString();
|
||||
if(gpsStatus.length() == 0 || "7".equals(gpsStatus)){
|
||||
lgt.setAttributeValue("CONTACT_NAME", fieldMap.get("CONTACT_NAME") == null ? "" : fieldMap.get("CONTACT_NAME").toString());//现场联系人
|
||||
lgt.setAttributeValue("CONTACT_PHONE", fieldMap.get("CONTACT_PHONE") == null ? "" : fieldMap.get("CONTACT_PHONE").toString());//现场联系人电话
|
||||
lgt.setAttributeValue("INSTALL_TIME", fieldMap.get("INSTALL_TIME") == null ? "" : fieldMap.get("INSTALL_TIME").toString());//上门时间
|
||||
lgt.setAttributeValue("ADDRESS_CODE", fieldMap.get("ADDRESS_CODE") == null ? "" : fieldMap.get("ADDRESS_CODE").toString());//上门地址最新国标编码
|
||||
lgt.setAttributeValue("ADDRESS_DETAIL", fieldMap.get("ADDRESS_DETAIL") == null ? "" : fieldMap.get("ADDRESS_DETAIL").toString());//详细地址
|
||||
lgt.setAttributeValue("WIRED_NUM", fieldMap.get("WIRED_NUM") == null ? "" : fieldMap.get("WIRED_NUM").toString());//有线设备数量
|
||||
lgt.setAttributeValue("WIRELESS_NUM", fieldMap.get("WIRELESS_NUM") == null ? "" : fieldMap.get("WIRELESS_NUM").toString());//无线设备数量
|
||||
}else{
|
||||
body.put("statusCode", "01");
|
||||
body.put("flowunid", flowunid);//流程id
|
||||
body.put("msg", "不可重复提交!");
|
||||
ReturnMapUtil.setReturnMap(body,
|
||||
RestfullConstant.baseProperty.get("success").toString(), "");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
}else{
|
||||
BigDecimal incomNuber = new BigDecimal(sqlca.getString("select INCOME_NUMBER from LC_CALC_CONDITION_TEMP where FLOWUNID='"+flowunid+"'"));
|
||||
String period = incomNuber.divide(new BigDecimal("12"),0,BigDecimal.ROUND_UP).toString();
|
||||
List<Map<String,String>> GpsConfig = DataOperatorUtil.getDataBySql("select CONTACT_NAME,CONTACT_PHONE from GPS_config_info where isenable='1' ");
|
||||
lgt = lgtManage.newObject();
|
||||
lgt.setAttributeValue("APPLY_NO", applyNo);//申请编号
|
||||
lgt.setAttributeValue("CAR_VIN", fieldMap.get("CAR_VIN") == null ? "" : fieldMap.get("CAR_VIN").toString());//车架号
|
||||
lgt.setAttributeValue("CONTACT_NAME", fieldMap.get("CONTACT_NAME") == null ? "" : fieldMap.get("CONTACT_NAME").toString());//现场联系人
|
||||
lgt.setAttributeValue("CONTACT_PHONE", fieldMap.get("CONTACT_PHONE") == null ? "" : fieldMap.get("CONTACT_PHONE").toString());//现场联系人电话
|
||||
lgt.setAttributeValue("INSTALL_TIME", fieldMap.get("INSTALL_TIME") == null ? "" : fieldMap.get("INSTALL_TIME").toString());//上门时间
|
||||
lgt.setAttributeValue("ADDRESS_CODE", fieldMap.get("ADDRESS_CODE") == null ? "" : fieldMap.get("ADDRESS_CODE").toString());//上门地址最新国标编码
|
||||
lgt.setAttributeValue("ADDRESS_DETAIL", fieldMap.get("ADDRESS_DETAIL") == null ? "" : fieldMap.get("ADDRESS_DETAIL").toString());//详细地址
|
||||
lgt.setAttributeValue("WIRED_NUM", fieldMap.get("WIRED_NUM") == null ? "" : fieldMap.get("WIRED_NUM").toString());//有线设备数量
|
||||
lgt.setAttributeValue("WIRELESS_NUM", fieldMap.get("WIRELESS_NUM") == null ? "" : fieldMap.get("WIRELESS_NUM").toString());//无线设备数量
|
||||
lgt.setAttributeValue("WIRED_PERIOD",period);
|
||||
lgt.setAttributeValue("WIRELESS_PERIOD",period);
|
||||
lgt.setAttributeValue("FLOWUNID",flowunid);
|
||||
lgt.setAttributeValue("PROJECT_ID", projectId );//项目id
|
||||
if(GpsConfig.size()>0){
|
||||
lgt.setAttributeValue("PICCONTACT_NAME",GpsConfig.get(0).get("CONTACT_NAME"));
|
||||
lgt.setAttributeValue("PICCONTACT_PHONE",GpsConfig.get(0).get("CONTACT_PHONE"));
|
||||
}
|
||||
lgt.setAttributeValue("CAR_ACCOUNT", fieldMap.get("CAR_ACCOUNT") == null ? "" : fieldMap.get("CAR_ACCOUNT").toString());
|
||||
ASUser user = new ASUser(userid);
|
||||
lgt.setAttributeValue("INPUTUSERID",userid);
|
||||
lgt.setAttributeValue("INPUTORGID",user.getOrgID());
|
||||
lgt.setAttributeValue("INPUTTIME",DateUtil.getSystemTimeByFormat("yyyy/MM/dd hh:mm:ss"));
|
||||
}
|
||||
lgtManage.saveObject(lgt);
|
||||
//调用GPS安装接口
|
||||
GpsController gpsC = new GpsController();
|
||||
gpsC.setApplyNo(applyNo);
|
||||
gpsC.setFlowUnid(flowunid);
|
||||
gpsC.setProjectId(projectId);
|
||||
gpsC.setUserId(userid);
|
||||
String message = gpsC.createOrder(tx);
|
||||
if("提交成功!".equals(message)){
|
||||
body.put("statusCode", "00");
|
||||
}else{
|
||||
body.put("statusCode", "01");
|
||||
}
|
||||
body.put("flowunid", flowunid);//流程id
|
||||
body.put("msg", message);
|
||||
ReturnMapUtil.setReturnMap(body,
|
||||
RestfullConstant.baseProperty.get("success").toString(), "");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryOrder(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"); // 参数
|
||||
Map<String, Object> body = new HashMap<String, Object>();
|
||||
String flowunid = fieldMap.get("flowunid") == null ? "" : fieldMap.get("flowunid").toString();
|
||||
String userid = fieldMap.get("userid") == null ? "" : fieldMap.get("userid").toString();
|
||||
String checkGPSStatus = this.checkGPSStatus(flowunid);
|
||||
if("true".equals(checkGPSStatus)){
|
||||
BizObject gpslgot = this.gpsBizObject(flowunid);
|
||||
GpsController gpsC = new GpsController();
|
||||
gpsC.setApplyNo(gpslgot.getAttribute("APPLY_NO").getString());
|
||||
gpsC.setProjectId(gpslgot.getAttribute("PROJECT_ID").getString());
|
||||
gpsC.setUserId(userid);
|
||||
gpsC.setFlowUnid(flowunid);
|
||||
gpsC.setTableName("LM_GPS_ORDER_TEMP");
|
||||
gpsC.setOrderNo(gpslgot.getAttribute("ORDER_NO").getString());
|
||||
gpsC.setVin(gpslgot.getAttribute("CAR_VIN").getString());
|
||||
String queryOrder = gpsC.queryOrder(tx);
|
||||
body.put("statusCode", "00");
|
||||
body.put("msg", queryOrder);
|
||||
}else{
|
||||
body.put("statusCode", "01");
|
||||
body.put("msg", checkGPSStatus);
|
||||
}
|
||||
body.put("flowunid", flowunid);//流程id
|
||||
ReturnMapUtil.setReturnMap(body,
|
||||
RestfullConstant.baseProperty.get("success").toString(), "");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> alterOrder(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"); // 参数
|
||||
Map<String, Object> body = new HashMap<String, Object>();
|
||||
String flowunid = fieldMap.get("flowunid") == null ? "" : fieldMap.get("flowunid").toString();
|
||||
String userid = fieldMap.get("userid") == null ? "" : fieldMap.get("userid").toString();
|
||||
String checkGPSStatus = this.checkGPSStatus(flowunid);
|
||||
if("true".equals(checkGPSStatus)){
|
||||
String contact_name = fieldMap.get("CONTACT_NAME") == null ? "" :fieldMap.get("CONTACT_NAME").toString();//现场联系人
|
||||
String contact_phone = fieldMap.get("CONTACT_PHONE") == null ? "" : fieldMap.get("CONTACT_PHONE").toString();//现场联系人电话
|
||||
String install_time = fieldMap.get("INSTALL_TIME") == null ? "" : fieldMap.get("INSTALL_TIME").toString();//上门时间
|
||||
String address_code = fieldMap.get("ADDRESS_CODE") == null ? "" : fieldMap.get("ADDRESS_CODE").toString();//上门地址最新国标编码
|
||||
String address_detail = fieldMap.get("ADDRESS_DETAIL") == null ? "" : fieldMap.get("ADDRESS_DETAIL").toString();//详细地址
|
||||
String wired_num = fieldMap.get("WIRED_NUM") == null ? "" : fieldMap.get("WIRED_NUM").toString();//有线设备数量
|
||||
String wireless_num = fieldMap.get("WIRELESS_NUM") == null ? "" : fieldMap.get("WIRELESS_NUM").toString();//无线设备数量
|
||||
|
||||
|
||||
BizObjectManager lgtManage = JBOFactory.getFactory().getManager(LM_GPS_ORDER_TEMP.CLASS_NAME,tx);
|
||||
BizObject gpslgot =lgtManage.createQuery(" flowunid=:flowunid ").setParameter("flowunid", flowunid).getSingleResult(true);
|
||||
GpsController gpsC = new GpsController();
|
||||
StringBuffer params = new StringBuffer();
|
||||
params.append(contact_name);
|
||||
params.append("@"+contact_phone);
|
||||
params.append("@"+gpslgot.getAttribute("PICCONTACT_NAME"));
|
||||
params.append("@"+gpslgot.getAttribute("PICCONTACT_PHONE"));
|
||||
params.append("@"+install_time);
|
||||
params.append("@"+address_code);
|
||||
params.append("@"+address_detail);
|
||||
params.append("@"+gpslgot.getAttribute("CAR_VIN"));
|
||||
params.append("@"+wired_num);
|
||||
params.append("@"+gpslgot.getAttribute("WIRED_PERIOD"));
|
||||
params.append("@"+wireless_num);
|
||||
params.append("@"+gpslgot.getAttribute("WIRELESS_PERIOD"));
|
||||
params.append("@"+gpslgot.getAttribute("CAR_ACCOUNT"));
|
||||
|
||||
gpsC.setApplyNo(gpslgot.getAttribute("APPLY_NO").getString());
|
||||
gpsC.setProjectId(gpslgot.getAttribute("PROJECT_ID").getString());
|
||||
gpsC.setUserId(userid);
|
||||
gpsC.setFlowUnid(flowunid);
|
||||
gpsC.setParams(params.toString());
|
||||
gpsC.setVin(gpslgot.getAttribute("CAR_VIN").getString());
|
||||
String alterOrder = gpsC.alterOrder(tx);
|
||||
if(alterOrder.equals("修改成功!")){
|
||||
gpslgot.setAttributeValue("CONTACT_NAME", contact_name);//现场联系人
|
||||
gpslgot.setAttributeValue("CONTACT_PHONE", contact_phone);//现场联系人电话
|
||||
gpslgot.setAttributeValue("INSTALL_TIME", install_time);//上门时间
|
||||
gpslgot.setAttributeValue("ADDRESS_CODE",address_code);//上门地址最新国标编码
|
||||
gpslgot.setAttributeValue("ADDRESS_DETAIL", address_detail);//详细地址
|
||||
gpslgot.setAttributeValue("WIRED_NUM", wired_num);//有线设备数量
|
||||
gpslgot.setAttributeValue("WIRELESS_NUM", wireless_num);//无线设备数量
|
||||
lgtManage.saveObject(gpslgot);
|
||||
body.put("statusCode", "00");
|
||||
body.put("msg", alterOrder);
|
||||
}else{
|
||||
body.put("statusCode", "01");
|
||||
body.put("msg", alterOrder);
|
||||
}
|
||||
|
||||
}else{
|
||||
body.put("statusCode", "01");
|
||||
body.put("msg", checkGPSStatus);
|
||||
}
|
||||
body.put("flowunid", flowunid);//流程id
|
||||
ReturnMapUtil.setReturnMap(body,
|
||||
RestfullConstant.baseProperty.get("success").toString(), "");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> cancelOrder(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"); // 参数
|
||||
Map<String, Object> body = new HashMap<String, Object>();
|
||||
String flowunid = fieldMap.get("flowunid") == null ? "" : fieldMap.get("flowunid").toString();
|
||||
String userid = fieldMap.get("userid") == null ? "" : fieldMap.get("userid").toString();
|
||||
String checkGPSStatus = this.checkGPSStatus(flowunid);
|
||||
if("true".equals(checkGPSStatus)){
|
||||
BizObject gpslgot = this.gpsBizObject(flowunid);
|
||||
GpsController gpsC = new GpsController();
|
||||
|
||||
gpsC.setApplyNo(gpslgot.getAttribute("APPLY_NO").getString());
|
||||
gpsC.setProjectId(gpslgot.getAttribute("PROJECT_ID").getString());
|
||||
gpsC.setUserId(userid);
|
||||
gpsC.setFlowUnid(flowunid);
|
||||
|
||||
String cancelOrder = gpsC.cancelOrder(tx);
|
||||
body.put("statusCode", "00");
|
||||
body.put("msg", cancelOrder);
|
||||
}else{
|
||||
body.put("statusCode", "01");
|
||||
body.put("msg", checkGPSStatus);
|
||||
}
|
||||
body.put("flowunid", flowunid);//流程id
|
||||
ReturnMapUtil.setReturnMap(body,
|
||||
RestfullConstant.baseProperty.get("success").toString(), "");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> showGPSImage(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"); // 参数
|
||||
Map<String, Object> body = new HashMap<String, Object>();
|
||||
String flowunid = fieldMap.get("flowunid") == null ? "" : fieldMap.get("flowunid").toString();
|
||||
|
||||
ReturnMapUtil.setReturnMap(body,
|
||||
RestfullConstant.baseProperty.get("success").toString(), "");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
|
||||
public BizObject gpsBizObject(String flowunid) throws Exception{
|
||||
BizObjectManager lgtManage = JBOFactory.getFactory().getManager(LM_GPS_ORDER_TEMP.CLASS_NAME);
|
||||
return lgtManage.createQuery(" flowunid=:flowunid ").setParameter("flowunid", flowunid).getSingleResult(true);
|
||||
|
||||
}
|
||||
public String checkGPSStatus(String flowUnid) throws Exception{
|
||||
String message = "true";
|
||||
BizObject lgt = this.gpsBizObject(flowUnid);
|
||||
if(lgt == null ){
|
||||
message = "GPS信息未提交无法查询!";
|
||||
}else{
|
||||
String gpsStatus = lgt.getAttribute("STATUS")==null?"":lgt.getAttribute("STATUS").getString();
|
||||
if("7".equals(gpsStatus)){
|
||||
message = "请先提交工单!";
|
||||
}else{
|
||||
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user