作者 shenhailong

修改预配远程调用 接口名称 接口添加 参数是否为空 判断 安检添加 后台校验 货物品名是否为空

... ... @@ -1253,67 +1253,87 @@ public class ManifestController extends BasicController {
* @param manifest
* @return
*/
@RequestMapping(value = "/savesenManifest", method = { RequestMethod.POST })
@RequestMapping(value = "/f5f5669bbdecefd3dacfaba194647c35", method = { RequestMethod.POST })
@ResponseBody
public ResponseModel savesenManifest(ManifestEntity manifest, HttpServletRequest request, HttpServletResponse response) {
ResponseModel model = new ResponseModel();
if ("dcdf38d9a5d6411985e49155481882f5".equals(manifest.getDe_size())){
try {
if ("dcdf38d9a5d6411985e49155481882f5".equals(manifest.getDe_size())) {
if (StringUtils.isBlank(manifest.getWaybillnomaster()) || StringUtils.isBlank(manifest.getDe_type())
|| StringUtils.isBlank(manifest.getDelivery_station()) || StringUtils.isBlank(manifest.getFlightno())
|| manifest.getFlightdate() == null || StringUtils.isBlank(manifest.getOriginatingstation())
|| StringUtils.isBlank(manifest.getDestinationstation()) || StringUtils.isBlank(manifest.getTotalpiece())
|| StringUtils.isBlank(manifest.getTotalweight()) || StringUtils.isBlank(manifest.getPaymode())
|| StringUtils.isBlank(manifest.getCustomsstatus()) || StringUtils.isBlank(manifest.getCustomscode())
|| StringUtils.isBlank(manifest.getName_ofgoods()) || StringUtils.isBlank(manifest.getCo_company())
|| StringUtils.isBlank(manifest.getCo_address()) || StringUtils.isBlank(manifest.getShpcusid())
|| StringUtils.isBlank(manifest.getCo_country()) || StringUtils.isBlank(manifest.getSh_company())
|| StringUtils.isBlank(manifest.getSh_address()) || StringUtils.isBlank(manifest.getCnecusid())
|| StringUtils.isBlank(manifest.getSh_country()) || StringUtils.isBlank(manifest.getSh_city())
|| StringUtils.isBlank(manifest.getReach_station()) || manifest.getUSER_ID() == null){
model.setStatus(203);
model.setMsg("缺少参数");
if(manifest.getWaybillnomaster().contains("-")){
}else {
if (manifest.getWaybillnomaster().contains("-")) {
}else {
StringBuilder stringBuilder = new StringBuilder(manifest.getWaybillnomaster());
} else {
StringBuilder stringBuilder = new StringBuilder(manifest.getWaybillnomaster());
StringBuilder waybill = stringBuilder.insert(3, "-");
StringBuilder waybill = stringBuilder.insert(3, "-");
manifest.setWaybillnomaster(waybill.toString());
manifest.setWaybillnomaster(waybill.toString());
}
}
manifest.setDe_size("");
manifest.setDe_size("");
String flightno = manifest.getFlightno();
String carrier = "";
if (StringUtils.isNotBlank(flightno) && flightno.length() > 2) {
carrier = flightno.substring(0, 2);
flightno = flightno.replace(carrier, "");
}
manifest.setCarrier(carrier);
manifest.setFlightno(flightno);
String flightno = manifest.getFlightno();
String carrier = "";
if (StringUtils.isNotBlank(flightno) && flightno.length() > 2) {
carrier = flightno.substring(0, 2);
flightno = flightno.replace(carrier, "");
}
manifest.setCarrier(carrier);
manifest.setFlightno(flightno);
try {
// manifest.setUSER_ID(Tools.getUserId());
ManifestEntity wbm = manifestService.findWbm(manifest.getWaybillnomaster());
if (wbm != null) {
model.setStatus(201);
model.setMsg("该订单号已存在!");
} else {
WaybillReceiptType type = WaybillReceiptType.TEMP_SAVE;
String stowagedate = request.getParameter("stowagedate");
manifest.setStowagedate(ManifestEntity.getStowagedate(stowagedate));
// 保存
manifest.setIsdelete(1);
manifest.setResponse_code(String.valueOf(type.getValue()));
manifest.setResponse_text(type.getName());
manifest.setSave_time(System.currentTimeMillis());
manifestService.save(manifest);
model.setData(manifest);
model.setStatus(200);
model.setMsg(HttpJsonMsg.SUCCESS);
// manifest.setUSER_ID(Tools.getUserId());
ManifestEntity wbm = manifestService.findWbm(manifest.getWaybillnomaster());
if (wbm != null) {
model.setStatus(201);
model.setMsg("该订单号已存在!");
} else {
WaybillReceiptType type = WaybillReceiptType.TEMP_SAVE;
String stowagedate = request.getParameter("stowagedate");
manifest.setStowagedate(ManifestEntity.getStowagedate(stowagedate));
// 保存
manifest.setIsdelete(1);
manifest.setResponse_code(String.valueOf(type.getValue()));
manifest.setResponse_text(type.getName());
manifest.setSave_time(System.currentTimeMillis());
manifestService.save(manifest);
model.setData(manifest);
model.setStatus(200);
model.setMsg(HttpJsonMsg.SUCCESS);
}
}
} catch (Exception e) {
model.setStatus(500);
model.setMsg(HttpJsonMsg.ERROR);
logger.error("系统异常 >>", e);
}else{
model.setStatus(202);
model.setMsg("缺少验证密码");
}
}else {
model.setStatus(202);
model.setMsg("缺少验证密码");
} catch (Exception e) {
model.setStatus(500);
model.setMsg(HttpJsonMsg.ERROR);
logger.error("系统异常 >>", e);
}
return model;
}
... ...
... ... @@ -200,7 +200,7 @@ public class SecurityDeclarationController {
sdCargoTypeService.save(sdCargoTypeEntity);
}
if(StringUtils.isBlank(cargoName)){
if(!StringUtils.isBlank(cargoName)){
//货物品名
String cName = cargoName.replaceAll(",", ",");
String[] split = cName.split(",");
... ...
... ... @@ -29,7 +29,7 @@ public class MyShiroController implements Filter {
}
private String publicAction[] = { "/login", "/doLogin", "/manifest/app/send",
"/receipt/a0608c4054662dd902e1314f7e450e3eaa81c114", "/manifest/savesenManifest" };
"/receipt/a0608c4054662dd902e1314f7e450e3eaa81c114", "/manifest/f5f5669bbdecefd3dacfaba194647c35" };
private String crossDomain[] = { "/cross/", "tracking/detail" };
// manifest/cross/grid.json
... ...
... ... @@ -70,16 +70,14 @@
<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
<property name="securityManager" ref="securityManager" />
<property name="loginUrl" value="/login" />
<property name="unauthorizedUrl" value="/unauthorized" />
<!--<property name="unauthorizedUrl" value="/manifest/savesendMainfest" />-->
<property name="filterChainDefinitions">
<value>
/receipt/a0608c4054662dd902e1314f7e450e3eaa81c114 = anon
/login = anon
<!--开放预配添加接口-->
/manifest/savesend = anon
<!--/manifest/savesenManifest = anon-->
/druid/** = anon
/unauthorized = anon
/resource/** = anon
... ... @@ -89,10 +87,8 @@
/change/passwd= anon
/captcha/** = anon
/fileDownload/** = anon
/**/cross/** = anon
/tracking/detail/** = anon
/manifest/save = anon
/logout = logout
/** = anon
... ...
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:p="http://www.springframework.org/schema/p" xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="http://www.springframework.org/schema/beans
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:p="http://www.springframework.org/schema/p" xmlns:task="http://www.springframework.org/schema/task"
xmlns:jawxs="http://cxf.apache.org/jaxws"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
... ... @@ -12,7 +14,7 @@
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/task
http://www.springframework.org/schema/task/spring-task-4.0.xsd">
http://www.springframework.org/schema/task/spring-task-4.0.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
<mvc:cors>
<mvc:mapping path="/api/**" allowed-origins="http://d.demo.com:8080"
... ... @@ -122,5 +124,4 @@
<!-- <context:component-scan base-package="com.agent.billcheck"/>
<task:annotation-driven/> -->
</beans>
\ No newline at end of file
... ...