作者 朱兆平

新舱单辅助管理-直接改配优化

FROM java:8u111
VOLUME /tmp
ADD *.jar app.jar
EXPOSE 10001
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo "Asia/Shanghai" > /etc/timezone && dpkg-reconfigure -f noninteractive tzdata
COPY xsd /xsd
ENTRYPOINT ["java","-jar","/app.jar"]
# Ubuntu 时区
... ...
... ... @@ -151,6 +151,22 @@
<verbose>true</verbose>
</configuration>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions> <execution>
<id>gen-webadmin</id>
<phase>package</phase>
<configuration>
<tasks>
<copy todir="docker" file="target/${project.artifactId}-${project.version}.${project.packaging}" />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
... ...
... ... @@ -29,11 +29,12 @@ import java.io.File;
import java.io.IOException;
import java.util.Date;
import java.util.List;
@Slf4j
@RestController
@RequestMapping("/mt8024/")
@RequestMapping("/mt8204/")
public class MT8204Controller {
@Autowired
... ... @@ -47,7 +48,7 @@ public class MT8204Controller {
@RequestParam(value = "waybillnomaster",required = false) String waybillNo){
MANIFEST_AIR_CHANGE manifest_air_change = new MANIFEST_AIR_CHANGE();
if(StringUtils.isNotEmpty(flightDate)){
Date flight_Date = DateUtil.parseDate(flightDate,"yyyy-MM-dd");
Date flight_Date = DateUtil.parseDate(flightDate,"yyyyMMdd");
manifest_air_change.setFlightDate(flight_Date);
}
manifest_air_change.setFlightno(flightNo);
... ... @@ -85,7 +86,9 @@ public class MT8204Controller {
}
@PostMapping("batchSend")
public ResultJson batchSend(@RequestBody MANIFEST_AIR_CHANGE manifest_air_change,@CookieValue("username") String username,@CookieValue("userid") String userid){
return mt8204Service.send(manifest_air_change,username) ? new ResultJson(ResponseReason.MT8204_SUCCESS) : new ResultJson(ResponseReason.MT8204_SEND_ERR);
public ResultJson batchSend(@RequestBody List<String> autoIDlist, @CookieValue("username") String username, @CookieValue("userid") String userid){
ResultJson resultJson = mt8204Service.batchSend(autoIDlist,username);
return resultJson;
// : new ResultJson(ResponseReason.MT8204_SEND_ERR);
}
}
... ...
... ... @@ -5,7 +5,8 @@ public enum ResponseReason {
MT8204_ADD_ERR("8204400","直接改配申请添加失败,存在重复申请,请检查后重试"),
MT8204_EDIT_ERR("8204401","直接改配申请更新失败"),
MT8204_DEL_ERR("8204402","直接改配申请更新失败"),
MT8204_SEND_ERR("8204404","直接改配发送失败");
MT8204_SEND_ERR("8204404","直接改配发送失败"),
MT8204_BATCH_SUCCESS("200","直接改配批量申请操作成功");
private String code;
private String msg;
... ...
... ... @@ -17,6 +17,8 @@ public interface MANIFEST_AIR_CHANGEMapper {
List<MANIFEST_AIR_CHANGE> selectList(MANIFEST_AIR_CHANGE record);
List<MANIFEST_AIR_CHANGE> selectListByAutoIDS(List<String> idList);
int updateByPrimaryKeySelective(MANIFEST_AIR_CHANGE record);
int updateByPrimaryKey(MANIFEST_AIR_CHANGE record);
... ...
... ... @@ -33,9 +33,9 @@ public class MANIFEST_AIR_CHANGE {
//批量新增列表
private List<String> waybillList;
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@JsonFormat(pattern = "yyyyMMdd", timezone = "GMT+8")
private Date flightDate;
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@JsonFormat(pattern = "yyyyMMdd", timezone = "GMT+8")
private Date changeFlightDate;
public String getAutoid() {
... ...
... ... @@ -4,11 +4,16 @@ import com.github.pagehelper.PageInfo;
import com.tianbo.analysis.model.DOMTRANSIT;
import com.tianbo.analysis.model.LAND_BUSINEESTYPE_LIST_INFO;
import com.tianbo.analysis.model.MANIFEST_AIR_CHANGE;
import com.tianbo.analysis.model.ResultJson;
import java.util.List;
public interface MT8204Service {
PageInfo<MANIFEST_AIR_CHANGE> selectList(MANIFEST_AIR_CHANGE record, int pageNum, int pageSize);
public List<MANIFEST_AIR_CHANGE> selectListByAutoIDS(List<String> autoIDlist);
boolean add(MANIFEST_AIR_CHANGE record);
boolean edit(MANIFEST_AIR_CHANGE record);
... ... @@ -17,4 +22,6 @@ public interface MT8204Service {
boolean send(MANIFEST_AIR_CHANGE record,String username);
ResultJson batchSend(List<String> autoIDlist, String username);
}
... ...
... ... @@ -5,9 +5,7 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.tianbo.analysis.dao.MANIFEST_AIR_CHANGEMapper;
import com.tianbo.analysis.dao.SENDLOGMapper;
import com.tianbo.analysis.model.CustomsHead;
import com.tianbo.analysis.model.MANIFEST_AIR_CHANGE;
import com.tianbo.analysis.model.SENDLOG;
import com.tianbo.analysis.model.*;
import com.tianbo.analysis.service.MT8204Service;
import com.tianbo.util.Date.DateUtil;
import lombok.extern.slf4j.Slf4j;
... ... @@ -75,6 +73,12 @@ public class MT8204ServiceImp implements MT8204Service {
}
@Override
public List<MANIFEST_AIR_CHANGE> selectListByAutoIDS(List<String> autoIDlist){
List<MANIFEST_AIR_CHANGE> list = manifest_air_changeMapper.selectListByAutoIDS(autoIDlist);
return list;
}
@Override
public boolean add(MANIFEST_AIR_CHANGE record) {
if (record.getWaybillList()!=null && !record.getWaybillList().isEmpty()){
int i=0;
... ... @@ -191,6 +195,23 @@ public class MT8204ServiceImp implements MT8204Service {
}
}
@Override
public ResultJson batchSend(List<String> autoIDlist, String username) {
ResultJson resultJson = new ResultJson();
String message = "";
List<MANIFEST_AIR_CHANGE> list = selectListByAutoIDS(autoIDlist);
for (MANIFEST_AIR_CHANGE manifestAirChange : list) {
boolean result = send(manifestAirChange,username);
if (!result){
message = message + manifestAirChange.getWaybillnomaster() +"发送失败\n";
}
}
resultJson.setCode("200");
resultJson.setMsg(message);
return resultJson;
}
public boolean validateXMLSchema(String xsdPath, String xmlStr) throws IOException {
ByteArrayInputStream bais = new ByteArrayInputStream(xmlStr.getBytes("UTF-8"));
try {
... ...
... ... @@ -77,6 +77,40 @@
</if>
order by CREATEDATE desc
</select>
<select id="selectListByAutoIDS" resultMap="BaseResultMap" parameterType="java.util.List" >
SELECT
<include refid="Custom_Receipt" />
FROM
(
SELECT
<include refid="Custom_Receipt" />
FROM
(
SELECT
<include refid="Base_Column_List" />
FROM
MANIFEST_AIR_CHANGE
where AUTOID in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
) t1
LEFT JOIN (
SELECT
RECEIPTION,
MESSAGEAUTOID,
MESSAGETYPE,
ROW_NUMBER () OVER ( PARTITION BY MESSAGEAUTOID ORDER BY CREATEDATE DESC ) rn
FROM
SENDLOG
where
MESSAGETYPE = 'MT8204'
) t2 ON t1.AUTOID = t2.MESSAGEAUTOID
AND t2.rn = 1
) t3
order by CREATEDATE desc
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
delete from CGONMS.MANIFEST_AIR_CHANGE
where AUTOID = #{autoid,jdbcType=VARCHAR}
... ...