Moqups is a nifty HTML5 App used to create wireframes, mockups or UI concepts, prototypes depending on how you like to call them.
You can use Moqups to build prototype quickly to confirm user requirement as bellowing:
%workspace%/.metadata/.plugins/org.eclipse.jdt.core/
select cast(repno as char(6)) from NSS313FA
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | /** * Convert to Chinese amount * * @param amount * the amount * @return the string */ public static String convertToChineseAmt(Long amount) { String num[] = { "零", "壹", "貳", "參", "肆", "伍", "陸", "柒", "捌", "玖" }; String xx[] = { "拾", "佰", "仟" }; String yy[] = { "萬", "億", "兆", "京" }; String chineseAmt = ""; int i; int temp; boolean first = true; boolean zero = false; for (i = 0; (int) (amount / (long) Math.pow(10, i)) != 0; i++) { ;// 計算位數i } if (i == 0) { return num[0]; } for (int k = (i - 1) / 4; k >= 0; k--) { temp = (int) ((amount / (long) Math.pow(10, 4 * k)) % (int) Math.pow(10, 4)); if (temp == 0) { zero = true; continue; } for (int x = 3; x >= 0; x--) { if (first) { x = (i - 1) % 4; first = false; } if (temp / (int) Math.pow(10, x) % 10 == 0) { zero = true; } else { if (zero) { chineseAmt += num[0]; zero = false; } chineseAmt += num[temp / (int) Math.pow(10, x) % 10]; if (x > 0) { chineseAmt += xx[x - 1]; } } } if (k > 0) { chineseAmt = chineseAmt + yy[k - 1]; } } return chineseAmt; } |
1 2 3 4 5 | public static void main(String args[]) { System.out.println(ReportUtils.convertToChineseAmt(2500L)); System.out.println(ReportUtils.convertToChineseAmt(50100L)); System.out.println(ReportUtils.convertToChineseAmt(325250L)); } |
1 2 3 | 貳仟伍佰 伍萬零壹佰 參拾貳萬伍仟貳佰伍拾 |
$scope.itemarray = ['A', 'B', 'C'];
$scope.itemarray.length = 0;
1: [Cta612pDto [acc=0100, amt=13033356, seqnm=(*)年度預算支出, ypay=null, formattedAmt=null], 2: Cta612pDto [acc=0101, amt=3809733, seqnm= 一般政務支出 , ypay=null, formattedAmt=null], 3: Cta612pDto [acc=0102, amt=3894280, seqnm= 國防支出 , ypay=null, formattedAmt=null], 4: Cta612pDto [acc=0103, amt=2532563, seqnm= 教育科學文化支出 , ypay=null, formattedAmt=null], 5: Cta612pDto [acc=0104, amt=1655232, seqnm= 經濟發展支出 , ypay=null, formattedAmt=null], 6: Cta612pDto [acc=0105, amt=460708, seqnm= 社會福利支出 , ypay=null, formattedAmt=null], 7: Cta612pDto [acc=0106, amt=59111, seqnm= 社區發展及環境保護支出 , ypay=null, formattedAmt=null], 8: Cta612pDto [acc=0107, amt=366285, seqnm= 退休撫卹支出 , ypay=null, formattedAmt=null], 9: Cta612pDto [acc=0109, amt=255444, seqnm= 一般補助及其他支出 , ypay=null, formattedAmt=null], 10: Cta612pDto [acc=0200, amt=130015, seqnm=(*)以前年度支出 , ypay=null, formattedAmt=null], 11: Cta612pDto [acc=0400, amt=14271298, seqnm=(*)特種基金及保管款支出 , ypay=null, formattedAmt=null], 12: Cta612pDto [acc=0500, amt=0, seqnm=(*)國庫券及短期借款還本支出, ypay=null, formattedAmt=null], 13: Cta612pDto [
acc=8888
, amt=1539861, seqnm=null, ypay=null, formattedAmt=null], 14: Cta612pDto [acc=9800, amt=757028109, seqnm=合計, ypay=null, formattedAmt=null], 15: Cta612pDto [acc=9900, amt=849981138506, seqnm=累計, ypay=null, formattedAmt=null], 16: Cta612pDto [acc=9991, amt=1539861, seqnm= 支付註銷, ypay=null, formattedAmt=null], 17: Cta612pDto [acc=9992, amt=728053579, seqnm= 支出收回, ypay=null, formattedAmt=null], 18: Cta612pDto [acc=9999, amt=728053579, seqnm=null, ypay=null, formattedAmt=null]]
1: BeanPropertyValueEqualsPredicate acc8888Predicate = new BeanPropertyValueEqualsPredicate(
2: "acc", "8888");
3: BeanPropertyValueEqualsPredicate acc9999Predicate = new BeanPropertyValueEqualsPredicate(
4: "acc", "9999");
5: Predicate predicate = PredicateUtils.nonePredicate(new Predicate[] { acc8888Predicate,
6: acc9999Predicate });
7: CollectionUtils.filter(dataList, predicate);
1: [Cta612pDto [acc=0100, amt=13033356, seqnm=(*)年度預算支出, ypay=null, formattedAmt=13,033,356.00],
2: Cta612pDto [acc=0101, amt=3809733, seqnm= 一般政務支出 , ypay=null, formattedAmt=3,809,733.00 ],
3: Cta612pDto [acc=0102, amt=3894280, seqnm= 國防支出 , ypay=null, formattedAmt=3,894,280.00 ],
4: Cta612pDto [acc=0103, amt=2532563, seqnm= 教育科學文化支出 , ypay=null, formattedAmt=2,532,563.00 ],
5: Cta612pDto [acc=0104, amt=1655232, seqnm= 經濟發展支出 , ypay=null, formattedAmt=1,655,232.00 ],
6: Cta612pDto [acc=0105, amt=460708, seqnm= 社會福利支出 , ypay=null, formattedAmt=460,708.00 ],
7: Cta612pDto [acc=0106, amt=59111, seqnm= 社區發展及環境保護支出 , ypay=null, formattedAmt=59,111.00 ],
8: Cta612pDto [acc=0107, amt=366285, seqnm= 退休撫卹支出 , ypay=null, formattedAmt=366,285.00 ],
9: Cta612pDto [acc=0109, amt=255444, seqnm= 一般補助及其他支出 , ypay=null, formattedAmt=255,444.00 ],
10: Cta612pDto [acc=0200, amt=130015, seqnm=(*)以前年度支出 , ypay=null, formattedAmt=130,015.00],
11: Cta612pDto [acc=0400, amt=14271298, seqnm=(*)特種基金及保管款支出 , ypay=null, formattedAmt=14,271,298.00],
12: Cta612pDto [acc=0500, amt=0, seqnm=(*)國庫券及短期借款還本支出, ypay=null, formattedAmt=0.00],
13: Cta612pDto [acc=9800, amt=757028109, seqnm=合計, ypay=null, formattedAmt=757,028,109.00],
14: Cta612pDto [acc=9900, amt=849981138506, seqnm=累計, ypay=null, formattedAmt=849,981,138,506.00],
15: Cta612pDto [acc=9991, amt=1539861, seqnm= 支付註銷, ypay=null, formattedAmt=1,539,861.00 ],
16: Cta612pDto [acc=9992, amt=728053579, seqnm= 支出收回, ypay=null, formattedAmt=728,053,579.00 ]]
1: DecimalFormat df = new DecimalFormat();
2: df.setMaximumFractionDigits(2);
3: df.setMinimumFractionDigits(2);
4: for (Cta612pDto vo : dataList) {
5: if (StringUtils.startsWith(vo.getSeqnm(), "(*)") || "9800".equals(vo.getAcc())
6: || "9900".equals(vo.getAcc())) {
7: vo.setFormattedAmt(df.format(vo.getAmt()));
8: } else {
9: vo.setFormattedAmt(df.format(vo.getAmt()) + " ");
10: }
11: formattedList.add(vo);
12: }
1: DecimalFormat df = new DecimalFormat();
2: df.setMaximumFractionDigits(2);
3: df.setMinimumFractionDigits(2);
4: for (Cta612pDto vo : dataList) {
5: if (StringUtils.startsWith(vo.getSeqnm(), "(*)") || "9800".equals(vo.getAcc())
6: || "9900".equals(vo.getAcc())) {
7: vo.setFormattedAmt(df.format(vo.getAmt()));
8: } else {
9: vo.setFormattedAmt(df.format(vo.getAmt()) + " ");
10: }
11: formattedList.add(vo);
12: }
1: //query
2: $scope.query = function(){
3: var result = nss702rService.query('rest/', $scope.model);
4: result.then(function(response){
5: $scope.dpNos = response;
6: //if have more than one record in dpNos,
7: //then set the first option as its default value
8: if($scope.dpNos.length > 0){
9: $scope.model.dpNo = $scope.dpNos[0].uid;
10: }
11: });
12: };
1: select UID, NAME
2: from UAA001V1
3: where ORGCD = 'cht12345' and UID <> '957500';
1: /**
2: *
3: */
4: package gov.nta.nss.dto;
5: import java.io.Serializable;
6: // TODO: Auto-generated Javadoc
7: /**
8: * The Class UAA001V1Bean.
9: */
10: public class UAA001V1Bean implements Serializable {
11: private static final long serialVersionUID = -7541446851729769394L;
12: // 機關代號
13: private String uid;
14: // 機關名稱
15: private String name;
16: /**
17: * Gets the uid.
18: *
19: * @return the uid
20: */
21: public String getUid() {
22: return uid;
23: }
24: /**
25: * Sets the uid.
26: *
27: * @param uid
28: * the uid to set
29: */
30: public void setUid(String uid) {
31: this.uid = uid;
32: }
33: /**
34: * Gets the name.
35: *
36: * @return the name
37: */
38: public String getName() {
39: return name;
40: }
41: /**
42: * Sets the name.
43: *
44: * @param name
45: * the name to set
46: */
47: public void setName(String name) {
48: this.name = name;
49: }
50: /**
51: * {@inheritDoc}
52: */
53: @Override
54: public String toString() {
55: return "UAA001V1Bean [uid=" + uid + ", name=" + name + "]";
56: }
57: }
1: /**
2: *
3: */
4: package gov.nta.nss.web.rest;
5: import gov.nta.nss.Messages;
6: import gov.nta.nss.dto.UAA001V1Bean;
7: import gov.nta.nss.service.Nss702rService;
8: import gov.nta.nss.web.dto.Nss702r;
9: import java.util.List;
10: import org.apache.commons.collections.CollectionUtils;
11: import org.slf4j.Logger;
12: import org.slf4j.LoggerFactory;
13: import org.springframework.beans.factory.annotation.Autowired;
14: import org.springframework.http.MediaType;
15: import org.springframework.stereotype.Controller;
16: import org.springframework.web.bind.annotation.RequestBody;
17: import org.springframework.web.bind.annotation.RequestMapping;
18: import org.springframework.web.bind.annotation.RequestMethod;
19: import org.springframework.web.bind.annotation.ResponseBody;
20: import com.cht.commons.web.Alerter;
21: /**
22: *
23: */
24: @Controller
25: @RequestMapping("NSS702R/rest/")
26: public class Nss702rResouce {
27: private final static Logger LOG = LoggerFactory.getLogger(Nss702rResouce.class);
28: @Autowired
29: private Nss702rService nss702rService;
30: /**
31: * Gets the uaa001v1 beans.
32: *
33: * @return the uaa001v1 beans
34: */
35: @RequestMapping(method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
36: public @ResponseBody
37: List<UAA001V1Bean> getUaa001v1Beans(@RequestBody Nss702r nss702r, Alerter alerter) {
38: // find all 區局代號 list
39: List<UAA001V1Bean> uaa001v1Beans = nss702rService.getUaa001v1Beans();
40: LOG.info("uaa001v1Beans=" + uaa001v1Beans.toString());
41: // if List of UAA001V1Bean is empty, return "找不到區局代號"
42: if (CollectionUtils.isEmpty(uaa001v1Beans)) {
43: alerter.info(Messages.nss702r_dpno_not_exist());
44: }
45: return uaa001v1Beans;
46: }
47: }
1: //......................
2: //query
3: $scope.query = function(){
4: var result = nss702rService.query('rest/', $scope.model);
5: result.then(function(response){
6: $scope.dpNos = response;
7: });
8: };
9: $scope.refresh = function(){
10: $scope.query();
11: };
12: $scope.refresh();
13: //......................
1: <div class="form-group col-sm-5">
2: <label class="control-label">區局代號 :</label>
3: <select class="form-control" style="width: 80%;"
4: id="dpNo" name="dpNo" data-ng-model="model.dpNo"
5: data-ng-options="dpNo.uid as dpNo.name for dpNo in dpNos">
6: </select>
7: </div>