|
@@ -13,6 +13,7 @@ import cn.start.tz.module.pressure2.dal.mysql.pipeacceptorderitem.PipeAcceptOrde
|
|
|
import cn.start.tz.module.pressure2.dal.mysql.pipetaskorderitem.PipeTaskOrderItemMapper;
|
|
import cn.start.tz.module.pressure2.dal.mysql.pipetaskorderitem.PipeTaskOrderItemMapper;
|
|
|
import cn.start.tz.module.pressure2.service.boilertaskordersignfile.BoilerTaskOrderSignFileService;
|
|
import cn.start.tz.module.pressure2.service.boilertaskordersignfile.BoilerTaskOrderSignFileService;
|
|
|
import cn.start.tz.module.pressure2.service.dynamicOFData.IDynamicOFData;
|
|
import cn.start.tz.module.pressure2.service.dynamicOFData.IDynamicOFData;
|
|
|
|
|
+import cn.start.tz.module.pressure2.service.dynamicOFData.util.AmountConvertUtil;
|
|
|
import cn.start.tz.module.pressure2.service.orderreport.OrderReportService;
|
|
import cn.start.tz.module.pressure2.service.orderreport.OrderReportService;
|
|
|
import cn.start.tz.module.pressure2.service.pipetaskorder.PipeTaskOrderService;
|
|
import cn.start.tz.module.pressure2.service.pipetaskorder.PipeTaskOrderService;
|
|
|
import cn.start.tz.module.pressure2.service.pipetaskorderitemreportuser.PipeTaskOrderItemReportUserService;
|
|
import cn.start.tz.module.pressure2.service.pipetaskorderitemreportuser.PipeTaskOrderItemReportUserService;
|
|
@@ -164,50 +165,15 @@ public class QR0413_0415ReportOFData implements IDynamicOFData {
|
|
|
result.put("recipientPhone", taskOrderDO.getRecipientPhone());
|
|
result.put("recipientPhone", taskOrderDO.getRecipientPhone());
|
|
|
result.put("recipientEmail", taskOrderDO.getRecipientEmail());
|
|
result.put("recipientEmail", taskOrderDO.getRecipientEmail());
|
|
|
|
|
|
|
|
- result.put("totalAmount", taskOrderDO.getShouldAmount().setScale(2, java.math.RoundingMode.HALF_UP));
|
|
|
|
|
- // 将金额转换为中文数字并按位存储
|
|
|
|
|
if (taskOrderDO.getShouldAmount() != null) {
|
|
if (taskOrderDO.getShouldAmount() != null) {
|
|
|
- convertAmountToChineseDigits(taskOrderDO.getShouldAmount(), result);
|
|
|
|
|
|
|
+ result.put("totalAmount", taskOrderDO.getShouldAmount().setScale(2, java.math.RoundingMode.HALF_UP));
|
|
|
|
|
+ // 将金额转换为中文大写金额
|
|
|
|
|
+ result.put("money1", AmountConvertUtil.convertAmountToChineseDigits(taskOrderDO.getShouldAmount()));
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 将金额转换为中文数字并按位存储到result中
|
|
|
|
|
- * money1: 百万位, money2: 十万位, money3: 万位, money4: 千位, money5: 百位, money6: 十位, money7: 个位
|
|
|
|
|
- * @param amount 金额
|
|
|
|
|
- * @param result 结果对象
|
|
|
|
|
- */
|
|
|
|
|
- private void convertAmountToChineseDigits(BigDecimal amount, JSONObject result) {
|
|
|
|
|
- // 中文数字数组
|
|
|
|
|
- String[] chineseDigits = {"零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"};
|
|
|
|
|
-
|
|
|
|
|
- // 获取整数部分
|
|
|
|
|
- long integerPart = amount.longValue();
|
|
|
|
|
-
|
|
|
|
|
- // 确保不超过百万(9999999)
|
|
|
|
|
- if (integerPart > 9999999) {
|
|
|
|
|
- integerPart = 9999999;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 提取每一位数字
|
|
|
|
|
- int million = (int)(integerPart / 1000000) % 10; // 百万位
|
|
|
|
|
- int hundredThousand = (int)(integerPart / 100000) % 10; // 十万位
|
|
|
|
|
- int tenThousand = (int)(integerPart / 10000) % 10; // 万位
|
|
|
|
|
- int thousand = (int)(integerPart / 1000) % 10; // 千位
|
|
|
|
|
- int hundred = (int)(integerPart / 100) % 10; // 百位
|
|
|
|
|
- int ten = (int)(integerPart / 10) % 10; // 十位
|
|
|
|
|
- int one = (int)(integerPart % 10); // 个位
|
|
|
|
|
-
|
|
|
|
|
- // 存入result
|
|
|
|
|
- result.put("money1", chineseDigits[million]); // 百万位
|
|
|
|
|
- result.put("money2", chineseDigits[hundredThousand]); // 十万位
|
|
|
|
|
- result.put("money3", chineseDigits[tenThousand]); // 万位
|
|
|
|
|
- result.put("money4", chineseDigits[thousand]); // 千位
|
|
|
|
|
- result.put("money5", chineseDigits[hundred]); // 百位
|
|
|
|
|
- result.put("money6", chineseDigits[ten]); // 十位
|
|
|
|
|
- result.put("money7", chineseDigits[one]); // 个位
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|