|
@@ -1020,26 +1020,27 @@ public class SettementUtil {
|
|
|
* @return reason
|
|
|
*/
|
|
|
public static String getDJoint(Settlement settlement,String[] tips){
|
|
|
- String reason="";
|
|
|
- String[] amout=settlement.getTheAmount().split(",");
|
|
|
+ String reason=""; //原因
|
|
|
+ String[] amout=settlement.getTheAmount().split(","); //分部分项比对金额的字符串截取成数组
|
|
|
String reason1=tips[0].replace("xxx",String.valueOf(nf.format(settlement.getMoney())))
|
|
|
+tips[1].replace("xxx",amout[2])
|
|
|
+tips[2].replace("xxx",amout[3])
|
|
|
- +tips[3].replace("xxx",amout[0]);
|
|
|
+ +tips[3].replace("xxx",amout[0]);//提示字符串返回给前端
|
|
|
String reason2=tips[0].replace("xxx",String.valueOf(nf.format(settlement.getMoney())))
|
|
|
+tips[4].replace("xxx",amout[4])
|
|
|
+tips[5].replace("xxx",amout[5])
|
|
|
- +tips[6].replace("xxx",amout[1]);
|
|
|
- String status =settlement.getStatus();
|
|
|
- if(status.equals("0")){
|
|
|
- reason=reason1+SettementUtil.RESON_TRUE+","+","+","+reason2+SettementUtil.RESON_TRUE;
|
|
|
+ +tips[6].replace("xxx",amout[1]);//提示字符串返回给前端
|
|
|
+ String status =settlement.getStatus();//获取状态
|
|
|
+ if(status.equals("0")){ //如果为 0 为一致
|
|
|
+ reason=reason1+SettementUtil.RESON_TRUE+","+","+","+reason2+SettementUtil.RESON_TRUE;//拼接上“金额一致”
|
|
|
}
|
|
|
- if(status.equals("1")){
|
|
|
+ if(status.equals("1")){//如果为1,判断哪里不一致
|
|
|
double money = settlement.getMoney();
|
|
|
double amout1 = Double.valueOf(amout[0]);
|
|
|
double amout2 = Double.valueOf(amout[1]);
|
|
|
double moneyComparison1=money+5.0;//范围金额+5.0元
|
|
|
double moneyComparison2=money-5.0;//范围金额-5.0元
|
|
|
+ //判断 不一致 地方 拼接不同常量
|
|
|
if (amout1>=moneyComparison1||amout1<=moneyComparison2){
|
|
|
if (amout2>=moneyComparison1||amout2<=moneyComparison2){
|
|
|
reason=reason1+SettementUtil.RESON_FLASE+","+","+","+reason2+SettementUtil.RESON_FLASE;
|
|
@@ -1066,14 +1067,14 @@ public class SettementUtil {
|
|
|
* @return Settlement reason 属性 赋值
|
|
|
*/
|
|
|
public static String getJoint(String constant1,String constant2,Settlement settlement){
|
|
|
- String reason="";
|
|
|
- String status=settlement.getStatus();
|
|
|
+ String reason="";//提示字符串
|
|
|
+ String status=settlement.getStatus();//获取状态
|
|
|
reason=constant1.replace("xxx",String.valueOf(nf.format(settlement.getMoney())))
|
|
|
- +constant2.replace("xxx",settlement.getTheAmount());
|
|
|
- if (status.equals("0")){
|
|
|
- reason+=SettementUtil.RESON_TRUE;
|
|
|
+ +constant2.replace("xxx",settlement.getTheAmount());//常量拼接
|
|
|
+ if (status.equals("0")){ //如果为0
|
|
|
+ reason+=SettementUtil.RESON_TRUE; //拼接上“金额一致”
|
|
|
}else {
|
|
|
- reason+=SettementUtil.RESON_FLASE;
|
|
|
+ reason+=SettementUtil.RESON_FLASE; //拼接上“金额不一致”
|
|
|
}
|
|
|
return reason;
|
|
|
}
|
|
@@ -1085,14 +1086,14 @@ public class SettementUtil {
|
|
|
* @return reason
|
|
|
*/
|
|
|
public static String getCsfJoint(String csxm,Settlement settlement){
|
|
|
- String status =settlement.getStatus();
|
|
|
- String[] amout=settlement.getTheAmount().split(",");
|
|
|
+ String status =settlement.getStatus();//获取状态
|
|
|
+ String[] amout=settlement.getTheAmount().split(",");//获取存入的金额比对字符串,截取为数组
|
|
|
String reason=csxm.replace("xxx",String.valueOf(nf.format(settlement.getMoney())))
|
|
|
+RESON_CSXM1.replace("xxx",amout[0])+
|
|
|
RESON_CSXM2.replace("xxx",amout[1])+
|
|
|
- RESON_CSXM3.replace("xxx",amout[2]);
|
|
|
- if (status.equals("0")){
|
|
|
- reason+=RESON_TRUE;
|
|
|
+ RESON_CSXM3.replace("xxx",amout[2]);//常量拼接是金额
|
|
|
+ if (status.equals("0")){//如果为0
|
|
|
+ reason+=RESON_TRUE;//拼接上“金额一致”
|
|
|
}else {
|
|
|
reason+=RESON_FLASE;
|
|
|
}
|
|
@@ -1105,17 +1106,17 @@ public class SettementUtil {
|
|
|
* @return reason
|
|
|
*/
|
|
|
public static String getDlJoint(String s,String s1,String s2,Settlement settlement){
|
|
|
- String reason="";
|
|
|
- String[] amout = settlement.getTheAmount().split(",");
|
|
|
- String status=settlement.getStatus();
|
|
|
+ String reason="";//提示字符串
|
|
|
+ String[] amout = settlement.getTheAmount().split(",");//获取存入的金额字符串,截取为数组
|
|
|
+ String status=settlement.getStatus();//获取状态
|
|
|
reason=s.replace("xxx",String.valueOf(nf.format(settlement.getMoney())))
|
|
|
+s1.replace("xxx",amout[1])
|
|
|
+s2.replace("xxx",amout[2])
|
|
|
- +RESON_JGJS8.replace("xxx",amout[0]);
|
|
|
- if (status.equals("0")){
|
|
|
- reason+=SettementUtil.RESON_TRUE;
|
|
|
+ +RESON_JGJS8.replace("xxx",amout[0]);//拼接
|
|
|
+ if (status.equals("0")){//判断是否一致
|
|
|
+ reason+=SettementUtil.RESON_TRUE; //拼接 “金额一致” 字符串
|
|
|
}else {
|
|
|
- reason+=SettementUtil.RESON_FLASE;
|
|
|
+ reason+=SettementUtil.RESON_FLASE;//拼接 “金额不一致” 字符串
|
|
|
}
|
|
|
return reason;
|
|
|
}
|
|
@@ -1127,25 +1128,27 @@ public class SettementUtil {
|
|
|
* @return string reason值
|
|
|
*/
|
|
|
public static String getJgJoint(String tops,Settlement settlement,List<Settlement> settlements){
|
|
|
- String reason="";
|
|
|
- reason+=tops.replace("xxx",String.valueOf(nf.format(settlement.getMoney())));
|
|
|
+ String reason="";//提示字符串
|
|
|
+ reason+=tops.replace("xxx",String.valueOf(nf.format(settlement.getMoney())));//获取存入的金额,截取为数组
|
|
|
String amout=settlement.getTheAmount();
|
|
|
String name = "";
|
|
|
for (int i = 0; i < settlements.size(); i++) {//循环遍历list集合中的settlement对象
|
|
|
name = settlements.get(i).getEntryName();
|
|
|
- if (name.equals(BashInfo.JS_JGJS)||
|
|
|
+ if (name.equals(BashInfo.JS_JGJS)||//循环到竣工结算/投标报价 跳出循环
|
|
|
name.equals(BDZ_TBNAME)){
|
|
|
- reason+=RESON_JGJS8.replace("xxx",amout);
|
|
|
- if (settlement.getStatus().equals("0")){
|
|
|
- reason+=SettementUtil.RESON_TRUE;
|
|
|
+ reason+=RESON_JGJS8.replace("xxx",amout);//字符串拼接
|
|
|
+ if (settlement.getStatus().equals("0")){//判断是否一致
|
|
|
+ reason+=SettementUtil.RESON_TRUE;//如果一致 拼接“金额一致字符串”
|
|
|
}else {
|
|
|
- reason+=SettementUtil.RESON_FLASE;
|
|
|
+ reason+=SettementUtil.RESON_FLASE;//如果不一致 拼接“金额一致字符串”
|
|
|
}
|
|
|
return reason;
|
|
|
}
|
|
|
+ //字符串替换 xxx 为指定金额
|
|
|
reason += ","+settlements.get(i).getEntryName()+",<span style='font-weight: bold;'>"+nf.format(settlements.get(i).getMoney())+"</span>,";
|
|
|
}
|
|
|
- reason+=RESON_JGJS8.replace("xxx",amout);
|
|
|
+ //如果循环中为跳出,执行如下
|
|
|
+ reason+=RESON_JGJS8.replace("xxx",amout);//拼接小计金额
|
|
|
if (settlement.getStatus().equals("0")){
|
|
|
reason+=SettementUtil.RESON_TRUE;
|
|
|
}else {
|
|
@@ -1161,15 +1164,16 @@ public class SettementUtil {
|
|
|
* @return String reason 提示字符串
|
|
|
*/
|
|
|
public static String getJshzJoint(String tops,Settlement settlement,List<Settlement> settlements){
|
|
|
- String reason="";
|
|
|
- String name="";
|
|
|
- reason = tops.replace("xxx",String.valueOf(nf.format(settlement.getMoney())));
|
|
|
+ String reason="";//提示字符串
|
|
|
+ String name="";//名称
|
|
|
+ reason = tops.replace("xxx",String.valueOf(nf.format(settlement.getMoney())));//给提示字符串赋予初始提示
|
|
|
String amout=settlement.getTheAmount();
|
|
|
for (int i = 0; i < settlements.size(); i++) {//循环遍历list集合中的settlement对象
|
|
|
name = settlements.get(i).getEntryName();
|
|
|
- if (name.equals(BashInfo.JS_JGJS)|| name.equals(BDZ_TBNAME)){
|
|
|
+ if (name.equals(BashInfo.JS_JGJS)|| name.equals(BDZ_TBNAME)){//如果 循环到 竣工结算 跳过此次循环
|
|
|
continue;
|
|
|
}
|
|
|
+ //如果循环到 工程结算/.../...等 直接返回
|
|
|
if (name.equals(BashInfo.JS_GCJS)|| name.equals(RESON_ZZJS)|| name.equals(RESON_ZZFC)|| name.equals(RESON_ZGTB)||
|
|
|
name.equals(RESON_XFHZJ)){
|
|
|
reason+=RESON_JGJS8.replace("xxx",amout);
|
|
@@ -1180,8 +1184,10 @@ public class SettementUtil {
|
|
|
}
|
|
|
return reason;
|
|
|
}
|
|
|
+ //提示字符串 替换xxx 的值为 指定金额
|
|
|
reason += ","+settlements.get(i).getEntryName()+",<span style='font-weight: bold;'>"+nf.format(settlements.get(i).getMoney())+"</span>,";
|
|
|
}
|
|
|
+ //如果循环中为跳出,则无工程结算/.../...等 执行如下
|
|
|
reason+=RESON_JGJS8.replace("xxx",amout);
|
|
|
if (settlement.getStatus().equals("0")){
|
|
|
reason+=SettementUtil.RESON_TRUE;
|