fix rservice apply

master
luoyang 5 years ago
parent 31dcb12e8c
commit e9af1d97ab

@ -9,7 +9,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId>
<version>1.3.6</version>
<version>1.3.7</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>1.4.0</jib-maven-plugin.version>

@ -5,7 +5,6 @@ import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
import com.alibaba.fastjson.JSONObject;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator;
import java.util.List;
@ -34,13 +33,9 @@ public interface ClientIncrementalMapper {
@AutoSql(type = SqlType.UPDATE)
void update(JSONObject saveIncrementalService);
@Select("SELECT incremental_rate_value FROM sys_client_incremental WHERE channel = #{channel} AND client_id = #{client_id} ")
@AutoSql(type = SqlType.SELECT)
String findByChannelAndClientId(@Param("client_id") int clientId,@Param("channel") String channel);
@AutoSql(type = SqlType.SELECT)
List<JSONObject> find(@Param("client_id") int clientId);
@AutoSql(type = SqlType.SELECT)
JSONObject findBySourceCodeAndClientId(@Param("client_id") int clientId, @Param("source_code") String sourceCode);
}

@ -86,13 +86,13 @@ public class RServicesApplyServiceImpl implements RServicesApplyService {
applyInfo.put("operator_time", new Date());
applyInfo.put("status", 1);
clientServicesApplyMapper.update(applyInfo);
JSONObject clientServices = clientIncrementalMapper.findBySourceCodeAndClientId(applyInfo.getIntValue("client_id"), applyInfo.getString("service_code"));
JSONObject increment = commonIncrementalChannelMapper.findIncreamentalChannelBySourceCode(applyInfo.getString("service_code"));
JSONObject clientServices = clientIncrementalMapper.findByClinetIdAndChannel(applyInfo.getIntValue("client_id"), increment.getString("channel"));
if (clientServices == null) {
clientServices = new JSONObject();
clientServices.put("incremental_id", UUID.randomUUID().toString());
clientServices.put("client_id", applyInfo.getIntValue("client_id"));
clientServices.put("channel", increment.getIntValue("channel"));
clientServices.put("channel", increment.getString("channel"));
clientServices.put("incremental_mode", 2);
clientServices.put("incremental_rate_value", 0);
clientServices.put("total_incremental_amount", applyInfo.getBigDecimal("amount"));

Loading…
Cancel
Save