Quellcode durchsuchen

数据投放-素材维度-总花费小数补全俩位

huangxuechao vor 4 Jahren
Ursprung
Commit
838647be2f

+ 10 - 0
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/report/service/impl/BytedanceReportMaterialDailyServiceImpl.java

@@ -16,6 +16,7 @@ import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.math.BigDecimal;
+import java.text.DecimalFormat;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.List;
@@ -60,6 +61,15 @@ public class BytedanceReportMaterialDailyServiceImpl extends ServiceImpl<Bytedan
             BigDecimal showMaterial = new BigDecimal(Check.isNull(dailyReportMap.get("showMaterial")) ? "0" : dailyReportMap.get("showMaterial").toString());
             BigDecimal convertMaterial = new BigDecimal(Check.isNull(dailyReportMap.get("convertMaterial")) ? "0" : dailyReportMap.get("convertMaterial").toString());
 
+
+            DecimalFormat decimalFormat = new DecimalFormat("0.00#");
+            String strCost = decimalFormat.format(cost);
+
+            dailyReportMap.put("cost", strCost);
+            dailyReportMap.put("click", click);
+            dailyReportMap.put("showMaterial", showMaterial);
+            dailyReportMap.put("convertMaterial", convertMaterial);
+
             //被除数不能为0
             if (StringUtils.equals("0",showMaterial.toString())){
                 dailyReportMap.put("costPerThousandShow", 0);

+ 1 - 6
jeecg-boot-module-system/src/main/java/org/jeecg/modules/bytedance/advertise/controller/BytedanceGeneralCopywriterController.java

@@ -35,6 +35,7 @@ import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.math.BigDecimal;
 import java.net.URLDecoder;
+import java.text.DecimalFormat;
 import java.util.*;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -55,12 +56,6 @@ public class BytedanceGeneralCopywriterController {
     @Autowired
     private ISysRoleService sysRoleService;
 
-    public static void main(String[] args) {
-        String str = "测试创意反射,这么玩,你的视觉效果就是这么神奇!{地点}";
-
-        System.out.println(StringUtils.lengthAsSlogan(str));
-
-    }
 
     @ApiOperation(value="通用文案库-上传excel", notes="通用文案库-上传excel")
     @PostMapping("/loadExcel")