TCntrnoServiceImpl.java 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965
  1. package com.ruoyi.shipping.service.impl;
  2. import java.io.IOException;
  3. import java.io.InputStream;
  4. import java.math.BigDecimal;
  5. import java.text.ParseException;
  6. import java.text.SimpleDateFormat;
  7. import java.util.*;
  8. import java.util.concurrent.ConcurrentHashMap;
  9. import java.util.function.Function;
  10. import java.util.function.Predicate;
  11. import java.util.stream.Collectors;
  12. import com.alibaba.fastjson.JSONArray;
  13. import com.alibaba.fastjson.JSONObject;
  14. import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
  15. import com.ruoyi.common.constant.UserConstants;
  16. import com.ruoyi.common.core.domain.AjaxResult;
  17. import com.ruoyi.common.core.domain.entity.SysDictData;
  18. import com.ruoyi.common.core.domain.model.LoginUser;
  19. import com.ruoyi.common.utils.DateUtils;
  20. import com.ruoyi.common.utils.SecurityUtils;
  21. import com.ruoyi.common.utils.StringUtils;
  22. import com.ruoyi.shipping.domain.*;
  23. import com.ruoyi.shipping.excel.*;
  24. import com.ruoyi.shipping.mapper.*;
  25. import com.ruoyi.system.mapper.SysDictDataMapper;
  26. import org.apache.poi.hssf.usermodel.HSSFDateUtil;
  27. import org.apache.poi.openxml4j.util.ZipSecureFile;
  28. import org.apache.poi.ss.usermodel.*;
  29. import org.apache.poi.ss.util.CellReference;
  30. import org.apache.poi.xssf.streaming.SXSSFWorkbook;
  31. import org.apache.poi.xssf.usermodel.XSSFWorkbook;
  32. import org.springframework.beans.BeanUtils;
  33. import org.springframework.beans.factory.annotation.Autowired;
  34. import org.springframework.stereotype.Service;
  35. import com.ruoyi.shipping.service.ITCntrnoService;
  36. import org.springframework.transaction.annotation.Transactional;
  37. import org.springframework.transaction.interceptor.TransactionAspectSupport;
  38. import org.springframework.web.multipart.MultipartFile;
  39. import static com.ruoyi.common.utils.poi.Excel.filter;
  40. /**
  41. * 集装箱号Service业务层处理
  42. *
  43. * @author ruoyi
  44. * @date 2021-03-22
  45. */
  46. @Service
  47. public class TCntrnoServiceImpl implements ITCntrnoService {
  48. @Autowired
  49. private TCntrnoMapper tCntrnoMapper;
  50. @Autowired
  51. private TCntrtrackingMapper tCntrtrackingMapper;
  52. @Autowired
  53. private TCntrMapper tCntrMapper;
  54. @Autowired
  55. private SysDictDataMapper sysDictDataMapper;
  56. @Autowired
  57. private TAddressMapper tAddressMapper;
  58. @Autowired
  59. private TConditionAccessoryMapper tConditionAccessoryMapper;
  60. /**
  61. * 查询集装箱号
  62. *
  63. * @param fId 集装箱号ID
  64. * @return 集装箱号
  65. */
  66. @Override
  67. public TCntrno selectTCntrnoById(Long fId) {
  68. return tCntrnoMapper.selectTCntrnoById(fId);
  69. }
  70. /**
  71. * 查询集装箱号列表
  72. *
  73. * @param tCntrno 集装箱号
  74. * @return 集装箱号
  75. */
  76. @Override
  77. public List<TCntrno> selectTCntrnoList(TCntrno tCntrno) {
  78. return tCntrnoMapper.selectTCntrnoList(tCntrno);
  79. }
  80. /**
  81. * 新增集装箱号
  82. *
  83. * @param tCntrno 集装箱号
  84. * @return 结果
  85. */
  86. @Override
  87. public int insertTCntrno(TCntrno tCntrno) {
  88. tCntrno.setCreateTime(DateUtils.getNowDate());
  89. tCntrno.setCreateBy(SecurityUtils.getUsername());
  90. tCntrno.setfUpdatetime(DateUtils.getNowDate());
  91. tCntrno.setfStatus("T");
  92. return tCntrnoMapper.insertTCntrno(tCntrno);
  93. }
  94. /**
  95. * 修改集装箱号
  96. *
  97. * @param tCntrno 集装箱号
  98. * @return 结果
  99. */
  100. @Override
  101. @Transactional
  102. public int updateTCntrno(List<TCntrno> tCntrno) {
  103. int update = 0;
  104. if (CollectionUtils.isNotEmpty(tCntrno)) {
  105. for (TCntrno cntrno : tCntrno) {
  106. String remark = cntrno.getRemark();
  107. cntrno.setUpdateTime(DateUtils.getNowDate());
  108. cntrno.setUpdateBy(SecurityUtils.getUsername());
  109. //最新时间
  110. if (cntrno.getFoldtime() == null) {
  111. cntrno.setfUpdatetime(DateUtils.getNowDate());
  112. } else {
  113. cntrno.setfUpdatetime(cntrno.getFoldtime());
  114. }
  115. //调入地点
  116. if (StringUtils.isNotEmpty(cntrno.getFoldSite())) {
  117. cntrno.setfUpdateaddress(cntrno.getFoldSite());
  118. }
  119. //调入空重
  120. if (StringUtils.isNotEmpty(cntrno.getFoldFUpdateef())) {
  121. cntrno.setfUpdateef(cntrno.getFoldFUpdateef());
  122. }
  123. //调入状态
  124. if (StringUtils.isNotEmpty(cntrno.getFoldFCntrstatus())) {
  125. cntrno.setfCntrstatus(cntrno.getFoldFCntrstatus());
  126. }
  127. if (StringUtils.isNotEmpty(remark)) {
  128. cntrno.setRemark(null);
  129. }
  130. //更改t_cntro表信息
  131. update = tCntrnoMapper.updateTCntrno((cntrno));
  132. //保存信息
  133. TCntrno cntrnoById = tCntrnoMapper.selectTCntrnoById(cntrno.getfId());
  134. if (cntrnoById.getfStatus().equals("T") || cntrnoById.getfStatus().equals("正常")) {
  135. cntrnoById.setfStatus("T");
  136. } else {
  137. cntrnoById.setfStatus("F");
  138. }
  139. if (StringUtils.isNotEmpty(cntrno.getfMblno())) {//提单号
  140. cntrnoById.setfMblno(cntrno.getfMblno());
  141. }
  142. if (StringUtils.isNotEmpty(cntrno.getfVoy())) {//航次
  143. cntrnoById.setfVoy(cntrno.getfVoy());
  144. }
  145. if (StringUtils.isNotEmpty(cntrno.getfVsl())) {//船名
  146. cntrnoById.setfVsl(cntrno.getfVsl());
  147. }
  148. if (StringUtils.isNotEmpty(remark)) {
  149. cntrnoById.setRemark(remark);
  150. }
  151. TCntrtracking setfield = setfield(cntrnoById);
  152. tCntrtrackingMapper.insertTCntrtracking(setfield);
  153. if (CollectionUtils.isNotEmpty(cntrno.getAccessoryList())) {
  154. for (TConditionAccessory tConditionAccessory : cntrno.getAccessoryList()) {
  155. tConditionAccessory.setfOrgId(10L);
  156. tConditionAccessory.setfPid(setfield.getfId());
  157. tConditionAccessory.setCreateBy(SecurityUtils.getUsername());
  158. tConditionAccessory.setCreateTime(DateUtils.getNowDate());
  159. tConditionAccessoryMapper.insertTConditionAccessory(tConditionAccessory);
  160. }
  161. }
  162. }
  163. }
  164. return update;
  165. }
  166. @Override
  167. @Transactional
  168. public AjaxResult updateAirForceStation(List<TCntrno> tCntrno) {
  169. int update = 0;
  170. if (CollectionUtils.isNotEmpty(tCntrno)) {
  171. for (TCntrno cntrno : tCntrno) {
  172. String remark = cntrno.getRemark();
  173. cntrno.setUpdateTime(DateUtils.getNowDate());
  174. cntrno.setUpdateBy(SecurityUtils.getUsername());
  175. TCntrno cnTrNoByfNo = tCntrnoMapper.selectTCnTrNoByfNo(cntrno.getfNo());
  176. if (cnTrNoByfNo == null){
  177. TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
  178. return AjaxResult.error("箱号:"+cntrno.getfNo()+"系统中不存在请维护");
  179. }else {
  180. cntrno.setfId(cnTrNoByfNo.getfId());
  181. //更改t_cntro表信息
  182. update = tCntrnoMapper.updateTCntrno((cntrno));
  183. }
  184. //保存历史信息
  185. TCntrno cntrnoById = tCntrnoMapper.selectTCntrnoById(cntrno.getfId());
  186. if (cntrnoById.getfStatus().equals("T") || cntrnoById.getfStatus().equals("正常")) {
  187. cntrnoById.setfStatus("T");
  188. } else {
  189. cntrnoById.setfStatus("F");
  190. }
  191. if (StringUtils.isNotEmpty(cntrno.getfMblno())) {//提单号
  192. cntrnoById.setfMblno(cntrno.getfMblno());
  193. }
  194. if (StringUtils.isNotEmpty(cntrno.getfVoy())) {//航次
  195. cntrnoById.setfVoy(cntrno.getfVoy());
  196. }
  197. if (StringUtils.isNotEmpty(cntrno.getfVsl())) {//船名
  198. cntrnoById.setfVsl(cntrno.getfVsl());
  199. }
  200. if (StringUtils.isNotEmpty(remark)) {
  201. cntrnoById.setRemark(remark);
  202. }
  203. TCntrtracking setfield = setfield(cntrnoById);
  204. update = tCntrtrackingMapper.insertTCntrtracking(setfield);
  205. }
  206. }
  207. if (update <= 0 ){
  208. TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
  209. return AjaxResult.error("保存场站信息失败");
  210. }
  211. return AjaxResult.success();
  212. }
  213. @Override
  214. @Transactional
  215. public int updateTCntrnoMessage(TCntrno tCntrno) {
  216. tCntrno.setUpdateTime(DateUtils.getNowDate());
  217. tCntrno.setUpdateBy(SecurityUtils.getUsername());
  218. tCntrno.setfUpdatetime(DateUtils.getNowDate());
  219. if (tCntrno.getfStatus().equals("T") || tCntrno.getfStatus().equals("正常")) {
  220. tCntrno.setfStatus("T");
  221. } else {
  222. tCntrno.setfStatus("F");
  223. }
  224. TCntrtracking setfield = setfield(tCntrno);
  225. tCntrtrackingMapper.insertTCntrtracking(setfield);
  226. //更改t_cntro表信息
  227. return tCntrnoMapper.updateTCntrno((tCntrno));
  228. }
  229. /**
  230. * 批量删除集装箱号
  231. *
  232. * @param fIds 需要删除的集装箱号ID
  233. * @return 结果
  234. */
  235. @Override
  236. public int deleteTCntrnoByIds(Long[] fIds) {
  237. return tCntrnoMapper.deleteTCntrnoByIds(fIds);
  238. }
  239. /**
  240. * 删除集装箱号信息
  241. *
  242. * @param fId 集装箱号ID
  243. * @return 结果
  244. */
  245. @Override
  246. public int deleteTCntrnoById(Long fId) {
  247. return tCntrnoMapper.deleteTCntrnoById(fId);
  248. }
  249. /**
  250. * 批量更新数据状态将正常状态改为停用
  251. *
  252. * @param fIds
  253. * @return
  254. */
  255. @Override
  256. public int updateTcntrnoStatus(Long[] fIds) {
  257. return tCntrnoMapper.updateTcntrnoStatus(fIds);
  258. }
  259. @Override
  260. public List<TCntrno> selectTcntrnoMessage(TCntrno tCntrno) {
  261. return tCntrnoMapper.selectTcntrnoMessage(tCntrno, null, null, null, null, null);
  262. }
  263. @Override
  264. public List<Map<String, Object>> getTCntrnoMessage(TCntrno tCntrno,List<String> list ) {
  265. List<Map<String, Object>> mapList = new ArrayList<>();
  266. StringBuffer stringBuffer = new StringBuffer();//查类型数据
  267. StringBuffer standBuffer = new StringBuffer();//查空重
  268. /*StringBuffer bareWeightBuffer = new StringBuffer();//查好坏*/
  269. String sql = null;//查类型数据
  270. String stand = null;//查空重
  271. /*String bareWeight = null;//查好坏*/
  272. if (CollectionUtils.isNotEmpty(list)) {
  273. for (String s : list) {
  274. stringBuffer.append("MAX( CASE WHEN tt.f_no = '" + s);
  275. stringBuffer.append("' THEN tt.typeidCount ELSE 0 END ) AS '" + s + "',");
  276. standBuffer.append("MAX( CASE WHEN a.typeName ='"+s+"' AND a.dict_label = '空'");
  277. standBuffer.append("THEN a.efCount ELSE 0 END ) AS '" + s + "空',");
  278. standBuffer.append("MAX( CASE WHEN a.typeName ='"+s+"' AND a.dict_label = '重'");
  279. standBuffer.append("THEN a.efCount ELSE 0 END ) AS '" + s + "重',");
  280. /*bareWeightBuffer.append("MAX( CASE WHEN b.typeName ='"+s+"' AND b.dict_label = '好'");
  281. bareWeightBuffer.append("THEN b.statusCount ELSE 0 END ) AS '" + s + "好',");
  282. bareWeightBuffer.append("MAX( CASE WHEN b.typeName ='"+s+"' AND b.dict_label = '坏'");
  283. bareWeightBuffer.append("THEN b.statusCount ELSE 0 END ) AS '" + s + "坏',");*/
  284. }
  285. sql = stringBuffer.subSequence(0, stringBuffer.length() - 1).toString();
  286. stand = standBuffer.subSequence(0, standBuffer.length() - 1).toString();
  287. /*bareWeight = bareWeightBuffer.subSequence(0, bareWeightBuffer.length() - 1).toString();*/
  288. mapList = tCntrnoMapper.getTCntrnoMessage(sql,stand,tCntrno);
  289. }
  290. return mapList;
  291. }
  292. @Override
  293. public List<TCntrno> getTCntrnoDistribute(TCntrno tCntrno) {
  294. //箱类型不为空查箱类型id
  295. String address = null;//地点
  296. String typeidName = null;//箱类型
  297. String cntrstatusName = null;//箱状态
  298. String updateEFName = null;//空重
  299. if (StringUtils.isNotEmpty(tCntrno.getAddressName())) {
  300. address = tCntrno.getAddressName();
  301. }else {
  302. tCntrno.setfUpdateaddress("0");
  303. }
  304. if (StringUtils.isNotEmpty(tCntrno.getTypeidName())) {
  305. typeidName = tCntrno.getTypeidName();
  306. }
  307. //箱状态不为空查箱状态
  308. if (StringUtils.isNotEmpty(tCntrno.getCntrstatusName())) {
  309. cntrstatusName = tCntrno.getCntrstatusName();
  310. }
  311. //箱空重部位空查空重
  312. if (StringUtils.isNotEmpty(tCntrno.getUpdateEFName())) {
  313. updateEFName = tCntrno.getUpdateEFName();
  314. }
  315. return tCntrnoMapper.selectTcntrnoMessage(tCntrno, address, typeidName, cntrstatusName, updateEFName, tCntrno.getCntrsize());
  316. }
  317. @Override
  318. public List<String> getTCntrnoChange(TCntrno tCntrno) {
  319. List<String> key = new ArrayList<>();
  320. key.add("地点");
  321. /*List<String> list = tCntrMapper.selectTCntrFNo();
  322. List<String> mapList = new ArrayList<>();
  323. if (CollectionUtils.isNotEmpty(list)){
  324. for (String s : list) {
  325. mapList.add(s);
  326. mapList.add(s+"空");
  327. mapList.add(s+"重");
  328. *//* mapList.add(s+"好");
  329. mapList.add(s+"坏");*//*
  330. }
  331. }
  332. list.addAll(mapList);
  333. Collections.sort(list);*/
  334. key.add("20GP");
  335. key.add("20HC");
  336. key.add("20GP空");
  337. key.add("20GP重");
  338. key.add("20HC空");
  339. key.add("20HC重");
  340. return key;
  341. }
  342. @Override
  343. public String selectTCntrnoFNo(TCntrno tCntrno) {
  344. TCntrno cntrno = tCntrnoMapper.selectTCntrnoFNo(tCntrno);
  345. if (StringUtils.isNotNull(cntrno) && !cntrno.getfId().equals(tCntrno.getfId())) {
  346. return UserConstants.NOT_UNIQUE;
  347. }
  348. return UserConstants.UNIQUE;
  349. }
  350. /**
  351. * 后续维护
  352. *
  353. * @param fileName 更新箱信息数据列表
  354. * @return
  355. */
  356. @Override
  357. public AjaxResult importUpdateDataTcntrnoExcel(MultipartFile fileName) {
  358. return null;
  359. }
  360. /**
  361. * 后续维护
  362. *
  363. * @param fileName 更新箱信息数据列表
  364. * @return
  365. */
  366. @Override
  367. public AjaxResult importTcntrnoDataExcel(MultipartFile fileName) {
  368. return null;
  369. }
  370. @Override
  371. public AjaxResult importCreateCompanyMsg(MultipartFile file) throws Exception {
  372. List<TCntrnoExcel> fleetCompanyMsgs = new ArrayList<>();
  373. InputStream inputStream = null;
  374. try {
  375. inputStream = file.getInputStream();
  376. String originalFilename = file.getOriginalFilename();
  377. Workbook workbook = null;
  378. if (originalFilename.endsWith("xls")) {
  379. workbook = WorkbookFactory.create(inputStream);
  380. } else if (originalFilename.endsWith("xlsx")) {
  381. workbook = new XSSFWorkbook(inputStream);
  382. }
  383. Sheet sheet = workbook.getSheetAt(0);
  384. int line = 0;
  385. for (Row rows : sheet) {
  386. line++;
  387. if (rows.getRowNum() == 0) {
  388. continue;
  389. }
  390. TCntrnoExcel companyMsg = new TCntrnoExcel();
  391. for (int a = 0; a < rows.getPhysicalNumberOfCells(); a++) {
  392. Cell cell = rows.getCell(a);
  393. if (cell == null){
  394. continue;
  395. }
  396. String value = filter(sheet.getRow(0), CellReference.convertNumToColString(cell.getColumnIndex()));
  397. switch (value) {
  398. case "箱号":
  399. //设置单元格类型
  400. cell.setCellType(CellType.STRING);
  401. if (StringUtils.isEmpty(cell.getStringCellValue())) {
  402. /*return AjaxResult.error("Excel箱信息数据第" + line + "行数据缺少箱号");*/
  403. break;
  404. }
  405. companyMsg.setfNo(cell.getStringCellValue());
  406. break;
  407. case "箱类型":
  408. //设置单元格类型
  409. cell.setCellType(CellType.STRING);
  410. if (StringUtils.isEmpty(cell.getStringCellValue())) {
  411. /*return AjaxResult.error("Excel箱信息数据第" + line + "箱类型");*/
  412. break;
  413. }
  414. companyMsg.setTypeidName(cell.getStringCellValue());
  415. if (StringUtils.isNotEmpty(cell.getStringCellValue())) {
  416. Long fId = tCntrMapper.selectRcntrFId(companyMsg.getTypeidName());
  417. companyMsg.setfTypeid(fId);
  418. }
  419. break;
  420. case "最新地点":
  421. //设置单元格类型
  422. cell.setCellType(CellType.STRING);
  423. if (StringUtils.isEmpty(cell.getStringCellValue())) {
  424. /*return AjaxResult.error("Excel箱信息数据第" + line + "行数据缺少最新地点");*/
  425. break;
  426. }
  427. companyMsg.setAddressName((cell.getStringCellValue()));
  428. break;
  429. case "租赁公司":
  430. //设置单元格类型
  431. cell.setCellType(CellType.STRING);
  432. if (StringUtils.isEmpty(cell.getStringCellValue())) {
  433. /*return AjaxResult.error("Excel箱信息数据第" + line + "行数据缺少货名");*/
  434. break;
  435. }
  436. companyMsg.setOwnerName(cell.getStringCellValue());
  437. if (StringUtils.isNotEmpty(cell.getStringCellValue())) {
  438. String fPackageid = sysDictDataMapper.selectDictValue("f_owner", cell.getStringCellValue());
  439. if (StringUtils.isNotEmpty(fPackageid)) {
  440. companyMsg.setfOwner(fPackageid);
  441. }
  442. }
  443. break;
  444. case "箱状态":
  445. //设置单元格类型
  446. cell.setCellType(CellType.STRING);
  447. if (StringUtils.isEmpty(cell.getStringCellValue())) {
  448. /*return AjaxResult.error("Excel箱信息数据第" + line + "行数据缺少箱状态");*/
  449. break;
  450. }
  451. companyMsg.setCntrstatusName(cell.getStringCellValue());
  452. if (StringUtils.isNotEmpty(cell.getStringCellValue())) {
  453. String setCntrstatusid = sysDictDataMapper.selectDictValue("f_cntrstatus", cell.getStringCellValue());
  454. if (StringUtils.isNotEmpty(setCntrstatusid)) {
  455. companyMsg.setfCntrstatus(setCntrstatusid);
  456. }
  457. }
  458. break;
  459. case "空重":
  460. //设置单元格类型
  461. cell.setCellType(CellType.STRING);
  462. if (StringUtils.isEmpty(cell.getStringCellValue())) {
  463. /*return AjaxResult.error("Excel箱信息数据第" + line + "行数据缺少箱型");*/
  464. break;
  465. }
  466. companyMsg.setUpdateEFName(cell.getStringCellValue());
  467. if (StringUtils.isNotEmpty(cell.getStringCellValue())) {
  468. String setUpdateEFid = sysDictDataMapper.selectDictValue("f_updateEF", cell.getStringCellValue());
  469. if (StringUtils.isNotEmpty(setUpdateEFid)) {
  470. companyMsg.setfUpdateef(setUpdateEFid);
  471. }
  472. }
  473. break;
  474. case "地点类型":
  475. //设置单元格类型
  476. cell.setCellType(CellType.STRING);
  477. if (StringUtils.isEmpty(cell.getStringCellValue())) {
  478. /*return AjaxResult.error("Excel箱信息数据第" + line + "行数据缺少地点类型");*/
  479. break;
  480. }
  481. companyMsg.setAddressType(cell.getStringCellValue());
  482. if (StringUtils.isNotEmpty(cell.getStringCellValue())) {
  483. String fPackageid = sysDictDataMapper.selectDictValue("f_types", cell.getStringCellValue());
  484. if (StringUtils.isNotEmpty(fPackageid)) {
  485. companyMsg.setAddressTypeId(fPackageid);
  486. }
  487. }
  488. break;
  489. /*case "箱来源":
  490. //设置单元格类型
  491. cell.setCellType(CellType.STRING);
  492. companyMsg.setSourceName(cell.getStringCellValue());
  493. if (StringUtils.isNotEmpty(cell.getStringCellValue())) {
  494. String setSourceid = sysDictDataMapper.selectDictValue("f_source", cell.getStringCellValue());
  495. if (StringUtils.isNotEmpty(setSourceid)) {
  496. companyMsg.setfSource(setSourceid);
  497. }
  498. }
  499. break;
  500. case "租赁方式":
  501. //设置单元格类型
  502. cell.setCellType(CellType.STRING);
  503. companyMsg.setRentName(cell.getStringCellValue());
  504. if (StringUtils.isNotEmpty(cell.getStringCellValue())) {
  505. String setRentid = sysDictDataMapper.selectDictValue("f_rent", cell.getStringCellValue());
  506. if (StringUtils.isNotEmpty(setRentid)) {
  507. companyMsg.setfRent(setRentid);
  508. }
  509. }
  510. break;
  511. case "备注":
  512. //设置单元格类型
  513. cell.setCellType(CellType.STRING);
  514. companyMsg.setRemark(cell.getStringCellValue());
  515. break;*/
  516. }
  517. if (StringUtils.isNotEmpty(companyMsg.getAddressName()) && StringUtils.isNotEmpty(companyMsg.getAddressTypeId())) {
  518. TAddress tAddress = new TAddress();
  519. tAddress.setfName(companyMsg.getAddressName());
  520. tAddress.setfTypes(companyMsg.getAddressTypeId());
  521. TAddress address = tAddressMapper.selectAddressFName(tAddress);
  522. if (address != null){
  523. companyMsg.setfUpdateaddress(address.getfId().toString());
  524. }
  525. }
  526. }
  527. if (StringUtils.isNotEmpty(companyMsg.getfNo())){
  528. fleetCompanyMsgs.add(companyMsg);
  529. }
  530. }
  531. fleetCompanyMsgs = fleetCompanyMsgs.stream().filter(distinctByKey(TCntrnoExcel::getfNo)).collect(Collectors.toList());
  532. } catch (IOException e) {
  533. return AjaxResult.error("上传文件失败,请检查文件是否损坏");
  534. }
  535. return AjaxResult.success("success", fleetCompanyMsgs);
  536. }
  537. @Override
  538. @Transactional
  539. public AjaxResult batch(String tCntrno, LoginUser loginUser) {
  540. JSONArray jsonCrArray = JSONArray.parseArray(tCntrno);
  541. List<TCntrno> tCntrnoList = JSONObject.parseArray(jsonCrArray.toJSONString(), TCntrno.class);
  542. StringBuffer stringBuffer = new StringBuffer();
  543. if (CollectionUtils.isNotEmpty(tCntrnoList)) {
  544. for (TCntrno cntrno : tCntrnoList) {
  545. if (UserConstants.NOT_UNIQUE.equals(this.selectTCntrnoFNo(cntrno))) {
  546. stringBuffer.append(cntrno.getfNo() + "编号已存在,");
  547. continue;
  548. } else {
  549. cntrno.setCreateTime(DateUtils.getNowDate());
  550. cntrno.setCreateBy(SecurityUtils.getUsername());
  551. cntrno.setfUpdatetime(DateUtils.getNowDate());
  552. cntrno.setfStatus("T");
  553. tCntrnoMapper.insertTCntrno(cntrno);
  554. }
  555. }
  556. }
  557. if (StringUtils.isNotEmpty(stringBuffer)){
  558. return AjaxResult.success("success",stringBuffer.toString());
  559. }else {
  560. return AjaxResult.success();
  561. }
  562. }
  563. @Override
  564. public List<Map<String, Object>> getTcntrnoFno(TCntrno tCntrno) {
  565. return tCntrnoMapper.getTcntrnoFno(tCntrno);
  566. }
  567. @Override
  568. public AjaxResult importAirForceStation(MultipartFile file) throws Exception{
  569. List<TCntrno> tCntrno = new ArrayList<>();
  570. InputStream inputStream = null;
  571. inputStream = file.getInputStream();
  572. ZipSecureFile.setMinInflateRatio(-1.0d);
  573. String originalFilename = file.getOriginalFilename();
  574. Workbook workbook = null;
  575. if (originalFilename.endsWith("xls")){
  576. workbook = WorkbookFactory.create(inputStream);
  577. }else if (originalFilename.endsWith("xlsx")){
  578. workbook = new XSSFWorkbook(inputStream);
  579. }
  580. Sheet sheet = workbook.getSheetAt(0);
  581. int line = 0;
  582. for (Row rows : sheet) {
  583. line++;
  584. if (rows.getRowNum() == 0) {
  585. continue;
  586. }
  587. TCntrno companyMsg = new TCntrno();
  588. for (int a = 0; a < rows.getPhysicalNumberOfCells(); a++) {
  589. Cell cell = rows.getCell(a);
  590. if (cell == null){
  591. continue;
  592. }
  593. String value = filter(sheet.getRow(0), CellReference.convertNumToColString(cell.getColumnIndex()));
  594. switch (value) {
  595. case "箱动态":
  596. //设置单元格类型
  597. cell.setCellType(CellType.STRING);
  598. companyMsg.setOpctnstatusName(cell.getStringCellValue());
  599. if (StringUtils.isEmpty(cell.getStringCellValue())) {
  600. return AjaxResult.error("Excel箱信息数据第" + line + "行数据缺少箱动态");
  601. }
  602. String fOpCTnsTaTus = sysDictDataMapper.selectDictValue("f_opctnstatus", cell.getStringCellValue());
  603. if (StringUtils.isEmpty(fOpCTnsTaTus)){
  604. return AjaxResult.error("系统缺少箱动态"+cell.getStringCellValue()+"请维护");
  605. }
  606. companyMsg.setfOpctnstatus(fOpCTnsTaTus);
  607. break;
  608. case "箱号":
  609. //设置单元格类型
  610. cell.setCellType(CellType.STRING);
  611. if (StringUtils.isEmpty(cell.getStringCellValue())) {
  612. return AjaxResult.error("Excel箱信息数据第" + line + "行数据缺少箱号");
  613. }
  614. companyMsg.setfNo(cell.getStringCellValue());
  615. break;
  616. case "空重":
  617. //设置单元格类型
  618. cell.setCellType(CellType.STRING);
  619. if (StringUtils.isEmpty(cell.getStringCellValue())) {
  620. return AjaxResult.error("Excel箱信息数据第" + line + "行数据缺少空重");
  621. }
  622. String fUpDaTeEf = sysDictDataMapper.selectDictValue("f_updateEF", cell.getStringCellValue());
  623. if (StringUtils.isEmpty(fUpDaTeEf)){
  624. return AjaxResult.error("系统缺少空重:"+cell.getStringCellValue()+"请维护");
  625. }
  626. companyMsg.setfUpdateef(fUpDaTeEf);
  627. companyMsg.setUpdateEFName(cell.getStringCellValue());
  628. break;
  629. case "动态日期":
  630. //设置单元格类型
  631. cell.setCellType(CellType.STRING);
  632. String dataFormatString = cell.getStringCellValue();
  633. if (StringUtils.isEmpty(dataFormatString)) {
  634. return AjaxResult.error("Excel箱信息数据第" + line + "行数据缺少动态日期");
  635. }
  636. Date parse = null;
  637. try {
  638. parse = HSSFDateUtil.getJavaDate(Double.valueOf(dataFormatString));
  639. }catch (Exception e){
  640. SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  641. parse = simpleDateFormat.parse(dataFormatString);
  642. }
  643. companyMsg.setfUpdatetime(parse);
  644. break;
  645. case "船名":
  646. //设置单元格类型
  647. cell.setCellType(CellType.STRING);
  648. /*if (StringUtils.isEmpty(cell.getStringCellValue())) {
  649. return AjaxResult.error("Excel箱信息数据第" + line + "行数据缺少船名");
  650. }*/
  651. companyMsg.setfVsl(cell.getStringCellValue());
  652. break;
  653. case "航次":
  654. //设置单元格类型
  655. cell.setCellType(CellType.STRING);
  656. /*if (StringUtils.isEmpty(cell.getStringCellValue())) {
  657. return AjaxResult.error("Excel箱信息数据第" + line + "行数据缺少航次");
  658. }*/
  659. companyMsg.setfVoy(cell.getStringCellValue());
  660. break;
  661. case "重量":
  662. //设置单元格类型
  663. cell.setCellType(CellType.STRING);
  664. /*if (StringUtils.isEmpty(cell.getStringCellValue())) {
  665. return AjaxResult.error("Excel箱信息数据第" + line + "行数据缺少重量");
  666. }*/
  667. BigDecimal bigDecimal = new BigDecimal(cell.getStringCellValue());
  668. companyMsg.setfBoxWeight(bigDecimal);
  669. break;
  670. case "地点类型 如: 堆场,码头":
  671. //设置单元格类型
  672. cell.setCellType(CellType.STRING);
  673. if (StringUtils.isEmpty(cell.getStringCellValue())) {
  674. return AjaxResult.error("Excel箱信息数据第" + line + "行数据缺少港口名称");
  675. }
  676. String fTypes = sysDictDataMapper.selectDictValue("f_types", cell.getStringCellValue());
  677. if (StringUtils.isEmpty(fTypes)){
  678. return AjaxResult.error("系统缺少地点类型"+cell.getStringCellValue()+"请维护");
  679. }
  680. companyMsg.setPort(fTypes);
  681. companyMsg.setPortName(cell.getStringCellValue());
  682. break;
  683. case "堆放地点":
  684. //设置单元格类型
  685. cell.setCellType(CellType.STRING);
  686. if (StringUtils.isEmpty(cell.getStringCellValue())) {
  687. return AjaxResult.error("Excel箱信息数据第" + line + "行数据缺少堆放地点");
  688. }
  689. companyMsg.setAddressName(cell.getStringCellValue());
  690. if (StringUtils.isEmpty(companyMsg.getPort())){
  691. return AjaxResult.error("缺少地点类型"+companyMsg.getPortName());
  692. }
  693. TAddress aLong = tAddressMapper.selectTAddressByfNameType(cell.getStringCellValue(), companyMsg.getPort());
  694. if (aLong == null){
  695. return AjaxResult.error("系统缺少类型为"+companyMsg.getPortName()+"的地点"+cell.getStringCellValue()+"请维护");
  696. }
  697. companyMsg.setfUpdateaddress(aLong.getfId().toString());
  698. break;
  699. case "提单号":
  700. //设置单元格类型
  701. cell.setCellType(CellType.STRING);
  702. /*if (StringUtils.isEmpty(cell.getStringCellValue())) {
  703. return AjaxResult.error("Excel箱信息数据第" + line + "行数据缺少提单号");
  704. }*/
  705. companyMsg.setfMblno(cell.getStringCellValue());
  706. break;
  707. case "铅封号":
  708. //设置单元格类型
  709. cell.setCellType(CellType.STRING);
  710. /*if (StringUtils.isEmpty(cell.getStringCellValue())) {
  711. return AjaxResult.error("Excel箱信息数据第" + line + "行数据缺少铅封号");
  712. }*/
  713. companyMsg.setfSealno(cell.getStringCellValue());
  714. break;
  715. case "是否箱损 如:好,坏":
  716. //设置单元格类型
  717. cell.setCellType(CellType.STRING);
  718. companyMsg.setCntrstatusName(cell.getStringCellValue());
  719. if (StringUtils.isEmpty(cell.getStringCellValue())) {
  720. return AjaxResult.error("Excel箱信息数据第" + line + "行数据缺少箱损状态");
  721. }
  722. String fCnTrsTaTus = sysDictDataMapper.selectDictValue("f_cntrstatus", cell.getStringCellValue());
  723. if (StringUtils.isEmpty(fCnTrsTaTus)){
  724. return AjaxResult.error("系统缺少箱状态"+cell.getStringCellValue()+"请维护");
  725. }
  726. companyMsg.setfCntrstatus(fCnTrsTaTus);
  727. break;
  728. case "箱损描述(备注)":
  729. //设置单元格类型
  730. cell.setCellType(CellType.STRING);
  731. companyMsg.setRemark(cell.getStringCellValue());
  732. break;
  733. }
  734. }
  735. tCntrno.add(companyMsg);
  736. }
  737. return AjaxResult.success("success", tCntrno);
  738. }
  739. @Override
  740. public List<BoxDistributionStatistics> boxDistributedStatistics() {
  741. List<BoxDistributionStatistics> list = new ArrayList<>();
  742. //先获取箱地址为港口信息
  743. List<TCntrno> boxPortMessage = tCntrnoMapper.getBoxPortMessage();
  744. //获取箱信息地址不为港口的信息
  745. List<TCntrno> addressMessageList = tCntrnoMapper.getBoxAddressMessage();
  746. //获取箱动态信息
  747. List<SysDictData> fOpcTnsTaTus = sysDictDataMapper.selectDictDataByType("f_opctnstatus");
  748. //获取箱空重状态
  749. List<SysDictData> fUpdateEF = sysDictDataMapper.selectDictDataByType("f_updateEF");
  750. //获取箱好坏状态
  751. List<SysDictData> fCnTrStatus = sysDictDataMapper.selectDictDataByType("f_cntrstatus");
  752. //在获取港口下的堆场对应的箱信息
  753. if (CollectionUtils.isNotEmpty(boxPortMessage) && CollectionUtils.isNotEmpty(fOpcTnsTaTus)){
  754. for (TCntrno cntrno : boxPortMessage) {
  755. BoxDistributionStatistics boxDistributionStatistics = new BoxDistributionStatistics();
  756. boxDistributionStatistics.setHaven(cntrno.getAddressName());
  757. List<BoxAddressMessage> boxAddressMessageList = new ArrayList<>();
  758. if (CollectionUtils.isNotEmpty(addressMessageList)){
  759. for (TCntrno trno : addressMessageList) {
  760. if (cntrno.getAddressName().equals(trno.getPortName()) && !trno.getAddressName().equals("在船")){
  761. List<BoxMessage> boxMessageList = new ArrayList<>();
  762. BoxAddressMessage boxAddressMessage = new BoxAddressMessage();
  763. boxAddressMessage.setAddress(trno.getAddressName());
  764. boxAddressMessage.setNumberSize(fOpcTnsTaTus.size()+fUpdateEF.size()+fCnTrStatus.size());
  765. List<BoxMessage> opcTnsTaTus = this.getOpcTnsTaTus(fOpcTnsTaTus, trno);//获取调箱状态的箱新
  766. List<BoxMessage> updateEF = this.getUpdateEF(fUpdateEF, trno);//获取空重的箱信息
  767. List<BoxMessage> cnTrStatus = this.getCnTrStatus(fCnTrStatus, trno);//获取好坏的箱信息
  768. if (CollectionUtils.isNotEmpty(opcTnsTaTus)){
  769. boxMessageList.addAll(opcTnsTaTus);
  770. }
  771. if (CollectionUtils.isNotEmpty(updateEF)){
  772. boxMessageList.addAll(updateEF);
  773. }if (CollectionUtils.isNotEmpty(cnTrStatus)){
  774. boxMessageList.addAll(cnTrStatus);
  775. }
  776. boxAddressMessage.setBoxMessages(boxMessageList);
  777. boxAddressMessageList.add(boxAddressMessage);
  778. }else if (cntrno.getAddressName().equals(trno.getPortName()) && trno.getAddressName().equals("在船")){
  779. //获取在船的备注
  780. List<TCntrno> boxRemark = tCntrnoMapper.getBoxRemark(trno.getfUpdateaddress());
  781. if (CollectionUtils.isNotEmpty(boxRemark)){
  782. for (TCntrno tCntrno : boxRemark) {
  783. List<BoxMessage> boxMessageList = new ArrayList<>();
  784. BoxAddressMessage boxAddressMessage = new BoxAddressMessage();
  785. boxAddressMessage.setAddress(trno.getAddressName()+tCntrno.getRemark());
  786. boxAddressMessage.setNumberSize(fOpcTnsTaTus.size()+fUpdateEF.size()+fCnTrStatus.size());
  787. List<BoxMessage> opcTnsTaTus = this.getOpcTnsTaTus(fOpcTnsTaTus, trno);//获取调箱状态的箱新
  788. List<BoxMessage> updateEF = this.getUpdateEF(fUpdateEF, trno);//获取空重的箱信息
  789. List<BoxMessage> cnTrStatus = this.getCnTrStatus(fCnTrStatus, trno);//获取好坏的箱信息
  790. if (CollectionUtils.isNotEmpty(opcTnsTaTus)){
  791. boxMessageList.addAll(opcTnsTaTus);
  792. }
  793. if (CollectionUtils.isNotEmpty(updateEF)){
  794. boxMessageList.addAll(updateEF);
  795. }if (CollectionUtils.isNotEmpty(cnTrStatus)){
  796. boxMessageList.addAll(cnTrStatus);
  797. }
  798. boxAddressMessage.setBoxMessages(boxMessageList);
  799. boxAddressMessageList.add(boxAddressMessage);
  800. }
  801. }
  802. }
  803. }
  804. }
  805. boxDistributionStatistics.setBoxAddressMessages(boxAddressMessageList);
  806. boxDistributionStatistics.setNumber(fOpcTnsTaTus.size()*boxAddressMessageList.size()+fUpdateEF.size()*boxAddressMessageList.size()+fCnTrStatus.size()*boxAddressMessageList.size());
  807. list.add(boxDistributionStatistics);
  808. }
  809. }
  810. return list;
  811. }
  812. @Override
  813. public List<Map<String, Object>> homeBox() {
  814. List<Map<String, Object>> list = tCntrnoMapper.homeBox();
  815. list.get(list.size() - 1).put("details", tCntrnoMapper.homeBoxCount());
  816. return list;
  817. }
  818. @Override
  819. @Transactional
  820. public int updateHire(TCntrno tCntrno) {
  821. return tCntrnoMapper.updateHire(tCntrno);
  822. }
  823. /**
  824. * set字段
  825. *
  826. * @param tCntrno
  827. * @return
  828. */
  829. public TCntrtracking setfield(TCntrno tCntrno) {
  830. TCntrtracking tCntrtracking = new TCntrtracking();
  831. BeanUtils.copyProperties(tCntrno, tCntrtracking);
  832. tCntrtracking.setfId(null);
  833. return tCntrtracking;
  834. }
  835. public List<String> GetMapKey(List<Map<String, Object>> listResult) {
  836. if ((listResult != null) && (!listResult.isEmpty())) {
  837. List listKey = new ArrayList();
  838. Map mapResult = (Map) listResult.get(0);
  839. Set mapKeySet = mapResult.keySet();
  840. String listHead = "";
  841. Iterator iteratorKey = mapKeySet.iterator();
  842. while (iteratorKey.hasNext()) {
  843. listHead = iteratorKey.next().toString();
  844. listKey.add(listHead);
  845. }
  846. return listKey;
  847. }
  848. return null;
  849. }
  850. private static <T> Predicate<T> distinctByKey(Function<? super T, Object> keyExtractor) {
  851. Map<Object, Boolean> seen = new ConcurrentHashMap<>();
  852. return t -> seen.putIfAbsent(keyExtractor.apply(t), Boolean.TRUE) == null;
  853. }
  854. /**
  855. * 获取调箱动态的箱信息
  856. * @param fOpcTnsTaTus
  857. * @param trno
  858. * @return
  859. */
  860. public List<BoxMessage> getOpcTnsTaTus(List<SysDictData> fOpcTnsTaTus,TCntrno trno){
  861. List<BoxMessage> boxMessageList = new ArrayList<>();
  862. if (CollectionUtils.isNotEmpty(fOpcTnsTaTus)){
  863. for (SysDictData opcTnsTaTus : fOpcTnsTaTus) {
  864. TCntrno tro = new TCntrno();
  865. BoxMessage boxMessage = new BoxMessage();
  866. tro.setfUpdateaddress(trno.getfUpdateaddress());
  867. tro.setfOpctnstatus(opcTnsTaTus.getDictValue());
  868. BoxMessage message = tCntrnoMapper.boxDistributionStatistics(tro);
  869. if (message != null){
  870. boxMessage = message;
  871. }
  872. boxMessage.setOpcTnStatus(opcTnsTaTus.getDictLabel());
  873. boxMessage.setUNIT(boxMessage.getTWENTYFR() +boxMessage.getTWENTYGP() + boxMessage.getTWENTYOT()
  874. +boxMessage.getTWENTYRF()+boxMessage.getTWENTYTK() +boxMessage.getFORTYFR()+boxMessage.getFORTYGP()
  875. +boxMessage.getFORTYHC()+boxMessage.getFORTYHR()+boxMessage.getFORTYOT()+boxMessage.getFORTYTK());
  876. boxMessage.setTEU(boxMessage.getTWENTYFR() +boxMessage.getTWENTYGP() + boxMessage.getTWENTYOT()
  877. +boxMessage.getTWENTYRF()+boxMessage.getTWENTYTK() +boxMessage.getFORTYFR()*2+boxMessage.getFORTYGP()*2
  878. +boxMessage.getFORTYHC()*2+boxMessage.getFORTYHR()*2+boxMessage.getFORTYOT()*2+boxMessage.getFORTYTK()*2);
  879. boxMessageList.add(boxMessage);
  880. }
  881. }
  882. return boxMessageList;
  883. }
  884. public List<BoxMessage> getUpdateEF(List<SysDictData> fUpdateEF,TCntrno trno){
  885. List<BoxMessage> boxMessageList = new ArrayList<>();
  886. if (CollectionUtils.isNotEmpty(fUpdateEF)){
  887. for (SysDictData sysDictData : fUpdateEF) {
  888. TCntrno tro = new TCntrno();
  889. BoxMessage boxMessage = new BoxMessage();
  890. tro.setfUpdateaddress(trno.getfUpdateaddress());
  891. tro.setfUpdateef(sysDictData.getDictValue());
  892. BoxMessage message = tCntrnoMapper.boxDistributionStatistics(tro);
  893. if (message != null){
  894. boxMessage = message;
  895. }
  896. boxMessage.setOpcTnStatus(sysDictData.getDictLabel());
  897. boxMessage.setUNIT(boxMessage.getTWENTYFR() +boxMessage.getTWENTYGP() + boxMessage.getTWENTYOT()
  898. +boxMessage.getTWENTYRF()+boxMessage.getTWENTYTK() +boxMessage.getFORTYFR()+boxMessage.getFORTYGP()
  899. +boxMessage.getFORTYHC()+boxMessage.getFORTYHR()+boxMessage.getFORTYOT()+boxMessage.getFORTYTK());
  900. boxMessage.setTEU(boxMessage.getTWENTYFR() +boxMessage.getTWENTYGP() + boxMessage.getTWENTYOT()
  901. +boxMessage.getTWENTYRF()+boxMessage.getTWENTYTK() +boxMessage.getFORTYFR()*2+boxMessage.getFORTYGP()*2
  902. +boxMessage.getFORTYHC()*2+boxMessage.getFORTYHR()*2+boxMessage.getFORTYOT()*2+boxMessage.getFORTYTK()*2);
  903. boxMessageList.add(boxMessage);
  904. }
  905. }
  906. return boxMessageList;
  907. }
  908. public List<BoxMessage> getCnTrStatus(List<SysDictData> fCnTrStatus,TCntrno trno){
  909. List<BoxMessage> boxMessageList = new ArrayList<>();
  910. if (CollectionUtils.isNotEmpty(fCnTrStatus)){
  911. for (SysDictData cnTrStatus : fCnTrStatus) {
  912. TCntrno tro = new TCntrno();
  913. BoxMessage boxMessage = new BoxMessage();
  914. tro.setfUpdateaddress(trno.getfUpdateaddress());
  915. tro.setfCntrstatus(cnTrStatus.getDictValue());
  916. BoxMessage message = tCntrnoMapper.boxDistributionStatistics(tro);
  917. if (message != null){
  918. boxMessage = message;
  919. }
  920. boxMessage.setOpcTnStatus(cnTrStatus.getDictLabel());
  921. boxMessage.setUNIT(boxMessage.getTWENTYFR() +boxMessage.getTWENTYGP() + boxMessage.getTWENTYOT()
  922. +boxMessage.getTWENTYRF()+boxMessage.getTWENTYTK() +boxMessage.getFORTYFR()+boxMessage.getFORTYGP()
  923. +boxMessage.getFORTYHC()+boxMessage.getFORTYHR()+boxMessage.getFORTYOT()+boxMessage.getFORTYTK());
  924. boxMessage.setTEU(boxMessage.getTWENTYFR() +boxMessage.getTWENTYGP() + boxMessage.getTWENTYOT()
  925. +boxMessage.getTWENTYRF()+boxMessage.getTWENTYTK() +boxMessage.getFORTYFR()*2+boxMessage.getFORTYGP()*2
  926. +boxMessage.getFORTYHC()*2+boxMessage.getFORTYHR()*2+boxMessage.getFORTYOT()*2+boxMessage.getFORTYTK()*2);
  927. boxMessageList.add(boxMessage);
  928. }
  929. }
  930. return boxMessageList;
  931. }
  932. }