update 上传FTP

This commit is contained in:
Guoqs
2024-06-03 09:31:46 +08:00
parent b60fb90d8f
commit e6dc4d45d3
4 changed files with 27 additions and 2 deletions

View File

@@ -245,4 +245,8 @@ public class PersonPileController extends BaseController {
logger.info("获取个人桩充电记录 result:{}", response);
return response;
}
/**
* 个人桩启动充电
*/
}

View File

@@ -7,6 +7,7 @@ import com.jsowell.common.util.StringUtils;
import com.jsowell.common.util.file.AliyunOssUploadUtils;
import com.jsowell.common.util.file.FileUploadUtils;
import com.jsowell.common.util.file.FileUtils;
import com.jsowell.common.util.file.FtpUtils;
import com.jsowell.framework.config.ServerConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -99,6 +100,11 @@ public class CommonController {
String filePath = JsowellConfig.getUploadPath();
// 上传并返回新文件名称
String fileName = FileUploadUtils.upload(filePath, file);
try {
FtpUtils.upLoad(filePath, file);
} catch (Exception e) {
log.error("FTP上传固件error", e);
}
String url = serverConfig.getUrl() + fileName;
AjaxResult ajax = AjaxResult.success();
ajax.put("url", url);

View File

@@ -8,9 +8,11 @@ import com.jsowell.common.core.page.PageResponse;
import com.jsowell.common.util.BytesUtil;
import com.jsowell.common.util.StringUtils;
import com.jsowell.common.util.YKCUtils;
import com.jsowell.pile.domain.OrderBasicInfo;
import com.jsowell.pile.domain.PileMsgRecord;
import com.jsowell.pile.dto.QueryPileDTO;
import com.jsowell.pile.mapper.PileMsgRecordMapper;
import com.jsowell.pile.service.OrderBasicInfoService;
import com.jsowell.pile.service.PileMsgRecordService;
import com.jsowell.pile.vo.web.PileCommunicationLogVO;
import org.springframework.beans.factory.annotation.Autowired;
@@ -25,6 +27,9 @@ public class PileMsgRecordServiceImpl implements PileMsgRecordService {
@Autowired
private PileMsgRecordMapper pileMsgRecordMapper;
@Autowired
private OrderBasicInfoService orderBasicInfoService;
@Override
public void save(String pileSn, String connectorCode, String frameType, String jsonMsg, String originalMsg) {
PileMsgRecord pileMsgRecord = PileMsgRecord.builder()
@@ -191,16 +196,27 @@ public class PileMsgRecordServiceImpl implements PileMsgRecordService {
*/
private String transactionRecordMsg(String jsonMsg) {
JSONObject jsonObject = JSONObject.parseObject(jsonMsg);
// 订单号
String orderCode = jsonObject.getString("orderCode");
// 交易流水号
String transactionCode = jsonObject.getString("transactionCode");
OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByTransactionCode(transactionCode);
// 充电度数
String totalElectricity = jsonObject.getString("totalElectricity");
// 消费金额
String consumptionAmount = jsonObject.getString("consumptionAmount");
// 开始时间
String startTime = jsonObject.getString("startTime");
// 结束时间
String endTime = jsonObject.getString("endTime");
// 枪口编号
String pileConnectorCode = jsonObject.getString("pileSn") + jsonObject.getString("connectorCode");

View File

@@ -2534,7 +2534,6 @@
limit 1
</select>
<select id="getAccumulativeInfo" resultType="com.jsowell.pile.vo.uniapp.PersonPileConnectorSumInfoVO">
SELECT t1.member_id as memberId,
t1.pile_connector_code as pileConnectorCode,
@@ -2543,7 +2542,7 @@
t1.charge_end_time as chargeEndTime,
t2.total_used_electricity as sumChargingDegree
FROM order_basic_info t1
JOIN order_detail t2 ON t1.order_code = t2.order_code
JOIN order_detail t2 ON t1.order_code = t2.order_code
WHERE t1.pile_connector_code = #{pileConnectorCode,jdbcType=VARCHAR}
AND t1.member_id = #{memberId,jdbcType=VARCHAR}
AND t1.create_time <![CDATA[ >= ]]> #{startTime,jdbcType=VARCHAR}