9 Commits

108 changed files with 3767 additions and 5930 deletions

3
.gitignore vendored
View File

@@ -1,4 +1,5 @@
/target/
**/target/
/config/
!.mvn/wrapper/maven-wrapper.jar
### STS ###

View File

@@ -1 +0,0 @@
eyJlbmMiOiJBMjU2R0NNIiwiYWxnIjoiUlNBLU9BRVAtMjU2In0.rf8bViJPb5bRJHFamVoCftE0TLA1Gz7JyGnfcjtKEx3KiUL4SSbgYSUQlsKhCt8VJMWE--UpgbkM0Bv3pFVsMF_uh693MhFstEy_A6S3MODjoUV_bMLa_Zr1yH2Jwzud4LSyw-ctJ7G-vO8S_I6YML0HV5kNbobdFmMfXFLGKssVmM_Km0m57ZgSjj3zRii0cKpmdwwSbWoJC2y519TpKhIja0OZAoN1oB3IVKvERlFYCQYUpQmcRkzULGrlSoLIm9iqbRX4qMGhGISwVS6JdVtn9WjpSjF3xkUxN_QsVuYKYFL_kEKWSNepIcfoip7Ag9Qw_S1RZA_KO908MgrzGRbs2UIpxY9sAM8yZ-k1NTk0swV836s5pdDIP3PHovcd6iR8mqWBPt7mq7ES98vNeCZxqPLB_b1JuNfKsbLPdRIvEk2DTjZHeEi-yA1yl5uMi_1f4la6mgy65u_jLL_Ow28uZtj-8yQ3dR4lF3K7tkxQaB4LQiH5nl6lXEndpoPe.Cpu6VoHf2ptCue_L.uH-Pq1WZN-x_c71Iyx8X1QJa1JZRp9sYta9iUOmQ4W8x4Qh2wYm-_tpr8FEw56MLvIb8IH_gHVVLAJgXTmCZhyo26vJlPCtnMMPYFDrPRzTJv9Ewg7RMpsAh_kXFFK4UJ6Tgt_r7Tg_bnVOTKXodUjl3wVdMowZRX_ua-gKwLU-2LDWdqIRmuFDSOkMb1sFBZLPyjWHg_rThs-RwVa4YJdDi74s-L0WX0xRPXzeovu1-xvOgZ0xYf0ScbsFQgvK-JwAxOWsB1WKeHRqnnx5-apK6qtzhpiJ30c7ukPlrg2nieuJvkXOVuKBKXLVRLSViOH4HU76DD96btDUA0Cg2kEURpepucX0VWPyB7K3xb9v1AT42TUkW9wZzdmIs9saRo-ItuWzlCezvapLIsbqmYCs_rW2J3KgqXrUyy2mptn32sqaqQZnlNVu4wwboPCCrbl2MG5CYlYKrwaOHNg611j8sCDkIptm_UmPFnOnzvQYwURuDSgzswTIV5bTd_58yxag2yWwiMdGLMDbxxSUPQ6a4EbuDkqwmGBTSLiG7SaSFchSg6o9EflqK6k-u_rlixCxmfg1A6sa7nloW17dOxDzGKtmn9lBoaskL97nNrhP6ptftak7j4TIZulz1FUOSVoR8kXK8RNQMj-b6rg_MdSO9Ecq5hZsza1SzjkzKZvV-tpP6Wl6-rszCH6g3DIQAWN5aWdUkwuya1HqDDyVPbUOVQPsp4nhVC24QmnlbcqFwQdoCrikYKyX3Snc0H6_K4z9c6nURAdj6THwHmA9BfHtJniI_rEIvkmBk3yndi-H5eAjtxIoYSFQrSTWEFhgvk6bAKoR_xb_cHgzKOxYLBiO_FifkjkFDOlkVBuYnZEp3oRePDKgMDfL5Oxjuie4u-8yrH52Cd32yQzbvGplaXLLeEDf3i71dcz4LkO5DknScWG3G_SbKBpjlse-GKe3XYqRXeRIYLpyiX1MXph0b-Q.dvHU75ZR8wJFxoSacfkthw

View File

@@ -1,40 +0,0 @@
-----BEGIN PRIVATE KEY-----
MIIG/QIBADANBgkqhkiG9w0BAQEFAASCBucwggbjAgEAAoIBgQCWgm0Yw4txM1Z7
UiB2tPy5i5wjVWzTZaPJQ9ns+jnWILrtCYZ0bQifOUElh2Ri1PPx51r6oCtkw0YH
QKEWz/vEo8oBKQy9Vyubghhu2HQMQiRdYAvthexZ3yp1L4qyfG4LpOq+4D1er89f
hGa0CrhuXT/VPYdmMmznf9vveXk16Fyx5lTXb3D7mUGoPBbnGH7VWdc1tz3rNrsE
V9BKd+D1bBpZKmjxjntcBOdXuzjrJPyA0ozb0g0clezhoitD21wudNsPP2eEZx42
B5zcCE7NzhPII+6BSIb1YPh6GxCv7sKnfRGpPmX1k++gFOkB0ctnWv+MH6pjr5aR
joSw4lbbGD1tRigdeMyIV2Lw4tcLg1MA9Sq4U5ogx+PEZphBzw2gMwWKrep1NaLa
d0I6jFfIXFhE/mliz+gDjpQAdmwIdqymO+X2N9H9psIAsG2wUvCksD2qoHCzmiNc
Uf/9ShcTt1ecnOIIVA3Ik6Fe0iFtCG1vfAlzpZIu0OtGkW1om50CAwEAAQKCAYAJ
9mQmSXtHaPCGhS8k7GH2HimdpR/o9kdbISShrQZ7B/uXiRPfTQBPGckYJNgeOp5T
Gs9I26VDrDFMdZi0G9w8beMHJKJ1Pfni9z+KxsUXsqEZlSv08vJsGHuE+jqiCd52
4tmu/MTTKav+VJM/w53loEKDaOk3eIsA39O9DDtbuB+6ntZq1DOUU9amviN99H8g
vCukoJZ2pU7HwNBGvZykYh10XXxI0PeVZbWydvATkIUuOcGdI1A+3iWp4cQfX7um
ScbTrQT2NULTJmotFVm0x+uVp5mnO+Hs7PaRhnfTI7sN/b5jm3FGXzGACW2dRsYh
0I9ogMHlvJi8BJIqaDyhuq2R9QKJLSP1R7mAOlaLSob7rfh3C0VRFBgCYWszDFCH
BFCtHnMIhNhIMpZdNmmD6a++YjBLL7KrenTCCjWatiNix9r13y1ZviRT2Q4sczYI
JBSJ0cOwW+8/d7Xad+RBsEiSpo+VfBJR5Pe3np/fSwvzWYTHnX1pN3kdQR7hpjkC
gcEAzvm+m1G4YbKdP+azVPlz76osGdi52QZuYLWP20CCIzCq7vIoxwKNg1mgO7ZW
WKSWCSDjI55TdJQzfm6Ax8gqFC5Q+nBTNvuFoCSZK7T8+jcEcAtdc8tR3Hg4KD0L
EsFup2MTJXQm579CosUCs1zLVGNf2u8My1Z8qi23RIiViWcwXIwBOnYPcKorD68a
ENkJBQ7YQ9h+mniwN7UTR7cAr3/nGaOsU6VjqHjzit1qakkS/lBZ2il0iz2B+Cbm
D/hPAoHBALoox9wntzT8cGnW8v/Ty4Q51h60DeUv+DGXumJc5Y8C5AqkYYucsYIi
PX9Xv3gsLl6ogwdcBP6KEXtiN6qkcOFkegsOOCZcZgqQGenG4w86d/sy+EmfgyQ+
I2EQjfuBE4D3JlxOpUfVdUhnn0Jyx+tYPPvTt9z+FwI1S+LSH2HsTssW0/1fIrAw
R/ttjk+59wFZmINTXUJYHo2ZqPONu8WOhx4cmp2v+XD+nI+3Xve3fXj94ki9FoQC
sOfWR3LGUwKBwDTgewClPQzAnAniP3h7DlJxUDj+NGSsjvBoEit6bITe/xxyg1Zs
YYjoEdaPe7nDuoz0ePL1lO6Ymhs30fC4Q3/KYWfJ4IiQc4/5KaSP5X1rJtgVHzfg
/rXrhLVK+xQ8lK9w0UhlRzc3lqeM22bFUzDo/mkpX0RngQvdCBAbMNDcqu9J2Vp9
JO6smrm0C124hORk6X1Txuxh3usseJN+vk8Xxwu20+S+wRoeZGHatUAYESEll/7z
TlHwUc766RW1YwKBwQCOy79a+cAHzefw1+f4Ix9GoxLC5HyQJDau2+MllnqkM6R3
IVaNwDlNSDSCHO4LIWDETWCM4aIXGhOE4Hcw1wiba/ZNyq95hYDkc1rdPylmwgPM
1XEtEEWJJH0A9LDkjkNGts5fGhigPHXFf27jiqYduca1qNatlt5RXE6Eg4d9FsXt
9OnRvgseuTpN++Cg+VYmW/KoMeckf/GXzpmRkVPKm6S7jVdww86ERVoUx6T6QW7m
w2CzSRAfXO0UOQL/YG8CgcAJzA4TQAOUiGDW3Qb6qU9v1pMBp7yC/yMkk0cjIhGP
V4cL7NgGqX/m4fX95fl8sFRM1u5c4F1ll/tbKZxDzfclGTf9RxkrJahgGSJW5hko
RjcZrzfo9Al3qcSMcWE4+7kN3Gr9O0iZ89r97vB76N0GjVsn3CZSJm+mnxbOSwru
MouM1CVc2/nGs8mUSDj8SnGpv778ONQVypx8tRubIRGsvkNFtiJ+Q2hjjfsMDfwm
M/D4ZjXsfrW//BMF6+w2Bh4=
-----END PRIVATE KEY-----

View File

@@ -1,11 +0,0 @@
-----BEGIN PUBLIC KEY-----
MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAloJtGMOLcTNWe1IgdrT8
uYucI1Vs02WjyUPZ7Po51iC67QmGdG0InzlBJYdkYtTz8eda+qArZMNGB0ChFs/7
xKPKASkMvVcrm4IYbth0DEIkXWAL7YXsWd8qdS+KsnxuC6TqvuA9Xq/PX4RmtAq4
bl0/1T2HZjJs53/b73l5NehcseZU129w+5lBqDwW5xh+1VnXNbc96za7BFfQSnfg
9WwaWSpo8Y57XATnV7s46yT8gNKM29INHJXs4aIrQ9tcLnTbDz9nhGceNgec3AhO
zc4TyCPugUiG9WD4ehsQr+7Cp30RqT5l9ZPvoBTpAdHLZ1r/jB+qY6+WkY6EsOJW
2xg9bUYoHXjMiFdi8OLXC4NTAPUquFOaIMfjxGaYQc8NoDMFiq3qdTWi2ndCOoxX
yFxYRP5pYs/oA46UAHZsCHaspjvl9jfR/abCALBtsFLwpLA9qqBws5ojXFH//UoX
E7dXnJziCFQNyJOhXtIhbQhtb3wJc6WSLtDrRpFtaJudAgMBAAE=
-----END PUBLIC KEY-----

View File

@@ -1,40 +0,0 @@
-----BEGIN PRIVATE KEY-----
MIIG/QIBADANBgkqhkiG9w0BAQEFAASCBucwggbjAgEAAoIBgQC/J+4zrtDESicS
8LZV/bU/5/GjjTpngL7M3PEf/y0I+Ewf3hKSW3XRZepJ9AV9luEk9VihkvybQ0Mj
ujMjuUgw8CEBV9wU7M7pWqkUavMyAyqadYuvFGwvfLWuMHcucTzhb4BNxL+aWTqv
BsJ+tKhFGVjeLv2iXyHfqOGFodPb+IYY7e6+oBArffiVAQ6Wqv5gvgqSv8Yw6bzp
sTg9xlImAJMCeUJALtNS7qMZa6hyYjWc3Atc+NC9eBz4cq0kSoUZ/5rR+3L18uBp
HbIjOUz2LfWveSN4rOpV7YN4tNu213xtVZTj8qYaDysRyG3ALzBHiKe4NSPAncXC
Z0Gu8OkZrUAzzKh91uzvcu/YSCS9Eu+WBpaJfY/op2UoYd5oOP2/RhYluIUzitz3
LmEPeUba6eGm8//j04VdUFPb+mbzoubFKXCy6fcbYso05cjrjqOF1UdCQhVwGIdM
dhA573/EurHdmIQzvCK1vO4mfEiRuP/w4WAf5YNSZNBVe1vPu90CAwEAAQKCAYAY
tKo4c05npDbXH5XNWOBRXWKxcvoasPzYAPFII6SYLXE3SC4pzNjWIsAsZTXFdNft
/SjCnzr3PTMC/diItDR0oMB/SjH3YWDfr5g9O5JpgxfBRVJzoyXVYF6h4AEzVy7Z
ax4Pzw89fW1UfEDse+Bop91AwB2HXBjGba8SJKd7XWxFchECgbD9UgdsCKowRnLg
oYc/zrnojfkc0gsVDtoEr9vQPMhXf8XPyOh7C1tGx1MrDhSI5F6kMk86PCYNE/VV
Oiw2GdyvZjZnQ3IVFbCL9aT2xPVQfbHQ4DZrf003GtuuqwKi/jumNOTpzZUd8dy4
ruZRik1pyeYklTyxt/FeSof/qJqyG/pLttjWtiWfonRk3Uy+FuHUZ+LcTiTUcN+i
Hl35oUq56a9o71avs78QTnQOMiK8Wi7AGUetL7qdPrbnBEyP5gGkLzi0DKUBDnKI
jBeEcdOBudum1Dso3vh7zss6T5hGnRIfcNxsFqUIk36niX368oML/YRKBMl6U7EC
gcEA5tv5wnrrfFEQDs2+jQoweolchQfTABAMtFpsiQQp50fbrTRccIy4/0EreahD
u97JQ1U33vG8p+MnS2uPNqMrt9E0/lCdOp/h0wJqRSso1mgnia22ySvY++FpL1Ey
HXbMs3jOHW1x0/D8qKLSzNQAjXoBkM+Gath6jtVdn4c+4s/Qb/orh88WB8twKpXB
qQozjt79xaBtgwUlzXhIKPLFE7dkGxIOwsXeNX2NC/vomVz6aHozEzQduGE2nk7d
uk4NAoHBANP5FX7fiROdscCV3OsM/hqa2JPAP3MHWUXn8rMZxHgRzoILhqdfC8p2
QZTFXii0Jloda0lpRipY7ICRUUHzQ2iWWOw4R6haO+Dbdz1LUk0jJTeotqp00k5h
h1W80lNduBeYuFHwj5P3QcBGpILXmox3q2rrxRWbxG4sJVzvcPcluo9UFHcEQXnX
WmzM3VdnN1Vt3TXWev1klGyoJM3J/v7cLa6dBJaWVM5gKSdnpBB99J8x0tOxGjWO
mNxS2oyBEQKBwDo20j5WXLdWgaQaAajzHtJnfOsW1AA6C9oWyzOp1x85IY4FnCHN
eoDzYBEnex0OytWt0Y7oilgTkb8U+mIet1F88c4Haf50fq+E9mNGxN98GCxBn8wO
wIKTjsCdyvNfF7NSDTeid4eoRy4HEP0RoKoMUATCL/UVbaJC737gzdzH5pm2DfAL
KlUA2eIDLXiA2At486k4ESVu0N+FKz0YKtYT8qxY21wGJUh7xmt1NGwn5AUge2ym
QbBS40D8RjFKqQKBwQCcE3hHXdIxllguRGpQy9VBw6gaSmCtksih12J1i1CFVB8o
09HG5Q3qel5Za2WkNNlUWvsHJ7OZNLaXB+i71aFZnfJFpD7m7+HM8+t9PzuPPoSF
0f0Fz1SWj+s1Lv3ykjwda76z3pvpSBKqv5kcGiJasTaPWKBaA8KDmI++OTOFVsti
A3e6FnEbhHy5RbLoS0CL74QEwzL15pv+0WOf/s5526brPgQF2RUCi/1hXUeJOSTo
HqhsZKe2rZNSDtOKxvECgcBo5nK1nORHJgXoX84kwNxRaC99RvVEdJck537zCRlv
wDBim0HUAvqeTjCBIf9pacxZyuCXys8Qt9Vn5oz9n2i6vGzHvdingwR2+35aDMBY
j6Y35PNw13mtg+usASprVsRAwERxBMnv0ALB1a2l7O/+VEZIdJKkEgQyJVnny4bG
gABiqI8wvCbCXU+5rgItXctfWkrxAWed0AopQHu5SM2EPQ0wMyP0q0KFoAPMJVqN
m/lDtrY4EpMy9FSQD1zb+qE=
-----END PRIVATE KEY-----

View File

@@ -1,11 +0,0 @@
-----BEGIN PUBLIC KEY-----
MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAvyfuM67QxEonEvC2Vf21
P+fxo406Z4C+zNzxH/8tCPhMH94Sklt10WXqSfQFfZbhJPVYoZL8m0NDI7ozI7lI
MPAhAVfcFOzO6VqpFGrzMgMqmnWLrxRsL3y1rjB3LnE84W+ATcS/mlk6rwbCfrSo
RRlY3i79ol8h36jhhaHT2/iGGO3uvqAQK334lQEOlqr+YL4Kkr/GMOm86bE4PcZS
JgCTAnlCQC7TUu6jGWuocmI1nNwLXPjQvXgc+HKtJEqFGf+a0fty9fLgaR2yIzlM
9i31r3kjeKzqVe2DeLTbttd8bVWU4/KmGg8rEchtwC8wR4inuDUjwJ3FwmdBrvDp
Ga1AM8yofdbs73Lv2EgkvRLvlgaWiX2P6KdlKGHeaDj9v0YWJbiFM4rc9y5hD3lG
2unhpvP/49OFXVBT2/pm86LmxSlwsun3G2LKNOXI646jhdVHQkIVcBiHTHYQOe9/
xLqx3ZiEM7witbzuJnxIkbj/8OFgH+WDUmTQVXtbz7vdAgMBAAE=
-----END PUBLIC KEY-----

View File

@@ -1,40 +0,0 @@
-----BEGIN PRIVATE KEY-----
MIIG/gIBADANBgkqhkiG9w0BAQEFAASCBugwggbkAgEAAoIBgQC1lzvnT5zHANwb
+W+kQebd/EWCnlfl1/3SznVHhKEqlXp2YNFhedWKX0aZesl/9oYCqux/plS9lYms
AnY47Zda3y1ypqOdpZ0zfcGsf9DO1MmSgYdkzXEtjkSlFpajUtobaA0axrEbQ431
PV6YqLtcMRwj0uZz+aE/pK65Se8bCrVnjfe+oah2iuRT5PaMJ9+WHB96e8Fw6TgY
lmgkWViyPL0O2WFrvQwml1UVZ9/GzhQGGGSNyRvsZsNNXFrfG/PU0RuRjb6iH+0m
a4i66kDsDpOd9g/Vg9c8xFAW1I9oow54pbknkiiu+BAqvgLvgdH2IGiMk3agnr8G
N8BrPs/yTLAuPa6j2Al6Y6bXDPwdnJmzPjzYYdrTCqlRwV84ivShMyIm28uf8VJh
VvnG82DfFaIY8yO7fZnj1dNftXFMOwiMbHnC0N3gbwgtLfJSUrDTK58dpybLwWf4
+WT5e3MFvPqurh+tX3f/eZ9Uw8aAEPHyYuNUmi88GdcoFJf5J1sCAwEAAQKCAYAK
nLn9fKOW5a/3Wo5xtQA+/N07EvHkFslYpoQoF9IrYOz1OhdCcRJPsd24XnqkJc4T
HdYQZ7IQGksfaE1sakYsI1rOlnp9Xg5f0fudjyKu07SsATHebDsvBF9ynm1TQiZI
773EUNRM2ZfUOy/qEAJTEvOoDE03feE0jPVBEtcMZ4XOdXeDBoOH2foaBQl7i2D/
rskQKWdWp+qFVVTkuuv6Dp6l3YJZ/4RURQfN5nIndiepa4eE2bnuCNtlC/6rh0CR
fPSI+i7eg9X8lCiqC4WHbyXp4zrqBbw60RkoYedyhWZE+pAsTnh1jxRQoFXUs03Z
XV3aD3gJLwUlIOf65kvLTTo1o/V2uyNZJSzFDNvVJrFIg0AqwzAgaY5kjbVXlf4G
GmjacP56TADbs/fZSRMjibGP+KsbiVbc1Mnio4co+9lyRMtwXe4TUUa3GOoaMN8a
LzT+5geVlZ1koQuofwfXFCKPaAe/SVFLNHsp/eyO6HCT9dUGXOxgoT1pL+/k6dEC
gcEA22uySiIOJelq1cN7s+CRxsn8mdx4eZHoc067heutxocYp/pFdJKmY5Qk/h5e
uC+/hsiWOS1KC2JVSi/fo7L3f1wttCQ5GLdhnp7umTGmDmFtEyn6b1EOai+nvjow
cqZDMY1jNpiLXnSRSplXUwE04RQ/4+z29GlIRGvaXkI/ovcBJ2RlJF2hydFbBOlK
vH12EtURrTgU9y5UJR6j8evmmSOv5ufKOX3FUKFNyau2kwYZD3BPuFGLlDrIN4Ic
NRK/AoHBANPdDfqjtlIOXv7Va2SaOOhDkGV6MHlx+5VeUkt1Qh9yIcVihMCXL61o
35BOd10TmyV4OZDwIIIMiHim4ofDAnOsXWOhNKlu2qN0HY6gDmfTrQM8L0sHyErM
YY1fOAtRiTEOOIgikj/8E1KTJ2HWVnZDWUXaQVnU7Vmn0b3Yq/IN/impL627ZKTl
dg45nNEfVhXfoXv+4O3Cmkt4WGM4XaDesmoGSkTjZaXFCzH9SgWSs7JClgDzCJ14
QSzn96G+ZQKBwFwugaetaP46cvy9dKHcTcITJ8FII4EHcH3I7PVVTxthtFUVysov
tiGNooD0J10AClnIuXvp7/qaZDSXqj/utxXVlwngUfB1Uli+coT/m8Dc42Mytpi/
l+u6e6FqduIjwYT23mCYc6zKEiQiCdLAZgPNaw4JhrKl7It6ODJzaKLBXMW84tUF
VSwhfTix/gj0OH+u7g80yXITD5zMo5nGPonFuWerp4TBtvyp17FLJ5fa7vpSd9t6
vsYWb/kJ+2m8pwKBwQDTVvyd3Hd/7UQH0x9Y8Jr53oQJJlV6oCBGBRv0l9jJA5H6
k2c3stjlk+sHya46U9d9DivmkBLth9EPAfKRWQ92EifqvaGJrsI9MRRW9QTJv5cj
1gKbRv0e2DgrzSNb7w76t2PfMRVQ7ITd51rutt/zAwXnr2tnUAcgW07XoW8Me7bh
Ghsso/UmpJsaX5A175txIG63AS6hHnHJ/Re2ikCju+Kf7vxhMbFxJlkfmbogSxIk
LVXzRnx+kLn7ML6OQx0CgcEAxcsIByq8JDtAUbvWtObfET86QPcw5otZ9eadetVU
UGtbVc2zVIsstMkHGzvLuG8k61vkTimJnwJ+SVy8CEmV+7ZLY3T/wFBI3XdCYpAp
bJi6Fn0LsUdu/dRD8KNyaQZVcMGoqPQNVCaHC6YB4tWuWR/unaxPDYiP8u/PwWCz
+Cwpeby5XxlYR79YlIZFTeFbRogZZ+sfbWX9q314MxoVf/ZPETOA9063z4kAXcL5
RqsZZ1cLu0TCOoNBkcSr79a6
-----END PRIVATE KEY-----

View File

@@ -1,11 +0,0 @@
-----BEGIN PUBLIC KEY-----
MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAtZc750+cxwDcG/lvpEHm
3fxFgp5X5df90s51R4ShKpV6dmDRYXnVil9GmXrJf/aGAqrsf6ZUvZWJrAJ2OO2X
Wt8tcqajnaWdM33BrH/QztTJkoGHZM1xLY5EpRaWo1LaG2gNGsaxG0ON9T1emKi7
XDEcI9Lmc/mhP6SuuUnvGwq1Z433vqGodorkU+T2jCfflhwfenvBcOk4GJZoJFlY
sjy9Dtlha70MJpdVFWffxs4UBhhkjckb7GbDTVxa3xvz1NEbkY2+oh/tJmuIuupA
7A6TnfYP1YPXPMRQFtSPaKMOeKW5J5IorvgQKr4C74HR9iBojJN2oJ6/BjfAaz7P
8kywLj2uo9gJemOm1wz8HZyZsz482GHa0wqpUcFfOIr0oTMiJtvLn/FSYVb5xvNg
3xWiGPMju32Z49XTX7VxTDsIjGx5wtDd4G8ILS3yUlKw0yufHacmy8Fn+Plk+Xtz
Bbz6rq4frV93/3mfVMPGgBDx8mLjVJovPBnXKBSX+SdbAgMBAAE=
-----END PUBLIC KEY-----

View File

@@ -1,40 +0,0 @@
-----BEGIN PRIVATE KEY-----
MIIG/gIBADANBgkqhkiG9w0BAQEFAASCBugwggbkAgEAAoIBgQDOk7AQIpVbQp1n
CVUm1bu2SqprXBjUn4eG4V/+RuOYm/x/AVwaP67LLazlxfOByQ0fPcK/gqLxWdBq
RufzcpFM0i4y9iDCdo1jfkq9UpTlHwo8nvBXzIRTKFHKO1q5pj1NpVQfQxK0PeLN
xns996Ncm/FG0uND1Jf8r6OgezeaRbJYM1ib27p5wsGg/FboGkBeJQ5adKlzQg7a
eMZu+dgjvOzm1h0WNW0NN/hM5IgNd4Jdzuc1SF//JBUAQq8aavrhKKFlz7XVPkBc
nLV5USMXCPuFapxnGGC6Rpw6hTyhQ5E7Q7QfUchLwgJccGAovXsmr5+6sQieVTg9
+nW2QDt1iH2ddD3X6GZG1NJcDUGnNZ0jMLd9CqfBOwPpzIgOw91EH2JIlPLAU9sb
LAwhuHjAilQ5LezzcMG2nGPaofDvNzlD30E/gN3fySX16N91i4VhGZvOur4FlHuJ
zn8szv7yITFganPewUKvqokCUIMri2HpMKXZmPOClM4XemcLUjsCAwEAAQKCAYAn
FrkdBH5Ai4VfRtvPAmiHoO9Ia1/jc+BgPGs+oUlVykZn/ejgqqY3mgf6Xo+qQlHy
VGxycpTEmJsgURR483fdEnRdfkdKpMYySmZ4FpVIGayFNgoCgxeS6LE5VCvhrzww
YhVd6QI0CvXMvD77xc0qq/Nm1Gbeoe60iMOsjURDM+cAW47rxxMtERY0kSsctkLx
zY8+vI6H2bsXyfy6aRpmAMzPDTrpxehBtRKN8jxwV+naOFl1sqE/lSNILlYV6KID
HDRgnwVMJCtaYCF88MWuaQQ7O2pX/Ba1x42iZtLCX1ABw3N6/PsB/90KtSNp5Duu
naM50NpsFDqAnFXrB7rUM7OK3nnBGVDK4KpD+36HdhNSCvhO+Tz+GQnWh46dMx76
0yOlSLoIHdDozP4aQXiHnIKdm8gInTOyoQftm3+11ba9WL7n8xOFH5sAl0em44d2
NcYx49myiIk/1VI+SZzPRUxwU4pwXL4rMRXzkRuQLQ6KorKqL2d1iH+crpFVCWEC
gcEA9Wy8nqS/2Nq7A+ph2B+Kf1o4Dc8njRrIJRwUBeik8zIfbaH5TdGUrjAyFOdO
GaL0bLz02hkOh+vq4NpxqcvLZ4L+phPgeDvb8DFFkdYE2jtbAFFOidGIfplja0aL
FBiusu3myGD37/7dSQo7VM/TihO6BANbye+SOFBHmTRNjFy7z6JPZOfQKp+yWFHN
3DOemAsG4XdVnWfkLqW7aBzsePae7ivMidHffgr9kdxbMPBemovN5ppFXMMLG6VQ
xmrxAoHBANd6bE5f3zEvaBAQElUzHGB3sbAi7YZv/Oms2I0J+qQN9/a5N47VWys6
WKN6VB4ZHFU4wWPX56eARDONalmrNTOaMkOSOf/jAAstbMd0WjKs8/T0n80QCtD3
ti3HTR9Ls7gFcKzDwVMscnbpFtv8wa2tvIkNodrD9faiQ8ubZfcAyuL1suXEMFKb
dor8B/R7DNYztgZ31IeWuVPhhb4iSceWtWyRdaUXDaYG0jZcmWi5zFcFLjiFTckB
0RRaZwOX6wKBwHmMsxY3LjTuj7TuvirV5DgSrLRaJpKB8yI998S9ZgR0jJA1qk1a
QTLL9+HWdR3JURkRtIrX4hR7SUa3qZeYsVLA0/HY4lFqBBG/tV73CkwzHWzY1/b1
6Y4Z1d1pgLQhTVSc8rHHJMSeC2aDRMNKctBt2LDoIOuwVVDCodNEzit4OiQplPy6
uqSBl0iaq0Ql5KQUwgGkoqhkreRUfK6htJRsQGZhFtojMXcxZkh5REjGo3QTTZSq
TzQT/Uph49GBYQKBwQDELaZ7uJeIvUN+FFPMlAsK3Q6+cR5V3pGh4gcKaYJzaHBQ
hZLKjP9DHQzkUZRSDsSX5mNT1pcHDiWJ1f90ggae441Nrcz2ZqJ8iq/V693O813s
r+bpmOhwFocbqK9TheWq7fEGqfbSFc5k6pQwVy+yQ1I6aVnpxa2jDVqx/dpYhrUw
60ckH3lrTDUiFpHbiUhHoK7htqmdhKFYeCP+1lLbzx+AJ/K3CoUXmnA6pBXbngUn
WQUa2mrWTbwgTqopQF8CgcEA72nxgVESZclZQPxkAjnYQCPdhwioYFU2s1C2upNR
KQ4SQO7f1wjSrjj33THm6gzCpg3Wi9TCUYZoO/UFYHVtg3mUybwYowQTG1i35Xzy
TxaJLz3gL+0WrLqnifxSuxsp1AVMHYxbxyXdAawKtTexVJ0Z/L+e771Kyi8yjJtr
511v9Nr9GX4wIQb1OpXKynTqcE0P7OLKnr1ATNReM1jEMlaot2TP8sY7uj6CUgsL
5PO2cnRk24OsUqAswTBT2qjd
-----END PRIVATE KEY-----

View File

@@ -1,11 +0,0 @@
-----BEGIN PUBLIC KEY-----
MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAzpOwECKVW0KdZwlVJtW7
tkqqa1wY1J+HhuFf/kbjmJv8fwFcGj+uyy2s5cXzgckNHz3Cv4Ki8VnQakbn83KR
TNIuMvYgwnaNY35KvVKU5R8KPJ7wV8yEUyhRyjtauaY9TaVUH0MStD3izcZ7Pfej
XJvxRtLjQ9SX/K+joHs3mkWyWDNYm9u6ecLBoPxW6BpAXiUOWnSpc0IO2njGbvnY
I7zs5tYdFjVtDTf4TOSIDXeCXc7nNUhf/yQVAEKvGmr64SihZc+11T5AXJy1eVEj
Fwj7hWqcZxhgukacOoU8oUORO0O0H1HIS8ICXHBgKL17Jq+furEInlU4Pfp1tkA7
dYh9nXQ91+hmRtTSXA1BpzWdIzC3fQqnwTsD6cyIDsPdRB9iSJTywFPbGywMIbh4
wIpUOS3s83DBtpxj2qHw7zc5Q99BP4Dd38kl9ejfdYuFYRmbzrq+BZR7ic5/LM7+
8iExYGpz3sFCr6qJAlCDK4th6TCl2ZjzgpTOF3pnC1I7AgMBAAE=
-----END PUBLIC KEY-----

View File

@@ -1,40 +0,0 @@
-----BEGIN PRIVATE KEY-----
MIIG/gIBADANBgkqhkiG9w0BAQEFAASCBugwggbkAgEAAoIBgQDaDQhs3Gw0hnp8
poZMdNClQV+AlWrfHRJnjnzEBAMvSXU9n6Wcy29Lf9lmlsX31su6rLNS4fCL7UEn
82V53rWgrxF0kp9Q+JBSyFd+9ZPj+wuxg7of6/arDaMG/qTHeH614OK4cxvDqKRQ
QKvm7WSqSNv6WzdqKO1amWY3bkdGHAUH+Xr/TECERA0DfoSg1v65+wNH/ZpFBgZD
qp6DKenxtS3skN/eFbXLvpQIqUq14V8g6SnjPBjRhir817CAqXN7TwsGtf7PLnGv
lWfycTRm1Zjy9s0LfdJ/qDkPVmUD4e+q6mUBZL+s/KaP4g3v0V5c16CbILEX9lp+
yd5pQGcalKBdhvIBKkD46SpSolwER5Mjit9Fk+LLHfO1qJuD6uA4Qz8NRXmV7ZbK
6OexDvkgbhKtW79dOYXTww3z+EPX7J0FWeFVrtsThZy2qADVP/kE/uK8AHTdrUEk
ekoVGH9D+k7k40gryU0YbpoiYs+a0mKMS84vRWxR2n6g7ztWdMUCAwEAAQKCAYAj
B6H5XyXxAEOwP85mfQPB8LEnhpmPM2vwAAeSM/TRBXOUzU99U39TOTxTS1iNes/q
8vCyGYMb76cehG8id4FlSYq72AxJJU2GRxIrXsd+Aig8QeXGWBGeJEgzCPiu5PAy
RukVacSll7OiAum65RtdcewJGdtari2HdwphUFGZ9UlnoRA98GGS/h27GHm1HyT3
+tfpmlfMy+14tHHXr4WaY5l3nkSguIsmqry8cXoDoyu1rU+h5lc0XeINEZeU6+PK
GKfu0uL9s/ejBNG2q7sHnKW6YWZMcaGipbYay922VvJv/DNrNZmosmfbNAMk5HBP
mEgQDc6aaQ0ASPw/hfSxNBV/ihnooepWMAnYz4X6LUtyLHt1GTQVP7AGQA5jqkyz
O30cCrP96IORD2F+ntKdSgQb83WB7C96Z1RLuVynLhR476w4oBEl7mhYVnTxgvVL
j6wxu5xJArpXU6DeoD6DH+Yk5Ahw+yJwYWqgjGWwLa6veG9Ps50l+h2/c1zIIuEC
gcEA8Dai7Vdoeu8hlan+nfSdb9SwGJ/DbNFevo3Jvh8Z6UDvHvxwucPr4mgXpjTI
rGFwmRK7ENj0Ompi+RHRxfkpv2uDwS/4RzxVnNTYcKgI2EKdKTyasyLIkPI3R38R
GhBg8v2aBH2NPubReG5c9Bz/eE3FEx5e6ZY77qGOhXClSz+rubl7FgmsYdxKxIxQ
mX7g+A6mhvU5LAPTxBmf2t+x8VvGZbkgF5dLrPf+qZytIB382S8Q4/dyUWXR+IaL
NIexAoHBAOhhiHyzUTMSERCoGhy1o86WeYnRYtXPO5eW1g9V2EvD/A/oYFNSwVQ8
468qhUZdex5v9e60Q4Qvf8/IWgtURGpsdZN8l4yJohJoeRs+Id5WsU0KAzlAKgh6
Bgh/3haIocju1PuO5EPBt4inV0aC8oq56lNJfJMoUXRviz9d+Iam5YbOPc47uMdW
OqucnJNW0Wco61aEpkN0N7MrtuCOxr+si1KHv7gA2tTiYhbehE8GqHb9mOdMi67A
Rr12h5yXVQKBwQDexDx6UMpC34tMyXaoM5bhg+O/IkJQoyXzH3jNSPh1mVNocAF2
NRyHPbNY3rCPNFoAix9SM3Diz5BznTPmHfi6XVG1ke/02B4pMDZ820hAjh5DhMGO
iR5pVUcwlcVdX30ZO1he+7RGdjYiMm8fr9i3T6AI5+xrQXjZB5gtZdbUnvp5ZWqh
eF0V7/6ioeGJR+IICUYj+DyJ9g6oWH8nsrXJuCuYYINDfXqfsOjJkNP46fZ3zy8h
ynOIyx1bFiL4lzECgcBvSr7OUibyWZW4r3mKBGgGOcTNf21hTtWQfRnZ0Fg9uQgQ
Kk9vuHOEv4Cf1LJth7m+UwqqnsSzGviQb7jIMjxt57HLx+Dg2s23GTffFzurO0PA
zKnMknFPC/m1ul+H1Tn+fHueWsnxtWYL2XEQAQjd7bpO1yQFakrQg9dhqsSq4GWO
0VmCWtHdDewdYm0Ol4bEbDGBhxgFuDQw6B+2nkqLY7x58y+blTU4vY8SutEM8/hc
vImtRNilAcsfVBQQp90CgcEAyou+tZBMjUzlA3QP8xEOQuJnikM05tsOZBnC+/O/
H85cwdlUOCAPSrbyhA3ON7fXR3MtL4R/Vxnf1WQPVB8tVdEUlhOZhg12L6D1LsiO
F3izbMcAyxsvVvnMoSWm4tbP4eYSmD6ASneikLGuFIS+/YnqP6cbvirKd7WSFxoO
gR7BwY4YEAqISlzZuFj+/KmF/Lby62LyRIt7HXySMzSrVsVEpozrsfME+H5yxYJn
VkpSw8QqBfhHSViEh12BQZa2
-----END PRIVATE KEY-----

View File

@@ -1,11 +0,0 @@
-----BEGIN PUBLIC KEY-----
MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA2g0IbNxsNIZ6fKaGTHTQ
pUFfgJVq3x0SZ458xAQDL0l1PZ+lnMtvS3/ZZpbF99bLuqyzUuHwi+1BJ/Nled61
oK8RdJKfUPiQUshXfvWT4/sLsYO6H+v2qw2jBv6kx3h+teDiuHMbw6ikUECr5u1k
qkjb+ls3aijtWplmN25HRhwFB/l6/0xAhEQNA36EoNb+ufsDR/2aRQYGQ6qegynp
8bUt7JDf3hW1y76UCKlKteFfIOkp4zwY0YYq/NewgKlze08LBrX+zy5xr5Vn8nE0
ZtWY8vbNC33Sf6g5D1ZlA+HvquplAWS/rPymj+IN79FeXNegmyCxF/ZafsneaUBn
GpSgXYbyASpA+OkqUqJcBEeTI4rfRZPiyx3ztaibg+rgOEM/DUV5le2WyujnsQ75
IG4SrVu/XTmF08MN8/hD1+ydBVnhVa7bE4WctqgA1T/5BP7ivAB03a1BJHpKFRh/
Q/pO5ONIK8lNGG6aImLPmtJijEvOL0VsUdp+oO87VnTFAgMBAAE=
-----END PUBLIC KEY-----

View File

@@ -1,15 +1,11 @@
package com.cygnus.client;
import com.cygnus.client.model.CloudIdentitySession;
import com.cygnus.client.model.CloudDataItem;
import com.cygnus.client.model.CloudDataRequest;
import com.cygnus.client.model.CloudQueryResponse;
import com.cygnus.client.model.LoginPayload;
import com.cygnus.client.security.LoginEnvelopeEncryptor;
import com.cygnus.client.security.MachineTokenProvider;
import java.time.Clock;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
@@ -77,18 +73,4 @@ public class CloudIdentityClient {
.bodyToMono(CloudQueryResponse.class))
.timeout(properties.requestTimeout());
}
public Mono<List<CloudDataItem>> fetchData(String scope, Map<String, Object> data) {
return tokenProvider.accessToken()
.flatMap(token -> webClient.post()
.uri(properties.baseUri().resolve("/api/v1/platform/data"))
.header(HttpHeaders.AUTHORIZATION, "Bearer " + token)
.contentType(MediaType.APPLICATION_JSON)
.accept(MediaType.APPLICATION_JSON)
.bodyValue(new CloudDataRequest(scope, Map.copyOf(data)))
.retrieve()
.bodyToFlux(CloudDataItem.class)
.collectList())
.timeout(properties.requestTimeout());
}
}

View File

@@ -1,4 +0,0 @@
package com.cygnus.client.model;
public record CloudDataItem(Object value, String label, String group) {
}

View File

@@ -1,6 +0,0 @@
package com.cygnus.client.model;
import java.util.Map;
public record CloudDataRequest(String scope, Map<String, Object> data) {
}

View File

@@ -1,49 +0,0 @@
package com.cygnus.cloud.platform.api;
import com.cygnus.cloud.platform.service.ScopedDataException;
import com.cygnus.cloud.platform.service.ScopedDataService;
import jakarta.validation.Valid;
import java.util.Map;
import java.util.UUID;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.security.oauth2.jwt.Jwt;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;
@RestController
@RequestMapping("/api/v1/platform/data")
public class ScopedDataController {
private static final Logger LOGGER = LoggerFactory.getLogger(ScopedDataController.class);
private final ScopedDataService service;
public ScopedDataController(ScopedDataService service) {
this.service = service;
}
@PostMapping
public Flux<ScopedDataItem> data(
@AuthenticationPrincipal Jwt machineJwt,
@Valid @RequestBody ScopedDataRequest request) {
if (machineJwt == null) throw new ScopedDataException("Machine authentication required");
try {
return service.fetch(UUID.fromString(machineJwt.getClaimAsString("tenant_id")), request);
} catch (IllegalArgumentException exception) {
throw new ScopedDataException("Machine tenant is invalid");
}
}
@ExceptionHandler(ScopedDataException.class)
@ResponseStatus(HttpStatus.BAD_REQUEST)
Map<String, String> invalidRequest(ScopedDataException exception) {
LOGGER.warn("Scoped platform-data request rejected: {}", exception.getMessage());
return Map.of("code", "PLATFORM_DATA_INVALID", "message", exception.getMessage());
}
}

View File

@@ -1,7 +0,0 @@
package com.cygnus.cloud.platform.api;
public record ScopedDataItem(
Object value,
String label,
String group) {
}

View File

@@ -1,10 +0,0 @@
package com.cygnus.cloud.platform.api;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import java.util.Map;
public record ScopedDataRequest(
@NotBlank String scope,
@NotNull Map<String, Object> data) {
}

View File

@@ -1,79 +0,0 @@
package com.cygnus.cloud.platform.repository;
import com.cygnus.cloud.database.ReactiveDatabaseClient;
import com.cygnus.cloud.platform.api.ScopedDataItem;
import io.vertx.sqlclient.Row;
import io.vertx.sqlclient.Tuple;
import java.util.List;
import java.util.UUID;
import org.springframework.stereotype.Repository;
import reactor.core.publisher.Flux;
@Repository
public class ScopedDataRepository {
private static final String COMPANY_OPTIONS = """
SELECT ov.opt_value AS value,
ov.val_description AS label,
lower(o.description) || '.' AS group_name
FROM platform.company_options_mapping m
JOIN platform.options o ON o.option_id = m.option_id
JOIN platform.options_values ov ON ov.opt_value_id = m.opt_value_id
JOIN identity.company c ON c.company_id = m.company_id
WHERE c.tenant_id = $1
AND m.company_id = $2
AND o.isactive = 1
AND ov.isactive = 1
AND o.description = ANY($3::text[])
ORDER BY o.description, ov.val_description
""";
private static final String PORTFOLIO_OPTIONS = """
SELECT ov.opt_value AS value,
ov.val_description AS label,
lower(o.description) || '.' AS group_name
FROM platform.options_mapping m
JOIN platform.options o ON o.option_id = m.option_id
JOIN platform.options_values ov ON ov.opt_value_id = m.opt_value_id
JOIN identity.company c ON c.company_id = m.company_id
JOIN platform.company_branch_portfolios cbp
ON cbp.company_id = m.company_id
AND cbp.portfolio_reference = m.portfolio_reference
WHERE c.tenant_id = $1
AND m.company_id = $2
AND cbp.company_branch_id = $3
AND m.portfolio_reference = $4
AND o.isactive = 1
AND ov.isactive = 1
AND o.description = ANY($5::text[])
ORDER BY o.description, ov.val_description
""";
private final ReactiveDatabaseClient database;
public ScopedDataRepository(ReactiveDatabaseClient database) {
this.database = database;
}
public Flux<ScopedDataItem> companyOptions(
UUID tenantId, short companyId, List<String> descriptions) {
return rows(COMPANY_OPTIONS, Tuple.of(tenantId, companyId, descriptions.toArray(String[]::new)));
}
public Flux<ScopedDataItem> portfolioOptions(
UUID tenantId, short companyId, short branchId, UUID portfolioReference,
List<String> descriptions) {
return rows(PORTFOLIO_OPTIONS,
Tuple.of(tenantId, companyId, branchId, portfolioReference,
descriptions.toArray(String[]::new)));
}
private Flux<ScopedDataItem> rows(String sql, Tuple parameters) {
return database.preparedQuery(sql, parameters)
.flatMapMany(result -> Flux.fromIterable(result))
.map(this::item);
}
private ScopedDataItem item(Row row) {
return new ScopedDataItem(
row.getValue("value"), row.getString("label"), row.getString("group_name"));
}
}

View File

@@ -1,7 +0,0 @@
package com.cygnus.cloud.platform.service;
public class ScopedDataException extends RuntimeException {
public ScopedDataException(String message) {
super(message);
}
}

View File

@@ -1,74 +0,0 @@
package com.cygnus.cloud.platform.service;
import com.cygnus.cloud.platform.api.ScopedDataItem;
import com.cygnus.cloud.platform.api.ScopedDataRequest;
import com.cygnus.cloud.platform.repository.ScopedDataRepository;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.UUID;
import org.springframework.stereotype.Service;
import reactor.core.publisher.Flux;
@Service
public class ScopedDataService {
public static final String COMPANY_OPTIONS = "company-options";
public static final String PORTFOLIO_OPTIONS = "portfolio-options";
private final ScopedDataRepository repository;
public ScopedDataService(ScopedDataRepository repository) {
this.repository = repository;
}
public Flux<ScopedDataItem> fetch(UUID tenantId, ScopedDataRequest request) {
Map<String, Object> data = request.data();
short companyId = shortValue(data, "companyId");
List<String> descriptions = descriptions(data);
return switch (request.scope().trim().toLowerCase(Locale.ROOT)) {
case COMPANY_OPTIONS -> repository.companyOptions(tenantId, companyId, descriptions);
case PORTFOLIO_OPTIONS -> repository.portfolioOptions(
tenantId, companyId, shortValue(data, "branchId"),
uuidValue(data, "portfolioReference"), descriptions);
default -> Flux.error(new ScopedDataException("Unsupported data scope"));
};
}
private UUID uuidValue(Map<String, Object> data, String name) {
try {
return UUID.fromString(String.valueOf(data.get(name)));
} catch (RuntimeException exception) {
throw new ScopedDataException(name + " must be a valid UUID");
}
}
private short shortValue(Map<String, Object> data, String name) {
Object value = data.get(name);
try {
short result = value instanceof Number number
? number.shortValue() : Short.parseShort(String.valueOf(value));
if (result <= 0) throw new NumberFormatException();
return result;
} catch (RuntimeException exception) {
throw new ScopedDataException(name + " must be a positive number");
}
}
private List<String> descriptions(Map<String, Object> data) {
Object value = data.get("descriptions");
if (!(value instanceof List<?> values)) {
throw new ScopedDataException("descriptions must be a non-empty list");
}
List<String> result = values.stream()
.map(String::valueOf)
.map(String::trim)
.filter(text -> !text.isEmpty())
.map(text -> text.toUpperCase(Locale.ROOT))
.distinct()
.toList();
if (result.isEmpty() || result.size() > 20) {
throw new ScopedDataException("descriptions must contain between 1 and 20 values");
}
return result;
}
}

View File

@@ -38,8 +38,6 @@ public class CloudSecurityConfiguration {
.hasAuthority("SCOPE_identity.login")
.pathMatchers("/api/v1/queries/**")
.hasAuthority("SCOPE_identity.login")
.pathMatchers("/api/v1/platform/data")
.hasAuthority("SCOPE_identity.login")
.pathMatchers("/api/v1/admin/**")
.hasAuthority("SCOPE_cygnus.admin")
.anyExchange().authenticated())

Binary file not shown.

View File

@@ -42,9 +42,8 @@ import org.springframework.stereotype.Service;
public class SwingInstallationWizard {
private static final String WELCOME = "welcome";
private static final String DATABASE = "database";
private static final String DEPLOYMENT = "deployment";
private static final String DETAILS = "details";
private static final String RUNTIME = "runtime";
private static final String INSTALLING = "installing";
private static final Color ACCENT = new Color(35, 97, 146);
private static final Color BACKGROUND = new Color(236, 243, 247);
@@ -69,9 +68,7 @@ public class SwingInstallationWizard {
private JPasswordField dockerPassword;
private JTextField outputDirectory;
private JTextField containerCloudServiceUrl;
private JTextField databaseHost;
private JTextField databasePort;
private JTextField databaseName;
private JTextField databaseUrl;
private JTextField databaseUsername;
private JPasswordField databasePassword;
private JTextField redisHost;
@@ -142,9 +139,8 @@ public class SwingInstallationWizard {
cardPanel = new JPanel(cards);
cardPanel.setBackground(BACKGROUND);
cardPanel.add(welcomePanel(), WELCOME);
cardPanel.add(databasePanel(), DATABASE);
cardPanel.add(deploymentPanel(), DEPLOYMENT);
cardPanel.add(detailsPanel(), DETAILS);
cardPanel.add(runtimePanel(), RUNTIME);
cardPanel.add(installingPanel(), INSTALLING);
root.add(cardPanel, BorderLayout.CENTER);
return root;
@@ -201,8 +197,7 @@ public class SwingInstallationWizard {
JPanel top = new JPanel(new BorderLayout());
top.setOpaque(false);
top.add(heading("Installation details"), BorderLayout.NORTH);
top.add(text("Review and enter the activation details supplied by Technobee."),
BorderLayout.SOUTH);
top.add(text("Enter the activation details supplied by Technobee."), BorderLayout.SOUTH);
panel.add(top, BorderLayout.NORTH);
JPanel form = new JPanel(new GridBagLayout());
@@ -214,32 +209,6 @@ public class SwingInstallationWizard {
licenseKey = new JPasswordField();
installationCode = new JTextField();
installationName = new JTextField();
int row = 0;
row = addField(form, row, "Client code", clientCode, null);
row = addField(form, row, "License key", licenseKey, null);
row = addField(form, row, "Installation code", installationCode, null);
addField(form, row, "Installation name", installationName, null);
panel.add(form, BorderLayout.CENTER);
JButton back = secondaryButton("Back");
back.addActionListener(event -> cards.show(cardPanel, DEPLOYMENT));
JButton install = primaryButton("Install");
install.addActionListener(event -> startInstallation());
panel.add(actions(back, install), BorderLayout.SOUTH);
return panel;
}
private JPanel deploymentPanel() {
JPanel panel = contentPanel();
panel.setLayout(new BorderLayout(0, 12));
JPanel top = new JPanel(new BorderLayout());
top.setOpaque(false);
top.add(heading("Docker and deployment"), BorderLayout.NORTH);
top.add(text("Configure the container image, registry and deployment location."),
BorderLayout.SOUTH);
panel.add(top, BorderLayout.NORTH);
JPanel form = formPanel();
containerCloudServiceUrl =
new JTextField(settings.containerCloudServiceUrl().toString());
containerCloudServiceUrl.setEditable(true);
@@ -251,6 +220,10 @@ public class SwingInstallationWizard {
outputDirectory = new JTextField(
settings.defaultOutputDirectory().toAbsolutePath().normalize().toString());
int row = 0;
row = addField(form, row, "Client code", clientCode, null);
row = addField(form, row, "License key", licenseKey, null);
row = addField(form, row, "Installation code", installationCode, null);
row = addField(form, row, "Installation name", installationName, null);
row = addField(
form,
row,
@@ -264,11 +237,8 @@ public class SwingInstallationWizard {
dockerImage,
null);
row = addField(form, row, "Docker registry", dockerRegistry, null);
row = addComponentField(
form,
row,
"Docker credentials",
credentialFields(dockerUsername, dockerPassword));
row = addField(form, row, "Docker username", dockerUsername, null);
row = addField(form, row, "Docker password", dockerPassword, null);
for (String field : profile.optionalInstallationFields()) {
JTextField input = new JTextField();
optionalFields.put(field, input);
@@ -284,28 +254,31 @@ public class SwingInstallationWizard {
panel.add(scroll, BorderLayout.CENTER);
JButton back = secondaryButton("Back");
back.addActionListener(event -> cards.show(cardPanel, DATABASE));
back.addActionListener(event -> cards.show(cardPanel, WELCOME));
JButton next = primaryButton("Next");
next.addActionListener(event -> cards.show(cardPanel, DETAILS));
next.addActionListener(event -> cards.show(cardPanel, RUNTIME));
panel.add(actions(back, next), BorderLayout.SOUTH);
return panel;
}
private JPanel databasePanel() {
private JPanel runtimePanel() {
JPanel panel = contentPanel();
panel.setLayout(new BorderLayout(0, 12));
JPanel top = new JPanel(new BorderLayout());
top.setOpaque(false);
top.add(heading("Database and Redis"), BorderLayout.NORTH);
top.add(heading("Runtime configuration"), BorderLayout.NORTH);
top.add(text("Configure the database and Redis services used by the "
+ profile.displayName() + " on-premises container."), BorderLayout.SOUTH);
panel.add(top, BorderLayout.NORTH);
JPanel form = formPanel();
databaseHost = new JTextField("localhost");
databasePort = new JTextField("5432");
databaseName = new JTextField("matrix");
JPanel form = new JPanel(new GridBagLayout());
form.setBackground(PANEL);
form.setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createLineBorder(new Color(205, 217, 225)),
BorderFactory.createEmptyBorder(14, 16, 14, 16)));
databaseUrl = new JTextField("jdbc:postgresql://localhost:5432/matrix");
databaseUsername = new JTextField("postgres");
databasePassword = new JPasswordField();
redisHost = new JTextField("localhost");
@@ -314,16 +287,9 @@ public class SwingInstallationWizard {
cloudRequestTimeout = new JTextField("PT10S");
tokenRefreshSkew = new JTextField("PT30S");
int row = 0;
row = addComponentField(
form,
row,
"Database",
databaseConnectionFields());
row = addComponentField(
form,
row,
"Database credentials",
credentialFields(databaseUsername, databasePassword));
row = addField(form, row, "Database URL", databaseUrl, null);
row = addField(form, row, "Database username", databaseUsername, null);
row = addField(form, row, "Database password", databasePassword, null);
row = addField(form, row, "Redis host", redisHost, null);
row = addField(form, row, "Redis port", redisPort, null);
row = addField(form, row, "Redis password", redisPassword, null);
@@ -338,10 +304,10 @@ public class SwingInstallationWizard {
panel.add(form, BorderLayout.CENTER);
JButton back = secondaryButton("Back");
back.addActionListener(event -> cards.show(cardPanel, WELCOME));
JButton next = primaryButton("Next");
next.addActionListener(event -> cards.show(cardPanel, DEPLOYMENT));
panel.add(actions(back, next), BorderLayout.SOUTH);
back.addActionListener(event -> cards.show(cardPanel, DETAILS));
JButton install = primaryButton("Install");
install.addActionListener(event -> startInstallation());
panel.add(actions(back, install), BorderLayout.SOUTH);
return panel;
}
@@ -407,7 +373,7 @@ public class SwingInstallationWizard {
progressBar.setValue(0);
progressPercentage.setText("0%");
progressMessage.setText("Preparing installation");
cards.show(cardPanel, DEPLOYMENT);
cards.show(cardPanel, RUNTIME);
containerCloudServiceUrl.requestFocusInWindow();
});
@@ -449,8 +415,8 @@ public class SwingInstallationWizard {
button.setText("Check Docker and continue");
try {
get();
cards.show(cardPanel, DATABASE);
databaseHost.requestFocusInWindow();
cards.show(cardPanel, DETAILS);
clientCode.requestFocusInWindow();
} catch (Exception exception) {
showError(message(exception));
}
@@ -479,12 +445,7 @@ public class SwingInstallationWizard {
optionalValues(),
new RuntimeConfiguration(
containerCloudServiceUrl.getText(),
"jdbc:postgresql://"
+ databaseHost.getText().trim()
+ ":"
+ databasePort.getText().trim()
+ "/"
+ databaseName.getText().trim(),
databaseUrl.getText(),
databaseUsername.getText(),
new String(databaseSecret),
redisHost.getText(),
@@ -598,9 +559,7 @@ public class SwingInstallationWizard {
validateAbsoluteHttpUrl(
runtime.containerCloudServiceUrl(),
"Container cloud service URL");
if (databaseHost.getText().isBlank()
|| databasePort.getText().isBlank()
|| databaseName.getText().isBlank()
if (runtime.databaseUrl().isBlank()
|| runtime.databaseUsername().isBlank()
|| runtime.databasePassword().isBlank()) {
throw new IllegalArgumentException(
@@ -673,95 +632,6 @@ public class SwingInstallationWizard {
return row + 1;
}
private int addComponentField(
JPanel form,
int row,
String label,
Component input) {
GridBagConstraints labelConstraints = constraints(0, row);
labelConstraints.weightx = 0;
labelConstraints.fill = GridBagConstraints.NONE;
labelConstraints.anchor = GridBagConstraints.LINE_START;
JLabel fieldLabel = new JLabel(label);
fieldLabel.setFont(fieldLabel.getFont().deriveFont(Font.BOLD, 12f));
form.add(fieldLabel, labelConstraints);
GridBagConstraints inputConstraints = constraints(1, row);
inputConstraints.weightx = 1;
inputConstraints.fill = GridBagConstraints.HORIZONTAL;
form.add(input, inputConstraints);
return row + 1;
}
private JPanel formPanel() {
JPanel form = new JPanel(new GridBagLayout());
form.setBackground(PANEL);
form.setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createLineBorder(new Color(205, 217, 225)),
BorderFactory.createEmptyBorder(14, 16, 14, 16)));
return form;
}
private JPanel databaseConnectionFields() {
JPanel fields = inlineFieldsPanel();
addInlineField(fields, databaseHost, 0, 0.50);
addInlineSeparator(fields, ":", 1);
addInlineField(fields, databasePort, 2, 0.15);
addInlineSeparator(fields, "/", 3);
addInlineField(fields, databaseName, 4, 0.35);
databaseHost.setToolTipText("Database host");
databasePort.setToolTipText("Database port");
databaseName.setToolTipText("Database name");
return fields;
}
private JPanel credentialFields(JTextField username, JTextField password) {
JPanel fields = inlineFieldsPanel();
addInlineLabel(fields, "Username", 0);
addInlineField(fields, username, 1, 0.5);
addInlineLabel(fields, "Password", 2);
addInlineField(fields, password, 3, 0.5);
return fields;
}
private JPanel inlineFieldsPanel() {
JPanel fields = new JPanel(new GridBagLayout());
fields.setOpaque(false);
return fields;
}
private void addInlineField(
JPanel panel,
JTextField field,
int column,
double weight) {
GridBagConstraints constraints = new GridBagConstraints();
constraints.gridx = column;
constraints.weightx = weight;
constraints.fill = GridBagConstraints.HORIZONTAL;
constraints.insets = new Insets(0, column == 0 ? 0 : 5, 0, 0);
field.setPreferredSize(new Dimension(120, 29));
panel.add(field, constraints);
}
private void addInlineLabel(JPanel panel, String text, int column) {
GridBagConstraints constraints = new GridBagConstraints();
constraints.gridx = column;
constraints.weightx = 0;
constraints.insets = new Insets(0, column == 0 ? 0 : 12, 0, 5);
JLabel label = new JLabel(text);
label.setForeground(new Color(75, 88, 99));
panel.add(label, constraints);
}
private void addInlineSeparator(JPanel panel, String text, int column) {
GridBagConstraints constraints = new GridBagConstraints();
constraints.gridx = column;
constraints.weightx = 0;
constraints.insets = new Insets(0, 5, 0, 0);
panel.add(new JLabel(text), constraints);
}
private GridBagConstraints constraints(int column, int row) {
GridBagConstraints constraints = new GridBagConstraints();
constraints.gridx = column;
@@ -794,7 +664,6 @@ public class SwingInstallationWizard {
JLabel label = new JLabel(value);
label.setFont(label.getFont().deriveFont(Font.BOLD, 19f));
label.setForeground(new Color(35, 48, 58));
label.setAlignmentX(Component.LEFT_ALIGNMENT);
return label;
}
@@ -808,7 +677,6 @@ public class SwingInstallationWizard {
private JPanel summaryRow(String label, String value) {
JPanel row = new JPanel(new BorderLayout(18, 0));
row.setOpaque(false);
row.setAlignmentX(Component.LEFT_ALIGNMENT);
row.setBorder(BorderFactory.createEmptyBorder(7, 0, 7, 0));
JLabel name = new JLabel(label);
name.setPreferredSize(new Dimension(130, 20));
@@ -823,8 +691,7 @@ public class SwingInstallationWizard {
JPanel row = new JPanel(new BorderLayout(18, 0));
row.setOpaque(false);
row.setAlignmentX(Component.LEFT_ALIGNMENT);
row.setBorder(BorderFactory.createEmptyBorder(7, 0, 7, 0));
row.setMaximumSize(new Dimension(Integer.MAX_VALUE, 42));
row.setMaximumSize(new Dimension(Integer.MAX_VALUE, 34));
JLabel name = new JLabel(label);
name.setFont(name.getFont().deriveFont(Font.BOLD));
name.setPreferredSize(new Dimension(130, 28));

View File

@@ -23,7 +23,6 @@ public class TechnobeeServiceInstallerApplication implements CommandLineRunner {
}
public static void main(String[] args) {
disableAccidentalSpringDebug(args);
SpringApplication application =
new SpringApplication(TechnobeeServiceInstallerApplication.class);
application.setWebApplicationType(WebApplicationType.NONE);
@@ -40,18 +39,6 @@ public class TechnobeeServiceInstallerApplication implements CommandLineRunner {
}
}
static void disableAccidentalSpringDebug(String[] args) {
boolean debugRequested = Arrays.stream(args)
.anyMatch(argument -> "--debug".equals(argument)
|| "--debug=true".equalsIgnoreCase(argument));
if (!debugRequested && System.getProperty("debug") == null) {
// DEBUG is commonly exported by developer tools with non-boolean
// values. Spring maps it to its own debug switch unless a more
// specific system property is present.
System.setProperty("debug", "false");
}
}
@Override
public void run(String... args) {
boolean cli = Arrays.asList(args).contains("--cli");

View File

@@ -1,29 +0,0 @@
package com.cygnus.installer;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
class TechnobeeServiceInstallerApplicationTest {
@AfterEach
void clearDebugProperty() {
System.clearProperty("debug");
}
@Test
void disablesDebugUnlessExplicitlyRequested() {
TechnobeeServiceInstallerApplication.disableAccidentalSpringDebug(new String[0]);
assertThat(System.getProperty("debug")).isEqualTo("false");
}
@Test
void preservesExplicitDebugRequest() {
TechnobeeServiceInstallerApplication.disableAccidentalSpringDebug(
new String[] {"--debug"});
assertThat(System.getProperty("debug")).isNull();
}
}

View File

@@ -42,15 +42,6 @@ public enum ApplicationMessage {
"The application details were saved successfully.", ""),
APPLICATIONS_LOADED(200, "APP-2002", "Applications loaded",
"The application records were loaded successfully.", ""),
DEDUPE_CHECK_COMPLETED(200, "DDP-2001", "Dedupe check completed",
"The dedupe check completed successfully.", ""),
DEDUPE_CHECK_FAILED(500, "DDP-5001", "Dedupe check failed",
"Cygnus could not complete the dedupe check.",
"Try again. If the issue continues, contact support."),
DEDUPE_DETAILS_LOADED(200, "DDP-2002", "Dedupe details loaded",
"Matching records were loaded successfully.", ""),
DEDUPE_DETAILS_SAVED(200, "DDP-2003", "Dedupe details saved",
"Dedupe remarks were saved successfully.", ""),
APPLICATION_LOAD_FAILED(500, "APP-5002", "Applications could not be loaded",
"Cygnus could not load the application details.",
"Try again. If the issue continues, share the reference ID with support."),

View File

@@ -1,16 +0,0 @@
package lib.models;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
@Data
public class Allocation {
private List<CutOffRecord> allocationlist = new ArrayList<>();
private String allocTime;
private String errMsg;
private String errDesc;
private String errCode;
private String sessUUID;
private boolean processFlag;
}

View File

@@ -1,13 +0,0 @@
package lib.models;
import lombok.Data;
@Data
public class CaseGrid {
private String errMsg;
private String errDesc;
private String errCode;
private boolean processFlag;
private String portfolioId;
private String caseID;
}

View File

@@ -1,17 +0,0 @@
package lib.models;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
@Data
public class CutOffList {
private List<CutOffRecord> cofflist = new ArrayList<>();
private String cutoffTime;
private String batch;
private String errMsg;
private String errDesc;
private String errCode;
private String sessUUID;
private boolean processFlag;
}

View File

@@ -1,41 +0,0 @@
package lib.models;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
@Data
public class CutOffRecord {
private List<CutOffRecord> sublist = new ArrayList<>();
private String portfolioid;
private String portname;
private String customername;
private String apptype;
private String mvcode;
private String applno;
private boolean allocation;
private boolean sms;
private boolean telesheet;
private boolean earlier;
private boolean negative;
private int islocked;
private String lockedby;
private boolean docut;
private int ischanged;
private int totrv;
private int totov;
private int totpv;
private int totrtv;
private int tototv;
private int totref;
private boolean tv;
private boolean oprsend;
private String resiloc;
private String offloc;
private String proploc;
private String uuid;
private String repformat;
private String repfunction;
private String message;
private String portgroup;
}

View File

@@ -1,21 +0,0 @@
package lib.models;
import java.util.ArrayList;
import java.util.List;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
public class DedupeBatch {
private List<DedupeCase> cases = new ArrayList<>();
private String cutoffKey;
private String cutoffon;
private int totalAddresses;
private int totalCases;
private int islocked;
private String lockedby;
private Integer lockOwnerId;
}

View File

@@ -1,22 +0,0 @@
package lib.models;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
public class DedupeCase {
private String mvcode;
private String applno;
private String customername;
private String apptype;
private String uuid;
private int totrv;
private int totov;
private int totpv;
private String earlier;
private String negative;
private String lockedby;
}

View File

@@ -1,20 +0,0 @@
package lib.models;
import lombok.Getter;
import lombok.NoArgsConstructor;
@Getter
@NoArgsConstructor
public class DedupeCaseSummary {
private String documentCaseId;
private Integer portfolioId;
private String mvCode;
private String fileNumber;
private String customerName;
private String applicationType;
private int residenceVisits;
private int officeVisits;
private int propertyVisits;
private String receivedOn;
private String done;
}

View File

@@ -1,3 +0,0 @@
package lib.models;
public record DedupeCheckData(String documentCaseId, int operation) { }

View File

@@ -1,3 +0,0 @@
package lib.models;
public record DedupeCheckRequest(String documentCaseId, int operation) { }

View File

@@ -1,20 +0,0 @@
package lib.models;
import lombok.Data;
@Data
public class DedupeDetails {
private String sessuuid;
private String uuid;
private String mvcode;
private String customername;
private String dob;
private String mobile;
private String resiaddress;
private String offaddress;
private String resiphone;
private String offphone;
private String earremarks;
private String negremarks;
private String category;
}

View File

@@ -1,17 +0,0 @@
package lib.models;
import lombok.Data;
@Data
public class DedupeMatchRecord {
private String dedupeType;
private String foundOn;
private String remarks;
private String customerName;
private String dob;
private String residenceAddress;
private String officeAddress;
private String residencePhone;
private String officePhone;
private String mobile;
}

View File

@@ -1,17 +0,0 @@
package lib.models;
import java.util.ArrayList;
import java.util.List;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
public class DedupeRun {
private List<DedupeBatch> batches = new ArrayList<>();
private String dedcutTime;
private String errMsg;
private String csrfToken;
}

View File

@@ -1,21 +0,0 @@
package lib.models;
import lombok.Data;
@Data
public class DedupeSendCase {
private String uuid;
private String mvcode;
private String applno;
private String customername;
private String apptype;
private String product;
private String earlier;
private String negative;
private String deduperunon;
private String bkbranchname;
private String fid;
private int dqid;
private String portname;
private String supervisor;
}

View File

@@ -1,16 +0,0 @@
package lib.models;
import java.util.ArrayList;
import java.util.List;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
public class DedupeWorkspace {
private Integer portfolioId;
private List<Option> portfolios = new ArrayList<>();
private List<DedupeCaseSummary> cases = new ArrayList<>();
}

View File

@@ -1,12 +0,0 @@
package lib.models;
import lombok.Data;
@Data
public class PhotoCases {
private String errMsg;
private String errDesc;
private String errCode;
private String sessUUID;
private boolean processFlag;
}

View File

@@ -1,17 +0,0 @@
package lib.models;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
@Data
public class ReferenceSheet {
private List<CutOffRecord> tvrlist = new ArrayList<>();
private String teleSheetTime;
private String errMsg;
private String errDesc;
private String errCode;
private String sessUUID;
private boolean processFlag;
private String telePDFLink;
}

View File

@@ -1,17 +0,0 @@
package lib.models;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
@Data
public class SendDedupe {
private Integer portfolioid;
private String portname;
private String supervisor;
private int dqid;
private String fid;
private List<DedupeSendCase> caselist = new ArrayList<>();
private String suuid;
private String uuids;
}

View File

@@ -1,16 +0,0 @@
package lib.models;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
@Data
public class SendToOperation {
private List<CutOffRecord> caselist = new ArrayList<>();
private String sendTime;
private String errMsg;
private String errDesc;
private String errCode;
private String sessUUID;
private boolean processFlag;
}

View File

@@ -1,17 +0,0 @@
package lib.models;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
@Data
public class Telesheet {
private List<CutOffRecord> tvrlist = new ArrayList<>();
private String teleSheetTime;
private String errMsg;
private String errDesc;
private String errCode;
private String sessUUID;
private boolean processFlag;
private String telePDFLink;
}

View File

@@ -9,13 +9,12 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script language="javascript" src="/matrix/js/lib/constants.js" type="text/javascript"></script>
<script src="/matrix/js/lib/notifications.js?ver=1" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/jquery1.7.2.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/uifuncs.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/lib/jsfuncs.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/msgdialog.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/select.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/edp/cutoff/cutoff.js?v=1" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/appjs/cutoff.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/validator.js" type="text/javascript"></script>
<link href="/matrix/css/matrix.css" rel="stylesheet" type="text/css" />
@@ -28,7 +27,7 @@
<link href="/matrix/css/matrix-v2.css?v=6" rel="stylesheet" type="text/css" />
<link href="/matrix/css/matrix-shell-v2.css?v=7" rel="stylesheet" type="text/css" />
<link href="/matrix/css/tool-workspace-v3.css?v=2" rel="stylesheet" type="text/css" />
<link href="/matrix/css/cutoff-workflows-v1.css?v=4" rel="stylesheet" type="text/css" />
<link href="/matrix/css/cutoff-workflows-v1.css?v=1" rel="stylesheet" type="text/css" />
<script src="/matrix/js/bootstrap-5.3.8.bundle.min.js" defer></script>
<script src="/matrix/js/matrix-shell-v2.js" defer></script>
<link href="/matrix/css/matrix-frame-dialog.css?v=6" rel="stylesheet" type="text/css" />
@@ -42,14 +41,13 @@
<%-- Shared shell owns ${Sessvals.menuHtml}. --%>
<div id="formcontainer" class="matrix-tool-workspace__content" style="max-width:1200px">
<form:form method="post" name="allocation" id="allocation" modelAttribute="allocation" >
<c:if test="${not empty _csrf}"><input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}" /></c:if>
<!-- Common Details (Section1) Visible for all portfolios-->
<div>
<!-- Title -->
<div class="title">
<img class="matrix-title-icon" src="/matrix/images/alloc.png" align="absmiddle" />
<span class="matrix-title-text" align="absmiddle">Allocation</span>
<img class="matrix-title-action" src="/matrix/images/reload.png" title="Refresh Grid" onclick="return submitCutoffForm('allocation','allocation')"/>
<img class="matrix-title-action" src="/matrix/images/reload.png" title="Refresh Grid" onclick="SubmitForm('allocation','_parent','allocation')"/>
</div>
<!-- -->
<div id="TablePanel" class="tableContainer">
@@ -174,9 +172,8 @@
</table>
</div>
</div>
<div class="matrix-workflow-actions">
<input type="button" class="button" name="btnsave" value="Save" id="btnsave" accesskey="S" onclick="return ValidateSubmitAllocation('allocation');" />
</div>
<input type="button" class="button" name="btnsave" style="margin-top:5px;float:right" value="Save" id="btnsave" accesskey="S" onclick="return ValidateSubmitAllocation('allocation');" />
<form:hidden path="SessUUID" value="${allocation.getSessUUID()}"/>
</form:form>
<input type="hidden" id="invalidfields" value="0" />
<input type="hidden" id="selectedports" value="0" />
@@ -190,7 +187,7 @@
<!-- -->
<!-- Process Message -->
<c:if test="${not empty allocation.getErrMsg()}">
<script>CygnusNotifications.showLegacy('${allocation.getErrMsg()}');</script>
<script language="javascript" type="text/javascript"> CallMessage('${allocation.getErrMsg()}',5000,200,300); </script>
</c:if>
<!-- -->
</html>

View File

@@ -10,13 +10,12 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script language="javascript" src="/matrix/js/lib/constants.js" type="text/javascript"></script>
<script src="/matrix/js/lib/notifications.js?ver=1" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/jquery1.7.2.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/uifuncs.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/lib/jsfuncs.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/msgdialog.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/select.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/edp/cutoff/cutoff.js?v=1" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/appjs/cutoff.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/validator.js" type="text/javascript"></script>
<link href="/matrix/css/matrix.css" rel="stylesheet" type="text/css" />
@@ -29,7 +28,7 @@
<link href="/matrix/css/matrix-v2.css?v=6" rel="stylesheet" type="text/css" />
<link href="/matrix/css/matrix-shell-v2.css?v=7" rel="stylesheet" type="text/css" />
<link href="/matrix/css/tool-workspace-v3.css?v=2" rel="stylesheet" type="text/css" />
<link href="/matrix/css/cutoff-workflows-v1.css?v=3" rel="stylesheet" type="text/css" />
<link href="/matrix/css/cutoff-workflows-v1.css?v=1" rel="stylesheet" type="text/css" />
<script src="/matrix/js/bootstrap-5.3.8.bundle.min.js" defer></script>
<script src="/matrix/js/matrix-shell-v2.js" defer></script>
<link href="/matrix/css/matrix-frame-dialog.css?v=6" rel="stylesheet" type="text/css" />
@@ -43,23 +42,20 @@
<%-- Shared shell owns ${Sessvals.menuHtml}. --%>
<div id="formcontainer" class="matrix-tool-workspace__content" style="max-width:1100px">
<form:form method="post" name="cutOff" id="cutOff" modelAttribute="cutOff" >
<c:if test="${not empty _csrf}"><input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}" /></c:if>
<!-- Common Details (Section1) Visible for all portfolios-->
<div>
<!-- Title -->
<div class="title">
<img class="matrix-title-icon" src="/matrix/images/cutlist.png" align="absmiddle" />
<span class="matrix-title-text" align="absmiddle">Cut-Off List</span>
<div class="matrix-cutoff-title-actions">
<div class="divselect" id="divbatch">
<div class="divselect" id="divbatch" style="width:85px;position:absolute;top:3px;right:30px;">
<form:select path="Batch" multiple="false" id="batchlist" style="width:103px" onblur="validate(this,'t','');">
<form:option value="-1" label="BATCH" selected="true"/>
<form:option value="AM" label="AM" />
<form:option value="PM" label="PM" />
</form:select>
</div>
<img class="matrix-title-action" src="/matrix/images/reload.png" title="Refresh Grid" onclick="return submitCutoffForm('cutOff','cutoff')"/>
</div>
<img class="matrix-title-action" src="/matrix/images/reload.png" title="Refresh Grid" onclick="SubmitForm('cutoff','_parent','cutOff')"/>
</div>
<!-- -->
<div id="TablePanel" class="tableContainer">
@@ -118,10 +114,9 @@
</table>
</div>
</div>
<div class="matrix-workflow-actions">
<input type="button" class="button" name="btnsave" value="Save" id="btnsave" accesskey="S" onclick="return ValidateSubmitCutOff('cutOff');" />
</div>
<input type="button" class="button" name="btnsave" style="margin-top:5px;float:right" value="Save" id="btnsave" accesskey="S" onclick="return ValidateSubmitCutOff('cutOff');" />
<form:hidden path="CutoffTime" value="${cutOff.getCutoffTime()}"/>
<form:hidden path="SessUUID" value="${cutOff.getSessUUID()}"/>
</form:form>
<input type="hidden" id="invalidfields" value="0" />
<input type="hidden" id="selectedports" value="0" />
@@ -135,7 +130,7 @@
<!-- -->
<!-- Process Message -->
<c:if test="${not empty cutOff.getErrMsg()}">
<script>CygnusNotifications.showLegacy('${fn:escapeXml(cutOff.getErrMsg())}');</script>
<script language="javascript" type="text/javascript"> CallMessage('${cutOff.getErrMsg()}',3000,200,300); </script>
</c:if>
<!-- -->
<script>

View File

@@ -9,12 +9,11 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script language="javascript" src="/matrix/js/lib/constants.js" type="text/javascript"></script>
<script src="/matrix/js/lib/notifications.js?ver=1" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/jquery1.7.2.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/uifuncs.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/lib/jsfuncs.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/msgdialog.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/edp/cutoff/cutoff.js?v=1" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/appjs/cutoff.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/excel.js" type="text/javascript"></script>
<link href="/matrix/css/matrix.css" rel="stylesheet" type="text/css" />
@@ -41,7 +40,6 @@
<%-- Shared shell owns ${Sessvals.menuHtml}. --%>
<div id="formcontainer" class="matrix-tool-workspace__content">
<form:form method="post" name="pcases" id="pcases" modelAttribute="pcases" >
<c:if test="${not empty _csrf}"><input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}" /></c:if>
<div id="TablePanel" class="tableContainer">
<table border="0" cellspacing="0" width="100%" id="cutlist">
<thead class="thead">
@@ -113,9 +111,7 @@
</table>
</div>
<!-- <input type="button" class="button" name="btnsave" style="margin-top:5px;float:right" value="Upload & Update" id="btnsave" accesskey="S" onclick="return FinalizePhotoCase();" /> -->
<div class="matrix-workflow-actions">
<input type="button" class="button" name="btnsave" value="Upload & Update" id="btnsave" accesskey="S" onclick="return SendToMnimble();" />
</div>
<input type="button" class="button" name="btnsave" style="margin-top:5px;float:right" value="Upload & Update" id="btnsave" accesskey="S" onclick="return SendToMnimble();" />
<input type="hidden" value="${Sessvals.getUserID()}" id="usid"/>
</form:form>
</div>
@@ -128,7 +124,7 @@
<!-- -->
<!-- Process Message -->
<c:if test="${not empty msg}">
<script>CygnusNotifications.showLegacy('${msg}');</script>
<script language="javascript" type="text/javascript"> CallMessage('${msg}',3000,200,300); </script>
</c:if>
<!-- -->
</html>

View File

@@ -9,12 +9,11 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script language="javascript" src="/matrix/js/lib/constants.js" type="text/javascript"></script>
<script src="/matrix/js/lib/notifications.js?ver=1" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/jquery1.7.2.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/uifuncs.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/lib/jsfuncs.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/msgdialog.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/edp/cutoff/cutoff.js?v=1" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/appjs/cutoff.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/excel.js" type="text/javascript"></script>
<link href="/matrix/css/matrix.css" rel="stylesheet" type="text/css" />
@@ -41,7 +40,6 @@
<%-- Shared shell owns ${Sessvals.menuHtml}. --%>
<div id="formcontainer" class="matrix-tool-workspace__content">
<form:form method="post" name="pcases" id="pcases" modelAttribute="pcases" >
<c:if test="${not empty _csrf}"><input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}" /></c:if>
<div id="TablePanel" class="tableContainer">
<table border="0" cellspacing="0" width="100%" id="cutlist">
<thead class="thead">
@@ -102,10 +100,8 @@
</tbody>
</table>
</div>
<div class="matrix-workflow-actions">
<input type="button" class="button" name="btnsave" value="Save" id="btnsave" accesskey="S" onclick="return FinalizePhotoCase();" />
<input type="button" class="button" name="btnsave" value="Generate" id="btnexcel" accesskey="G" onclick="tableToExcel(document.getElementsByTagName('table'),'sheet1')" />
</div>
<input type="button" class="button" name="btnsave" style="margin-top:5px;float:right" value="Save" id="btnsave" accesskey="S" onclick="return FinalizePhotoCase();" />
<input type="button" class="button" name="btnsave" style="margin-top:5px;float:right" value="Generate" id="btnexcel" accesskey="G" onclick="tableToExcel(document.getElementsByTagName('table'),'sheet1')" />
<input type="hidden" value="${Sessvals.getUserID()}" id="usid"/>
</form:form>
</div>
@@ -118,7 +114,7 @@
<!-- -->
<!-- Process Message -->
<c:if test="${not empty msg}">
<script>CygnusNotifications.showLegacy('${msg}');</script>
<script language="javascript" type="text/javascript"> CallMessage('${msg}',3000,200,300); </script>
</c:if>
<!-- -->
</html>

View File

@@ -9,13 +9,13 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script language="javascript" src="/matrix/js/lib/constants.js" type="text/javascript"></script>
<script src="/matrix/js/lib/notifications.js?ver=1" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/jquery1.7.2.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/uifuncs.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/lib/jsfuncs.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/msgdialog.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/select.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/edp/cutoff/cutoff.js?v=1" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/appjs/allocation.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/appjs/cutoff.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/validator.js" type="text/javascript"></script>
<link href="/matrix/css/matrix.css" rel="stylesheet" type="text/css" />
@@ -28,7 +28,7 @@
<link href="/matrix/css/matrix-v2.css?v=6" rel="stylesheet" type="text/css" />
<link href="/matrix/css/matrix-shell-v2.css?v=7" rel="stylesheet" type="text/css" />
<link href="/matrix/css/tool-workspace-v3.css?v=2" rel="stylesheet" type="text/css" />
<link href="/matrix/css/cutoff-workflows-v1.css?v=4" rel="stylesheet" type="text/css" />
<link href="/matrix/css/cutoff-workflows-v1.css?v=1" rel="stylesheet" type="text/css" />
<script src="/matrix/js/bootstrap-5.3.8.bundle.min.js" defer></script>
<script src="/matrix/js/matrix-shell-v2.js" defer></script>
<link href="/matrix/css/matrix-frame-dialog.css?v=6" rel="stylesheet" type="text/css" />
@@ -42,14 +42,13 @@
<%-- Shared shell owns ${Sessvals.menuHtml}. --%>
<div id="formcontainer" class="matrix-tool-workspace__content" style="max-width:1200px">
<form:form method="post" name="refsheet" id="refsheet" modelAttribute="refsheet" >
<c:if test="${not empty _csrf}"><input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}" /></c:if>
<!-- Common Details (Section1) Visible for all portfolios-->
<div>
<!-- Title -->
<div class="title">
<img class="matrix-title-icon" src="/matrix/images/telesheet.png" align="absmiddle" />
<span class="matrix-title-text" align="absmiddle">Reference-Verification Sheet</span>
<img class="matrix-title-action" src="/matrix/images/reload.png" title="Refresh Grid" onclick="return submitCutoffForm('refsheet','refsheet')"/>
<img class="matrix-title-action" src="/matrix/images/reload.png" title="Refresh Grid" onclick="SubmitForm('refsheet','_parent','refsheet')"/>
</div>
<!-- -->
<div id="TablePanel" class="tableContainer">
@@ -163,9 +162,8 @@
</c:if>
<!-- -->
</div>
<div class="matrix-workflow-actions">
<input type="button" class="button" name="btnsave" value="Generate" id="btnsave" accesskey="S" onclick="return ValidateSubmitRefsheet('refsheet');" />
</div>
<input type="button" class="button" name="btnsave" style="margin-top:5px;float:right" value="Generate" id="btnsave" accesskey="S" onclick="return ValidateSubmitRefsheet('refsheet');" />
<form:hidden path="SessUUID" />
</form:form>
<input type="hidden" id="invalidfields" value="0" />
<input type="hidden" id="selectedports" value="0" />
@@ -179,7 +177,7 @@
<!-- -->
<!-- Process Message -->
<c:if test="${not empty refsheet.getErrMsg()}">
<script>CygnusNotifications.showLegacy('${refsheet.getErrMsg()}');</script>
<script language="javascript" type="text/javascript"> CallMessage('${telesheet.getErrMsg()}',3000,200,300); </script>
</c:if>
<!-- -->
</html>

View File

@@ -9,13 +9,12 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script language="javascript" src="/matrix/js/lib/constants.js" type="text/javascript"></script>
<script src="/matrix/js/lib/notifications.js?ver=1" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/jquery1.7.2.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/uifuncs.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/lib/jsfuncs.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/msgdialog.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/select.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/edp/cutoff/cutoff.js?v=1" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/appjs/cutoff.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/validator.js" type="text/javascript"></script>
<link href="/matrix/css/matrix.css" rel="stylesheet" type="text/css" />
@@ -28,7 +27,7 @@
<link href="/matrix/css/matrix-v2.css?v=6" rel="stylesheet" type="text/css" />
<link href="/matrix/css/matrix-shell-v2.css?v=7" rel="stylesheet" type="text/css" />
<link href="/matrix/css/tool-workspace-v3.css?v=2" rel="stylesheet" type="text/css" />
<link href="/matrix/css/cutoff-workflows-v1.css?v=4" rel="stylesheet" type="text/css" />
<link href="/matrix/css/cutoff-workflows-v1.css?v=1" rel="stylesheet" type="text/css" />
<script src="/matrix/js/bootstrap-5.3.8.bundle.min.js" defer></script>
<script src="/matrix/js/matrix-shell-v2.js" defer></script>
<link href="/matrix/css/matrix-frame-dialog.css?v=6" rel="stylesheet" type="text/css" />
@@ -42,14 +41,13 @@
<%-- Shared shell owns ${Sessvals.menuHtml}. --%>
<div id="formcontainer" class="matrix-tool-workspace__content" style="max-width:1200px">
<form:form method="post" name="sendtoopr" id="sendtoopr" modelAttribute="sendtoopr" >
<c:if test="${not empty _csrf}"><input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}" /></c:if>
<!-- Common Details (Section1) Visible for all portfolios-->
<div>
<!-- Title -->
<div class="title">
<img class="matrix-title-icon" src="/matrix/images/oprupd.png" align="absmiddle" />
<span class="matrix-title-text" align="absmiddle">Send To Operation</span>
<img class="matrix-title-action" src="/matrix/images/reload.png" title="Refresh Grid" onclick="return submitCutoffForm('sendtoopr','sendtoopr')"/>
<img class="matrix-title-action" src="/matrix/images/reload.png" title="Refresh Grid" onclick="SubmitForm('sendtoopr','_parent','sendtoopr')"/>
</div>
<!-- -->
<div id="TablePanel" class="tableContainer">
@@ -194,9 +192,8 @@
</table>
</div>
</div>
<div class="matrix-workflow-actions">
<input type="button" class="button" name="btnsave" value="Save" id="btnsave" accesskey="S" onclick="return ValidateSubmitSopr('sendtoopr');" />
</div>
<input type="button" class="button" name="btnsave" style="margin-top:5px;float:right" value="Save" id="btnsave" accesskey="S" onclick="return ValidateSubmitSopr('sendtoopr');" />
<form:hidden path="SessUUID" value="${sendtoopr.getSessUUID()}"/>
</form:form>
<input type="hidden" id="invalidfields" value="0" />
<input type="hidden" id="selectedports" value="0" />
@@ -210,7 +207,7 @@
<!-- -->
<!-- Process Message -->
<c:if test="${not empty sendtoopr.getErrMsg()}">
<script>CygnusNotifications.showLegacy('${sendtoopr.getErrMsg()}');</script>
<script language="javascript" type="text/javascript"> CallMessage('${sendtoopr.getErrMsg()}',5000,200,300); </script>
</c:if>
<!-- -->
</html>

View File

@@ -9,13 +9,13 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script language="javascript" src="/matrix/js/lib/constants.js" type="text/javascript"></script>
<script src="/matrix/js/lib/notifications.js?ver=1" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/jquery1.7.2.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/uifuncs.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/lib/jsfuncs.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/msgdialog.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/select.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/edp/cutoff/cutoff.js?v=1" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/appjs/allocation.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/appjs/cutoff.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/validator.js" type="text/javascript"></script>
<link href="/matrix/css/matrix.css" rel="stylesheet" type="text/css" />
@@ -28,7 +28,7 @@
<link href="/matrix/css/matrix-v2.css?v=6" rel="stylesheet" type="text/css" />
<link href="/matrix/css/matrix-shell-v2.css?v=7" rel="stylesheet" type="text/css" />
<link href="/matrix/css/tool-workspace-v3.css?v=2" rel="stylesheet" type="text/css" />
<link href="/matrix/css/cutoff-workflows-v1.css?v=4" rel="stylesheet" type="text/css" />
<link href="/matrix/css/cutoff-workflows-v1.css?v=1" rel="stylesheet" type="text/css" />
<script src="/matrix/js/bootstrap-5.3.8.bundle.min.js" defer></script>
<script src="/matrix/js/matrix-shell-v2.js" defer></script>
<link href="/matrix/css/matrix-frame-dialog.css?v=6" rel="stylesheet" type="text/css" />
@@ -42,14 +42,13 @@
<%-- Shared shell owns ${Sessvals.menuHtml}. --%>
<div id="formcontainer" class="matrix-tool-workspace__content" style="max-width:1200px">
<form:form method="post" name="telesheet" id="telesheet" modelAttribute="telesheet" >
<c:if test="${not empty _csrf}"><input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}" /></c:if>
<!-- Common Details (Section1) Visible for all portfolios-->
<div>
<!-- Title -->
<div class="title">
<img class="matrix-title-icon" src="/matrix/images/telesheet.png" align="absmiddle" />
<span class="matrix-title-text" align="absmiddle">Tele-Verification Sheet</span>
<img class="matrix-title-action" src="/matrix/images/reload.png" title="Refresh Grid" onclick="return submitCutoffForm('telesheet','telesheet')"/>
<img class="matrix-title-action" src="/matrix/images/reload.png" title="Refresh Grid" onclick="SubmitForm('telesheet','_parent','telesheet')"/>
</div>
<!-- -->
<div id="TablePanel" class="tableContainer">
@@ -179,9 +178,8 @@
</c:if>
<!-- -->
</div>
<div class="matrix-workflow-actions">
<input type="button" class="button" name="btnsave" value="Generate" id="btnsave" accesskey="S" onclick="return ValidateSubmitTelesheet('telesheet');" />
</div>
<input type="button" class="button" name="btnsave" style="margin-top:5px;float:right" value="Generate" id="btnsave" accesskey="S" onclick="return ValidateSubmitTelesheet('telesheet');" />
<form:hidden path="SessUUID" />
</form:form>
<input type="hidden" id="invalidfields" value="0" />
<input type="hidden" id="selectedports" value="0" />
@@ -195,7 +193,7 @@
<!-- -->
<!-- Process Message -->
<c:if test="${not empty telesheet.getErrMsg()}">
<script>CygnusNotifications.showLegacy('${telesheet.getErrMsg()}');</script>
<script language="javascript" type="text/javascript"> CallMessage('${telesheet.getErrMsg()}',3000,200,300); </script>
</c:if>
<!-- -->
</html>

View File

@@ -1,85 +1,112 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" session="true" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@page language="java" session="true" %>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Cygnus 1.0 | Dedupe</title>
<link href="/matrix/css/bootstrap-5.3.8.min.css" rel="stylesheet">
<link href="/matrix/css/matrix-v2.css?v=6" rel="stylesheet">
<link href="/matrix/css/matrix-shell-v2.css?v=7" rel="stylesheet">
<link href="/matrix/css/tool-workspace-v3.css?v=2" rel="stylesheet">
<link href="/matrix/css/dedupe-workflows-v1.css?v=3" rel="stylesheet">
<link href="/matrix/css/matrix-frame-dialog.css?v=6" rel="stylesheet">
<link href="/matrix/css/matrix-theme-v2.css?v=4" rel="stylesheet">
<script src="/matrix/js/bootstrap-5.3.8.bundle.min.js" defer></script>
<script src="/matrix/js/matrix-shell-v2.js" defer></script>
<script src="/matrix/js/matrix-frame-dialog.js?v=2" defer></script>
<script src="/matrix/js/matrix-accessibility-v1.js?v=1" defer></script>
<script src="/matrix/js/edp/dedupe/dedupe-do.js?v=2" defer></script>
</head>
<body class="matrix-v2 matrix-shell matrix-tool-workspace matrix-dedupe-workflow"
data-context-path="${pageContext.request.contextPath}">
<div id="PageFrame">
<%@ include file="/WEB-INF/app/fragments/app-shell-header.jspf" %>
<main class="matrix-tool-workspace__content">
<form:form method="post" action="${pageContext.request.contextPath}/ver/dedupecaselist"
id="dedupeWorkspace" modelAttribute="dedupeWorkspace">
<section class="matrix-dedupe-worklist">
<header class="title matrix-dedupe-worklist__header">
<span class="matrix-dedupe-worklist__heading">
<img class="matrix-title-icon" src="/matrix/images/commondet.png" alt="">
<span class="matrix-title-text">Dedupe Cases</span>
</span>
<span class="matrix-dedupe-worklist__actions">
<form:select path="portfolioId" id="portfolioId"
cssClass="form-select form-select-sm matrix-dedupe-worklist__portfolio"
aria-label="Portfolio">
<form:option value="-1" label="SELECT PORTFOLIO" />
<c:forEach items="${dedupeWorkspace.portfolios}" var="portfolio">
<form:option value="${portfolio.value}" label="${portfolio.label}" />
</c:forEach>
</form:select>
<button type="submit" class="matrix-dedupe-worklist__refresh"
title="Refresh cases" aria-label="Refresh cases">
<img src="/matrix/images/reload.png" alt="">
</button>
</span>
</header>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script language="javascript" src="/matrix/js/lib/constants.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/jquery1.7.2.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/uifuncs.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/lib/jsfuncs.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/msgdialog.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/select.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/appjs/dedupedo.js" type="text/javascript"></script>
<div class="table-responsive matrix-dedupe-worklist__table-wrap">
<table class="table table-sm align-middle mb-0" id="dedupeCaseTable">
<thead>
<tr>
<th>S.No</th><th>MV Code</th><th>File No.</th><th>Customer Name</th>
<th>Type</th><th class="text-center">RV</th><th class="text-center">OV</th>
<th class="text-center">PV</th><th>Received On</th><th>Done</th>
</tr>
</thead>
<tbody>
<c:forEach items="${dedupeWorkspace.cases}" var="caseItem" varStatus="status">
<tr class="matrix-dedupe-worklist__row" tabindex="0"
data-case-id="${caseItem.documentCaseId}"
title="Open dedupe details">
<td>${status.count}</td><td>${caseItem.mvCode}</td>
<td>${caseItem.fileNumber}</td><td>${caseItem.customerName}</td>
<td>${caseItem.applicationType}</td>
<td class="text-center">${caseItem.residenceVisits}</td>
<td class="text-center">${caseItem.officeVisits}</td>
<td class="text-center">${caseItem.propertyVisits}</td>
<td>${caseItem.receivedOn}</td><td>${caseItem.done}</td>
</tr>
</c:forEach>
<c:if test="${dedupeWorkspace.portfolioId gt 0 and empty dedupeWorkspace.cases}">
<tr><td colspan="10" class="matrix-dedupe-worklist__empty">No cases found.</td></tr>
</c:if>
</tbody>
</table>
</div>
</section>
</form:form>
</main>
<link href="/matrix/css/div.css" rel="stylesheet" type="text/css" />
<link href="/matrix/css/select.css" rel="stylesheet" type="text/css" />
<link href="/matrix/css/table.css" rel="stylesheet" type="text/css" />
<title>Cygnus 1.0 | Dedupe Do</title>
<link href="/matrix/css/bootstrap-5.3.8.min.css" rel="stylesheet" type="text/css" />
<link href="/matrix/css/matrix-v2.css?v=6" rel="stylesheet" type="text/css" />
<link href="/matrix/css/matrix-shell-v2.css?v=7" rel="stylesheet" type="text/css" />
<link href="/matrix/css/tool-workspace-v3.css?v=2" rel="stylesheet" type="text/css" />
<link href="/matrix/css/dedupe-workflows-v1.css?v=1" rel="stylesheet" type="text/css" />
<script src="/matrix/js/bootstrap-5.3.8.bundle.min.js" defer></script>
<script src="/matrix/js/matrix-shell-v2.js" defer></script>
<link href="/matrix/css/matrix-frame-dialog.css?v=6" rel="stylesheet" type="text/css" />
<script src="/matrix/js/matrix-frame-dialog.js?v=2" defer></script>
<script src="/matrix/js/matrix-accessibility-v1.js?v=1" defer></script>
<link href="/matrix/css/matrix-theme-v2.css?v=4" rel="stylesheet" type="text/css" />
</head>
<body class="matrix-v2 matrix-shell matrix-tool-workspace matrix-dedupe-workflow">
<div id='PageFrame'>
<%@ include file="/WEB-INF/app/fragments/app-shell-header.jspf" %>
<%-- Shared shell owns ${Sessvals.menuHtml}. --%>
<div id="formcontainer" class="matrix-tool-workspace__content">
<form:form method="post" name="caseGrid" id="caseGrid" modelAttribute="caseGrid" >
<!-- Common Details (Section1) Visible for all portfolios-->
<div>
<!-- Title -->
<div class="title">
<img class="matrix-title-icon" src="/matrix/images/commondet.png" align="absmiddle" />
<span class="matrix-title-text" align="absmiddle">List of Cases</span>
<div class="divselect" id="divportfolio" style="width:167px;position:absolute;top:3px;right:30px;">
<form:select path="PortfolioId" multiple="false" id="portlist" style="width:185px" onchange="SubmitForm('dedupecaselist','_parent','caseGrid')">
<form:option value="-1" label="SELECT PORTFOLIO" selected="true"/>
<c:forEach items="${portlist}" var="port">
<form:option value="${port[0]}" label="${port[1]}" />
</c:forEach>
</form:select>
</div>
<img class="matrix-title-action" src="/matrix/images/reload.png" title="Refresh Grid" onclick="SubmitForm('dedupecaselist','_parent','caseGrid')"/>
</div>
<!-- -->
<div id="TablePanel" class="tableContainer">
<table border="0" cellspacing="0" width="100%" id="casetable">
<thead class="thead">
<tr title="Row Title">
<td>S.No</td>
<td>MV Code</td>
<td>File No.</td>
<td>Customer Name</td>
<td>Type</td>
<td>RV</td>
<td>OV</td>
<td>PV</td>
<td>Received Date</td>
<td>Done</td>
<td></td>
</tr>
</thead>
<tbody class="scrollContent">
<c:forEach items="${caseList}" var="casedet" varStatus="status">
<tr id="row${status.count}">
<td>
<input type="hidden" name="uuid" id="row${status.count}uuid" value="${casedet[0]}" />
<input type="hidden" name="portid" id="row${status.count}portid" value="${casedet[1]}" />
${status.count}</td>
<td>${casedet[2]}</td>
<td>${casedet[3]}</td>
<td>${casedet[4]}</td>
<td>${casedet[5]}</td>
<td>${casedet[6]}</td>
<td>${casedet[7]}</td>
<td>${casedet[8]}</td>
<td>${casedet[9]}</td>
<td>${casedet[10]}</td>
<td id="row${status.count}col"></td>
</tr>
</c:forEach>
</tbody>
</table>
</div>
</div>
</form:form>
</div>
</body>
<!-- Page Load Javascript -->
<script language="javascript" type="text/javascript">
InitPage();
</script>
<!-- -->
<!-- Process Message -->
<c:if test="${not empty caseGrid.getErrMsg()}">
<script language="javascript" type="text/javascript"> CallMessage('${caseGrid.getErrMsg()}',3000,200,300); </script>
</c:if>
<!-- -->
</html>

View File

@@ -12,9 +12,10 @@
<script language="javascript" src="/matrix/js/jquery1.7.2.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/uifuncs.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/lib/jsfuncs.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/msgdialog.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/progressbar.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/select.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/lib/notifications.js?ver=1" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/edp/dedupe/dedupe-run.js?ver=1" type="text/javascript" defer></script>
<script language="javascript" src="/matrix/js/appjs/deduperun.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/validator.js" type="text/javascript"></script>
<link href="/matrix/css/matrix.css" rel="stylesheet" type="text/css" />
@@ -27,7 +28,7 @@
<link href="/matrix/css/matrix-v2.css?v=6" rel="stylesheet" type="text/css" />
<link href="/matrix/css/matrix-shell-v2.css?v=7" rel="stylesheet" type="text/css" />
<link href="/matrix/css/tool-workspace-v3.css?v=2" rel="stylesheet" type="text/css" />
<link href="/matrix/css/dedupe-workflows-v1.css?v=8" rel="stylesheet" type="text/css" />
<link href="/matrix/css/dedupe-workflows-v1.css?v=1" rel="stylesheet" type="text/css" />
<script src="/matrix/js/bootstrap-5.3.8.bundle.min.js" defer></script>
<script src="/matrix/js/matrix-shell-v2.js" defer></script>
<link href="/matrix/css/matrix-frame-dialog.css?v=6" rel="stylesheet" type="text/css" />
@@ -38,16 +39,16 @@
<body class="matrix-v2 matrix-shell matrix-tool-workspace matrix-dedupe-workflow">
<div id='PageFrame'>
<%@ include file="/WEB-INF/app/fragments/app-shell-header.jspf" %>
<%-- Shared shell owns the authenticated user menu. --%>
<%-- Shared shell owns ${Sessvals.menuHtml}. --%>
<div id="formcontainer" class="matrix-tool-workspace__content" style="max-width:1200px">
<form:form method="post" name="deduperun" id="deduperun" modelAttribute="dedupeRun" >
<input type="hidden" id="dedupe-csrf-token" value="${dedupeRun.csrfToken}" />
<input type="hidden" name="curu" id="curu" value="${Sessvals.getUserID()}" />
<div>
<!-- Title -->
<div class="title matrix-dedupe-run__title">
<img class="matrix-title-icon" src="/matrix/images/dedupe.png" alt="" />
<span class="matrix-title-text">Dedupe Run</span>
<img class="matrix-title-action" src="/matrix/images/reload.png" alt="" title="Refresh Grid" onclick="SubmitForm('rundedupe','_parent','deduperun')"/>
<div class="title">
<img class="matrix-title-icon" src="/matrix/images/dedupe.png" align="absmiddle" />
<span class="matrix-title-text" align="absmiddle">Dedupe Run</span>
<img class="matrix-title-action" src="/matrix/images/reload.png" title="Refresh Grid" onclick="SubmitForm('rundedupe','_parent','deduperun')"/>
</div>
<!-- -->
<div id="TablePanel" class="tableContainer">
@@ -62,28 +63,28 @@
</tr>
</thead>
<tbody class="scrollContent">
<c:forEach items="${dedupeRun.batches}" var="record" varStatus="mystatus">
<c:forEach items="${dedupeRun.dedupelist}" var="record" varStatus="mystatus">
<tr title="${record.lockedby}">
<td>${mystatus.count}</td>
<td id="parent${mystatus.count}" onclick="ExpandList(this.id)" >
<form:hidden path="batches[${mystatus.index}].lockedby" id="locby${mystatus.count}"/>
<form:hidden path="batches[${mystatus.index}].cutoffon" id="cuttime${mystatus.count}"/>
<form:hidden path="dedupelist[${mystatus.index}].lockedby" id="locby${mystatus.count}" value="${status.value}"/>
<form:hidden path="dedupelist[${mystatus.index}].cutoffon" id="cuttime${mystatus.count}" value="${status.value}"/>
<span class="customLink" style="cursor:pointer">${record.cutoffon}</span>
</td>
<td align="center">
<form:hidden path="batches[${mystatus.index}].totalAddresses" id="totaddr${mystatus.count}"/>${record.totalAddresses}
<form:hidden path="dedupelist[${mystatus.index}].totaddr" id="totaddr${mystatus.count}" value="${status.value}"/>${record.totaddr}
</td>
<td align="center">
<form:hidden path="batches[${mystatus.index}].totalCases" id="totcase${mystatus.count}"/>${record.totalCases}
<form:hidden path="dedupelist[${mystatus.index}].totcase" id="totcase${mystatus.count}" value="${status.value}"/>${record.totcase}
</td>
<td align="center">
<form:hidden path="batches[${mystatus.index}].islocked" id="locked${mystatus.count}"/>
<form:hidden path="dedupelist[${mystatus.index}].islocked" id="locked${mystatus.count}" value="${status.value}" />
<c:choose>
<c:when test="${record.islocked gt 0}">
<img src="/matrix/images/locked.png"/>
</c:when>
<c:otherwise>
<button type="button" class="btn btn-primary btn-sm js-run-dedupe" data-table="cutlist${mystatus.count}">Run Earlier &amp; Negative</button>
<input type="button" id="btndedupe" class="button" value="Run Earlier & Negative" onclick="showDedupePanel('cutlist${mystatus.count}')" />
</c:otherwise>
</c:choose>
</td>
@@ -111,39 +112,38 @@
</tr>
</thead>
<tbody class="scrollContent">
<c:forEach items="${record.cases}" var="record1" varStatus="mystatus1">
<tr title="${record1.lockedby}child" id="row${mystatus1.count}${mystatus.count}"
data-document-case-id="${record1.uuid}" data-earlier="${record1.earlier}" data-negative="${record1.negative}">
<c:forEach items="${record.sublist}" var="record1" varStatus="mystatus1">
<tr title="${record1.lockedby}child" id="row${mystatus1.count}${mystatus.count}">
<td>${mystatus1.count}</td>
<td>
<form:hidden path="batches[${mystatus.index}].cases[${mystatus1.index}].lockedby" id="locby${mystatus1.count}child"/>
<form:hidden path="batches[${mystatus.index}].cases[${mystatus1.index}].mvcode" id="mvcode${mystatus1.count}child"/>
<form:hidden path="batches[${mystatus.index}].cases[${mystatus1.index}].uuid" id="uuid${mystatus1.count}${mystatus.count}"/>
<form:hidden path="dedupelist[${mystatus.index}].sublist[${mystatus1.index}].lockedby" id="locby${mystatus1.count}child" value="${status.value}"/>
<form:hidden path="dedupelist[${mystatus.index}].sublist[${mystatus1.index}].mvcode" id="mvcode${mystatus1.count}child" value="${status.value}"/>
<form:hidden path="dedupelist[${mystatus.index}].sublist[${mystatus1.index}].uuid" id="uuid${mystatus1.count}${mystatus.count}" value="${status.value}"/>
<span>${record1.mvcode}</span>
</td>
<td>
<form:hidden path="batches[${mystatus.index}].cases[${mystatus1.index}].applno" id="applno${mystatus1.count}child"/>${record1.applno}
<form:hidden path="dedupelist[${mystatus.index}].sublist[${mystatus1.index}].applno" id="applno${mystatus1.count}child" value="${status.value}"/>${record1.applno}
</td>
<td>
<form:hidden path="batches[${mystatus.index}].cases[${mystatus1.index}].customername" id="cname${mystatus1.count}child"/>${record1.customername}
<form:hidden path="dedupelist[${mystatus.index}].sublist[${mystatus1.index}].customername" id="cname${mystatus1.count}child" value="${status.value}"/>${record1.customername}
</td>
<td>
<form:hidden path="batches[${mystatus.index}].cases[${mystatus1.index}].apptype" id="ctype${mystatus1.count}child"/>${record1.apptype}
<form:hidden path="dedupelist[${mystatus.index}].sublist[${mystatus1.index}].apptype" id="ctype${mystatus1.count}child" value="${status.value}"/>${record1.apptype}
</td>
<td>
<form:hidden path="batches[${mystatus.index}].cases[${mystatus1.index}].totrv" id="totrv${mystatus1.count}child"/>${record1.totrv}
<form:hidden path="dedupelist[${mystatus.index}].sublist[${mystatus1.index}].totrv" id="totrv${mystatus1.count}child" value="${status.value}"/>${record1.totrv}
</td>
<td>
<form:hidden path="batches[${mystatus.index}].cases[${mystatus1.index}].totov" id="totov${mystatus1.count}child"/>${record1.totov}
<form:hidden path="dedupelist[${mystatus.index}].sublist[${mystatus1.index}].totov" id="totov${mystatus1.count}child" value="${status.value}"/>${record1.totov}
</td>
<td>
<form:hidden path="batches[${mystatus.index}].cases[${mystatus1.index}].totpv" id="totpv${mystatus1.count}child"/>${record1.totpv}
<form:hidden path="dedupelist[${mystatus.index}].sublist[${mystatus1.index}].totpv" id="totpv${mystatus1.count}child" value="${status.value}"/>${record1.totpv}
</td>
<td id="td${mystatus1.count}${mystatus.count}ear">
<form:hidden path="batches[${mystatus.index}].cases[${mystatus1.index}].earlier" id="row${mystatus1.count}${mystatus.count}ear"/><span id="sp${mystatus1.count}${mystatus.count}ear">${record1.earlier}</span>
<form:hidden path="dedupelist[${mystatus.index}].sublist[${mystatus1.index}].earlier" id="row${mystatus1.count}${mystatus.count}ear" value="${status.value}"/><span id="sp${mystatus1.count}${mystatus.count}ear">${record1.earlier}</span>
</td>
<td id="td${mystatus1.count}${mystatus.count}neg">
<form:hidden path="batches[${mystatus.index}].cases[${mystatus1.index}].negative" id="row${mystatus1.count}${mystatus.count}neg"/><span id="sp${mystatus1.count}${mystatus.count}neg">${record1.negative}</span>
<form:hidden path="dedupelist[${mystatus.index}].sublist[${mystatus1.index}].negative" id="row${mystatus1.count}${mystatus.count}neg" value="${status.value}"/><span id="sp${mystatus1.count}${mystatus.count}neg">${record1.negative}</span>
</td>
</tr>
</c:forEach>
@@ -158,10 +158,20 @@
</table>
</div>
</div>
<form:hidden path="SessUUID" value="${dedupeRun.getSessUUID()}"/>
</form:form>
<input type="hidden" id="invalidfields" value="0" />
<input type="hidden" id="selectedports" value="0" />
</div>
</div>
</body>
<!-- Page Load Javascript -->
<script language="javascript" type="text/javascript">
</script>
<!-- -->
<!-- Process Message -->
<c:if test="${not empty dedupeRun.getErrMsg()}">
<script language="javascript" type="text/javascript"> CallMessage('${dedupeRun.getErrMsg()}',5000,200,300); </script>
</c:if>
<!-- -->
</html>

View File

@@ -8,7 +8,12 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script language="javascript" src="/matrix/js/lib/constants.js" type="text/javascript"></script>
<script src="/matrix/js/lib/notifications.js?ver=1" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/jquery1.7.2.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/uifuncs.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/lib/jsfuncs.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/msgdialog.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/appjs/dedupedo.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/select.js" type="text/javascript"></script>
<link href="/matrix/css/button.css" rel="stylesheet" type="text/css" />
<link href="/matrix/css/div.css" rel="stylesheet" type="text/css" />
@@ -20,13 +25,12 @@
<link href="/matrix/css/matrix-v2.css?v=6" rel="stylesheet" type="text/css" />
<link href="/matrix/css/matrix-shell-v2.css?v=7" rel="stylesheet" type="text/css" />
<link href="/matrix/css/tool-workspace-v3.css?v=2" rel="stylesheet" type="text/css" />
<link href="/matrix/css/dedupe-workflows-v1.css?v=3" rel="stylesheet" type="text/css" />
<link href="/matrix/css/dedupe-workflows-v1.css?v=1" rel="stylesheet" type="text/css" />
<script src="/matrix/js/bootstrap-5.3.8.bundle.min.js" defer></script>
<script src="/matrix/js/matrix-shell-v2.js" defer></script>
<link href="/matrix/css/matrix-frame-dialog.css?v=6" rel="stylesheet" type="text/css" />
<script src="/matrix/js/matrix-frame-dialog.js?v=2" defer></script>
<script src="/matrix/js/matrix-accessibility-v1.js?v=1" defer></script>
<script src="/matrix/js/edp/dedupe/dedupe-send.js?v=1" defer></script>
<link href="/matrix/css/matrix-theme-v2.css?v=4" rel="stylesheet" type="text/css" />
</head>
<body class="matrix-v2 matrix-shell matrix-tool-workspace matrix-dedupe-workflow">
@@ -34,9 +38,7 @@
<%@ include file="/WEB-INF/app/fragments/app-shell-header.jspf" %>
<%-- Shared shell owns ${Sessvals.menuHtml}. --%>
<div id="formcontainer" class="matrix-tool-workspace__content">
<form:form method="post" name="senddedupe" id="senddedupe" modelAttribute="senddedupe"
data-list-url="${pageContext.request.contextPath}/ver/dedupetosend"
data-generate-url="${pageContext.request.contextPath}/ver/senddedreports">
<form:form method="post" name="senddedupe" id="senddedupe" modelAttribute="senddedupe" >
<!-- Common Details (Section1) Visible for all portfolios-->
<div>
<!-- Title -->
@@ -44,13 +46,14 @@
<img class="matrix-title-icon" src="/matrix/images/commondet.png" align="absmiddle" />
<span class="matrix-title-text" align="absmiddle">List of Cases</span>
<div class="divselect" id="divportfolio" style="width:167px;position:absolute;top:3px;right:30px;">
<form:select path="portfolioid" multiple="false" id="portlist" style="width:185px">
<form:select path="portfolioid" multiple="false" id="portlist" style="width:185px" onchange="SubmitForm('dedupetosend','_parent','senddedupe')">
<form:option value="-1" label="SELECT PORTFOLIO" selected="true"/>
<c:forEach items="${portlist}" var="port">
<form:option value="${port.value}" label="${port.label}" />
<form:option value="${port[0]}" label="${port[1]}" />
</c:forEach>
</form:select>
</div>
<img class="matrix-title-action" src="/matrix/images/reload.png" title="Refresh Grid" onclick="SubmitForm('senddedupe','_parent','senddedupe')"/>
</div>
<!-- -->
<div id="TablePanel" class="tableContainer">
@@ -72,28 +75,26 @@
</thead>
<tbody class="scrollContent">
<c:forEach items="${senddedupe.caselist}" var="casedet" varStatus="status">
<tr id="row${status.count}" data-case-id="${casedet.uuid}">
<tr id="row${status.count}">
<td>
<input type="hidden" name="uuid" id="row${status.count}uuid" value="${casedet.uuid}" />
<input type="hidden" name="uuid" id="row${status.count}uuid" value="${casedet[0]}" />
${status.count}</td>
<td>${casedet.mvcode}</td>
<td>${casedet.applno}</td>
<td>${casedet.customername}</td>
<td>${casedet.apptype}</td>
<td>${casedet.product}</td>
<td>${casedet.earlier}</td>
<td>${casedet.negative}</td>
<td>${casedet.deduperunon}</td>
<td>${casedet.bkbranchname}</td>
<td align="center"><input type="checkbox" value="${casedet.uuid}" checked /></td>
<td>${casedet[1]}</td>
<td>${casedet[2]}</td>
<td>${casedet[3]}</td>
<td>${casedet[4]}</td>
<td>${casedet[5]}</td>
<td>${casedet[6]}</td>
<td>${casedet[7]}</td>
<td>${casedet[8]}</td>
<td>${casedet[9]}</td>
<td align="center"><input type="checkbox" name="chkrow${status.count}" id="chkrow${status.count}" checked onclick="checkList('chkrow','selall')" /></td>
</tr>
</c:forEach>
</tbody>
</table>
</div>
<div class="matrix-workflow-actions">
<button type="button" class="button" name="btngenreport" id="btngenreport" accesskey="G">Generate Report</button>
</div>
<input type="button" class="button" name="btngenreport" style="float:right;margin-top:10px" value="Generate Report" id="btngenreport" accesskey="G" onclick="return ValidateSendDedupe('senddedupe');" />
</div>
<form:hidden path="uuids" id="hfdelstat" />
<form:hidden path="suuid" />
@@ -102,9 +103,15 @@
</form:form>
</div>
</body>
<!-- Page Load Javascript -->
<script language="javascript" type="text/javascript">
InitSendDedupe();
</script>
<!-- -->
<!-- Process Message -->
<c:if test="${not empty msg}">
<script>CygnusNotifications.show({type:"success", message:"${msg}"});</script>
<script language="javascript" type="text/javascript">contentType="html"; CallMessage('${msg}',3000,200,300); </script>
</c:if>
<!-- -->
</html>

View File

@@ -9,7 +9,12 @@
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Cygnus 1.0 | Dedupe Viewer</title>
<script language="javascript" src="/matrix/js/lib/constants.js" type="text/javascript"></script>
<script src="/matrix/js/lib/notifications.js?ver=1" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/jquery1.7.2.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/uifuncs.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/lib/jsfuncs.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/msgdialog.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/appjs/dedupedo.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/validator.js" type="text/javascript"></script>
<link href="/matrix/css/button.css" rel="stylesheet" type="text/css" />
@@ -19,22 +24,23 @@
<link href="/matrix/css/bootstrap-5.3.8.min.css" rel="stylesheet" type="text/css" />
<link href="/matrix/css/matrix-v2.css?v=6" rel="stylesheet" type="text/css" />
<link href="/matrix/css/tool-workspace-v3.css?v=2" rel="stylesheet" type="text/css" />
<link href="/matrix/css/dedupe-workflows-v1.css?v=6" rel="stylesheet" type="text/css" />
<link href="/matrix/css/dedupe-workflows-v1.css?v=1" rel="stylesheet" type="text/css" />
<script src="/matrix/js/matrix-dialog-child.js" type="text/javascript"></script>
<link href="/matrix/css/select.css" rel="stylesheet" type="text/css" />
<script src="/matrix/js/matrix-dialog-child.js" type="text/javascript"></script>
<script src="/matrix/js/matrix-accessibility-v1.js?v=1" defer></script>
<script src="/matrix/js/edp/dedupe/dedupe-match.js?v=1" defer></script>
<link href="/matrix/css/matrix-theme-v2.css?v=4" rel="stylesheet" type="text/css" />
</head>
<body class="matrix-shell matrix-v2 matrix-tool-workspace matrix-dedupe-workflow matrix-dedupe-match">
<div id='PageFrame'>
<!-- Title Bar -->
<%@ include file="/WEB-INF/app/fragments/app-title.jspf" %>
<!-- -->
<div id="formcontainer" class="matrix-tool-workspace__content">
<form:form method="post" action="${pageContext.request.contextPath}/ver/updatededupe"
name="dedupeDetails" id="dedupeDetails" modelAttribute="dedupeDetails"
data-records-url="${pageContext.request.contextPath}/ver/deduperecords">
<form:form method="post" name="dedupeDetails" id="dedupeDetails" modelAttribute="dedupeDetails" >
<!-- Parent Record Details -->
<div class="matrix-dedupe-match__source">
<div>
<form:hidden path="customername"/>
<form:hidden path="dob" id="cdob"/>
<form:hidden path="mobile" id="mob"/>
@@ -44,8 +50,8 @@
<form:hidden path="offaddress" id="oaddress"/>
<!-- Title -->
<div class="title">
<img class="matrix-title-icon" src="/matrix/images/page.png" alt="" />
<span class="matrix-title-text fw-bold">Source Record (MV Code - ${dedupeDetails.mvcode})&nbsp;&nbsp;&nbsp;(Category - ${dedupeDetails.category})</span>
<img class="matrix-title-icon" src="/matrix/images/page.png" />
<span class="matrix-title-text">Source Record (MV Code - ${dedupeDetails.mvcode})&nbsp;&nbsp;&nbsp;(Category - ${dedupeDetails.category})</span>
</div>
<!-- -->
<!-- Form (Source Record) -->
@@ -79,13 +85,13 @@
</div>
<!-- -->
<!-- Earlier / Negative Details Container -->
<div class="matrix-dedupe-match__comparison">
<div style="border:1px solid #a7abb4;">
<table style="width:100%" border="0" cellspacing="0" >
<tr>
<td style="width:50%" valign="top">
<!-- Title -->
<div class="title">
<img class="matrix-title-icon" src="/matrix/images/ear_details.png" alt="" />
<img class="matrix-title-icon" src="/matrix/images/ear_details.png" align="absmiddle" />
<span class="matrix-title-text">Earlier Details <span id='efound'></span></span>
</div>
<!-- -->
@@ -111,21 +117,24 @@
<td colspan="4"><textarea style="width:443px;font-size:12pt" rows="4" id="earaddress" readonly="readonly" ></textarea></td>
</tr>
<tr>
<td colspan="4">
<div class="matrix-phone-grid">
<label>Residence Phone<input id="earrphone" readonly="readonly" /></label>
<label>Office Phone<input id="earophone" readonly="readonly" /></label>
<label>Mobile Number<input id="earmobile" readonly="readonly" /></label>
</div>
</td>
<td>Residence Phone</td>
<td>Office Phone</td>
<td>Mobile Number</td>
<td></td>
</tr>
<tr>
<td colspan="4" class="matrix-record-navigation">
<button type="button" class="matrix-record-nav matrix-record-nav--first" aria-label="First earlier match" accesskey="H" onclick="findRecord(1,1)"></button>
<button type="button" class="matrix-record-nav matrix-record-nav--previous" aria-label="Previous earlier match" accesskey="J" onclick="findRecord(2,1)"></button>
<button type="button" class="matrix-record-nav matrix-record-nav--next" aria-label="Next earlier match" accesskey="K" onclick="findRecord(3,1)"></button>
<button type="button" class="matrix-record-nav matrix-record-nav--last" aria-label="Last earlier match" accesskey="L" onclick="findRecord(4,1)"></button>
<button type="button" class="button matrix-match-action" id="btnear" accesskey="9" onclick="addRemarks(1,'earremarks')">Match Found</button>
<td><input style="width:150px;font-size:12pt" id="earrphone" readonly="readonly" /></td>
<td><input style="width:150px;font-size:12pt" id="earophone" readonly="readonly" /></td>
<td><input style="width:112px;font-size:12pt" id="earmobile" readonly="readonly" /></td>
<td></td>
</tr>
<tr>
<td colspan="4">
<input type="button" class="button" name="btnfirst1" style="margin-top:5px;float:left" value="" id="btnfirst" accesskey="H" onclick="findRecord(1,1)" />
<input type="button" class="button" name="btnprev1" style="margin-top:5px;float:left" value="" id="btnprev" accesskey="J" onclick="findRecord(2,1)" />
<input type="button" class="button" name="btnnext1" style="margin-top:5px;float:left" value="" id="btnnext" accesskey="K" onclick="findRecord(3,1)" />
<input type="button" class="button" name="btnlast1" style="margin-top:5px;float:left" value="" id="btnlast" accesskey="L" onclick="findRecord(4,1)" />
<input type="button" class="button" name="btnear" style="margin-top:5px;float:right;margin-right:7px" value="Match Found" id="btnear" accesskey="9" onclick="addRemarks(1,'earremarks')" />
</td>
</tr>
<tr>
@@ -139,7 +148,7 @@
<td valign="top" style="width:50%" id="tdneg">
<!-- Title -->
<div class="title">
<img class="matrix-title-icon" src="/matrix/images/neg_details.png" alt="" />
<img class="matrix-title-icon" src="/matrix/images/neg_details.png" align="absmiddle" />
<span class="matrix-title-text">Negative Details <span id='nfound'></span></span>
</div>
<!-- -->
@@ -165,21 +174,24 @@
<td colspan="4"><textarea style="width:438px;font-size:12pt" rows="4" id="negaddress" readonly="readonly" ></textarea></td>
</tr>
<tr>
<td colspan="4">
<div class="matrix-phone-grid">
<label>Residence Phone<input id="negrphone" readonly="readonly" /></label>
<label>Office Phone<input id="negophone" readonly="readonly" /></label>
<label>Mobile Number<input id="negmobile" readonly="readonly" /></label>
</div>
</td>
<td>Residence Phone</td>
<td>Office Phone</td>
<td>Mobile Number</td>
<td></td>
</tr>
<tr>
<td colspan="4" class="matrix-record-navigation">
<button type="button" class="matrix-record-nav matrix-record-nav--first" aria-label="First negative match" accesskey="U" onclick="findRecord(1,2)"></button>
<button type="button" class="matrix-record-nav matrix-record-nav--previous" aria-label="Previous negative match" accesskey="I" onclick="findRecord(2,2)"></button>
<button type="button" class="matrix-record-nav matrix-record-nav--next" aria-label="Next negative match" accesskey="O" onclick="findRecord(3,2)"></button>
<button type="button" class="matrix-record-nav matrix-record-nav--last" aria-label="Last negative match" accesskey="P" onclick="findRecord(4,2)"></button>
<button type="button" class="button matrix-match-action" id="btnneg" accesskey="0" onclick="addRemarks(2,'negremarks')">Match Found</button>
<td><input style="width:150px;font-size:12pt" id="negrphone" readonly="readonly" /></td>
<td><input style="width:150px;font-size:12pt" id="negophone" readonly="readonly" /></td>
<td><input style="width:112px;font-size:12pt" id="negmobile" readonly="readonly" /></td>
<td></td>
</tr>
<tr>
<td colspan="4">
<input type="button" class="button" name="btnfirst" style="margin-top:5px;float:left" value="" id="btnfirst" accesskey="U" onclick="findRecord(1,2)" />
<input type="button" class="button" name="btnprev" style="margin-top:5px;float:left" value="" id="btnprev" accesskey="I" onclick="findRecord(2,2)" />
<input type="button" class="button" name="btnnext" style="margin-top:5px;float:left" value="" id="btnnext" accesskey="O" onclick="findRecord(3,2)" />
<input type="button" class="button" name="btnlast" style="margin-top:5px;float:left" value="" id="btnlast" accesskey="P" onclick="findRecord(4,2)" />
<input type="button" class="button" name="btnear" style="margin-top:5px;float:right;margin-right:7px" value="Match Found" id="btnneg" accesskey="0" onclick="addRemarks(2,'negremarks')" />
</td>
</tr>
<tr>
@@ -195,13 +207,13 @@
</div>
<!-- -->
<!-- Earlier / Negative Details Container -->
<div class="matrix-dedupe-match__remarks">
<div style="border:1px solid #a7abb4;">
<table style="width:100%" border="0" cellspacing="0" >
<tr>
<td style="width:50%" valign="top">
<!-- Title -->
<div class="title">
<img class="matrix-title-icon" src="/matrix/images/ear_rem.png" id="earimg" alt="" onclick="editRemarks('earremarks')" />
<img class="matrix-title-icon" src="/matrix/images/ear_rem.png" id="earimg" align="absmiddle" onclick="editRemarks('earremarks')" />
<span class="matrix-title-text">Earlier Match Remarks</span>
<div class="nedtrem" id="ctrldiv">
<img src="/matrix/images/edit_rem.png" align="absmiddle" onclick="editRemarks('earremarks',1)" title="Remove current record remarks" />
@@ -212,7 +224,7 @@
<div id="FormPanel2" class="FormPanel">
<table align="center" class="matrix-form-controls" style="width:100%">
<tr>
<td><form:textarea path="earremarks" style="width:98%" rows="9" readonly="true" ></form:textarea></td>
<td><form:textarea path="earremarks" style="width:98%" rows="3" readonly="true" ></form:textarea></td>
</tr>
</table>
</div>
@@ -221,7 +233,7 @@
<td style="width:50%" valign="top">
<!-- Title -->
<div class="title">
<img class="matrix-title-icon" src="/matrix/images/neg_rem.png" alt="" />
<img class="matrix-title-icon" src="/matrix/images/neg_rem.png" align="absmiddle" />
<span class="matrix-title-text">Negative Match Remarks</span>
<div class="nedtrem" id="ctrldiv">
<img src="/matrix/images/edit_rem.png" align="absmiddle" onclick="editRemarks('negremarks',2)" title="Remove current record remarks" />
@@ -232,7 +244,7 @@
<div id="FormPanel2" class="FormPanel">
<table align="center" class="matrix-form-controls" style="width:100%">
<tr>
<td><form:textarea path="negremarks" style="width:98%" rows="9" readonly="true" ></form:textarea></td>
<td><form:textarea path="negremarks" style="width:98%" rows="3" readonly="true" ></form:textarea></td>
</tr>
</table>
</div>
@@ -247,12 +259,23 @@
<form:hidden path="uuid" />
<!-- -->
<input type="hidden" id="invalidfields" value="0" />
<div class="matrix-workflow-actions">
<input type="button" class="button" name="btncancel" value="Close" id="btncancel" accesskey="C" onclick="MatrixDialog.close(0)" />
<button type="submit" class="button" name="btnsave" id="btnsave" accesskey="S">Save</button>
</div>
<input type="button" class="button" name="btncancel" style="margin-left:1px;margin-top:5px;float:right" value="Close" id="btncancel" accesskey="C" onclick="MatrixDialog.close(0)" />
<input type="button" class="button" name="btnsave" style="margin-top:5px;float:right" value="Save" id="btnsave" accesskey="S" onclick="return SubmitForm('updatededupe','_parent','dedupeDetails');" />
</form:form>
</div>
</div>
</body>
<!-- Page Load Javascript -->
<script language="javascript" type="text/javascript">
FindMatchedRecords('${dedupeDetails.uuid}');
</script>
<!-- -->
<!-- Process Message -->
<c:if test="${not empty msg}">
<script language="javascript" type="text/javascript"> CallMessage('${msg}',3000,200,300); </script>
<c:if test="${status == true}">
<script language="javascript" type="text/javascript">MatrixDialog.close(1);</script>
</c:if>
</c:if>
<!-- -->
</html>

View File

@@ -14,7 +14,7 @@
<script language="javascript" src="/matrix/js/lib/jsfuncs.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/msgdialog.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/select.js" type="text/javascript"></script>
<script src="/matrix/js/edp/cutoff/cutoff.js?v=1" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/appjs/cutoff.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/validator.js" type="text/javascript"></script>
<link href="/matrix/css/matrix.css" rel="stylesheet" type="text/css" />

View File

@@ -14,7 +14,7 @@
<script language="javascript" src="/matrix/js/lib/jsfuncs.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/msgdialog.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/select.js" type="text/javascript"></script>
<script src="/matrix/js/edp/cutoff/cutoff.js?v=1" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/appjs/cutoff.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/validator.js" type="text/javascript"></script>
<link href="/matrix/css/matrix.css" rel="stylesheet" type="text/css" />

View File

@@ -6,12 +6,10 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="<c:url value='/css/bootstrap-5.3.8.min.css' />" rel="stylesheet" />
<link href="<c:url value='/css/matrix-v2.css?v=6' />" rel="stylesheet" />
<link href="<c:url value='/css/matrix-shell-v2.css?v=7' />" rel="stylesheet" />
<link href="<c:url value='/css/matrix-frame-dialog.css?v=6' />" rel="stylesheet" />
<link href="<c:url value='/css/matrix-theme-v2.css?v=4' />" rel="stylesheet" />
<link href="<c:url value='/css/matrix-v2.css' />" rel="stylesheet" />
<link href="<c:url value='/css/matrix-shell-v2.css' />" rel="stylesheet" />
<link href="<c:url value='/css/matrix-theme-v2.css' />" rel="stylesheet" />
<script src="<c:url value='/js/matrix-shell-v2.js' />" defer></script>
<script src="<c:url value='/js/matrix-frame-dialog.js?v=2' />" defer></script>
<title>Cygnus 1.0 | <c:out value="${empty messageDetails.title ? 'Page unavailable' : messageDetails.title}" /></title>
</head>
<body class="matrix-v2 matrix-shell matrix-error-page matrix-error-page--${empty messageDetails.httpStatus ? 404 : messageDetails.httpStatus}">

View File

@@ -16,7 +16,7 @@
<script language="javascript" src="/matrix/js/ui/msgdialog.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/progressbar.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/select.js" type="text/javascript"></script>
<script src="/matrix/js/edp/cutoff/cutoff.js?v=1" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/appjs/cutoff.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/validator.js" type="text/javascript"></script>
<link href="/matrix/css/matrix.css" rel="stylesheet" type="text/css" />

View File

@@ -4,57 +4,16 @@
}
.matrix-cutoff-workflow .title {
display: flex !important;
align-items: center;
min-height: 38px;
margin: 0 !important;
padding: 6px 10px !important;
gap: 8px;
border: 1px solid #aebfce !important;
border-radius: 6px 6px 0 0;
background: #f7f9fb !important;
color: #263746 !important;
margin-bottom: 10px;
}
.matrix-cutoff-workflow .matrix-cutoff-title-actions {
display: flex;
align-items: center;
flex: 0 0 auto;
gap: 8px;
margin-left: auto;
.matrix-cutoff-workflow .title > .divselect {
width: 132px !important;
margin-left: auto !important;
}
.matrix-cutoff-workflow .matrix-cutoff-title-actions > .divselect {
position: static !important;
width: 150px !important;
height: 28px !important;
margin: 0 !important;
}
.matrix-cutoff-workflow .matrix-cutoff-title-actions > .divselect select {
.matrix-cutoff-workflow .title > .divselect select {
width: 100% !important;
height: 28px !important;
padding: 2px 28px 2px 8px !important;
font-size: 12px !important;
font-weight: 400 !important;
}
.matrix-cutoff-workflow .matrix-title-action {
position: static !important;
flex: 0 0 28px;
width: 28px !important;
height: 28px !important;
margin: 0 !important;
padding: 6px !important;
border: 0 !important;
border-radius: 4px;
cursor: pointer;
object-fit: contain;
}
.matrix-cutoff-workflow .matrix-title-action:hover,
.matrix-cutoff-workflow .matrix-title-action:focus {
background: #e5edf4;
}
.matrix-cutoff-workflow .tableContainer {
@@ -62,7 +21,7 @@
margin: 0;
overflow: auto;
border: 1px solid #c3d0da !important;
border-radius: 0 0 6px 6px;
border-radius: 6px;
background: #f4f8fb !important;
box-shadow: 0 2px 8px rgba(31, 52, 72, .08);
}
@@ -118,23 +77,9 @@
.matrix-cutoff-workflow .tableContainer table table {
width: calc(100% - 18px) !important;
margin: 8px 0 8px auto;
border: 1px solid #9fb2c3;
border: 1px solid #c7d4df;
border-radius: 4px;
background: #fff !important;
box-shadow: 0 2px 6px rgba(31, 52, 72, .12);
}
.matrix-cutoff-workflow .tableContainer > table > tbody > tr[id$="child"] > td {
padding: 6px 10px 8px !important;
background: #dfeaf3 !important;
}
.matrix-cutoff-workflow .tableContainer table table > tbody > tr > td {
background: #fff !important;
}
.matrix-cutoff-workflow .tableContainer table table > tbody > tr:nth-child(even) > td {
background: #f1f6fa !important;
background: #f8fafc;
}
.matrix-cutoff-workflow .tableContainer input[type="checkbox"] {
@@ -144,42 +89,10 @@
accent-color: #245a91;
}
.matrix-cutoff-workflow .matrix-workflow-actions {
display: flex;
justify-content: flex-end;
align-items: center;
gap: 8px;
min-height: 46px;
padding: 8px 10px;
border-top: 1px solid #b8c9d8;
background: #f7fafd;
}
.matrix-cutoff-workflow .matrix-workflow-actions > input.button {
.matrix-cutoff-workflow form > input.button {
min-width: 96px;
margin: 0 !important;
float: none !important;
}
.matrix-cutoff-workflow .matrix-workflow-actions .matrix-button,
.matrix-cutoff-workflow .matrix-workflow-actions > input.button,
.matrix-cutoff-workflow form > input.button,
.matrix-cutoff-workflow form > a.button {
min-height: 30px;
padding: 5px 14px !important;
border: 1px solid #245a91 !important;
border-radius: 4px !important;
color: #fff !important;
background: #28639b !important;
font-size: 12px !important;
font-weight: 600 !important;
line-height: 18px !important;
text-decoration: none !important;
}
.matrix-cutoff-workflow .customLink {
color: #245a91;
font-weight: 600;
margin: 10px 0 0 8px !important;
float: right !important;
}
.matrix-cutoff-workflow form::after {

View File

@@ -7,149 +7,6 @@
margin-bottom: 10px;
}
.matrix-dedupe-workflow .matrix-tool-workspace__content .title > .matrix-title-icon {
display: block;
width: 17px !important;
height: 17px !important;
flex: 0 0 17px;
margin: 0 !important;
object-fit: contain;
vertical-align: middle;
}
.matrix-dedupe-workflow .matrix-tool-workspace__content .title > .matrix-title-text {
line-height: 17px;
}
.matrix-dedupe-workflow .matrix-dedupe-run__title {
display: flex !important;
min-height: 38px;
align-items: center;
gap: 7px;
padding: 5px 10px !important;
}
.matrix-dedupe-workflow .matrix-dedupe-run__title > .matrix-title-action {
width: 17px !important;
height: 17px !important;
margin-left: auto !important;
object-fit: contain;
}
.matrix-dedupe-worklist {
overflow: hidden;
border: 1px solid #aebfcd;
border-radius: 5px;
background: #f4f8fb;
box-shadow: 0 3px 10px rgba(31, 52, 72, .09);
}
.matrix-dedupe-worklist__header {
display: flex !important;
min-height: 38px;
align-items: center;
gap: 12px;
margin: 0 !important;
padding: 4px 8px !important;
flex-wrap: nowrap !important;
}
.matrix-dedupe-worklist__heading,
.matrix-dedupe-worklist__actions {
display: flex;
align-items: center;
}
.matrix-dedupe-worklist__heading {
flex: 0 0 auto;
gap: 7px;
}
.matrix-dedupe-workflow .matrix-dedupe-worklist__header > .matrix-dedupe-worklist__actions {
min-width: 0;
flex: 1 1 auto;
gap: 7px;
flex-wrap: nowrap !important;
width: auto !important;
margin: 0 !important;
}
.matrix-dedupe-worklist__portfolio {
min-width: 0;
flex: 1 1 auto;
height: 29px !important;
padding: 2px 28px 2px 8px !important;
font-size: 13px !important;
font-weight: 400 !important;
width: 100% !important;
}
.matrix-dedupe-worklist__refresh {
display: inline-flex;
width: 29px;
height: 29px;
flex: 0 0 29px;
align-items: center;
justify-content: center;
padding: 0;
border: 0;
border-radius: 3px;
background: transparent;
}
.matrix-dedupe-worklist__refresh:hover,
.matrix-dedupe-worklist__refresh:focus-visible {
background: #e2ebf3;
outline: 1px solid #9fb5c7;
}
.matrix-dedupe-worklist__refresh img {
width: 16px;
height: 16px;
}
.matrix-dedupe-worklist__table-wrap {
margin: 8px;
border: 1px solid #c3d0da;
border-radius: 4px;
}
.matrix-dedupe-worklist__table-wrap thead th {
padding: 7px 9px;
color: #31475b;
background: #e8eef4;
border-color: #d3dce5;
font-size: 11px;
text-transform: uppercase;
white-space: nowrap;
}
.matrix-dedupe-worklist__table-wrap tbody td {
padding: 6px 9px;
border-color: #dce4eb;
background: #fff;
}
.matrix-dedupe-worklist__row {
cursor: pointer;
}
.matrix-dedupe-worklist__row:nth-child(even) td {
background: #edf3f7;
}
.matrix-dedupe-worklist__row:hover td,
.matrix-dedupe-worklist__row:focus td {
background: #dfedf8;
}
.matrix-dedupe-worklist__empty {
padding: 24px !important;
color: #637586;
text-align: center;
font-style: italic;
}
.matrix-dedupe-workflow .title > .divselect {
width: min(320px, 38vw) !important;
margin-left: auto !important;
@@ -213,50 +70,14 @@
.matrix-dedupe-workflow .tableContainer table table {
width: calc(100% - 18px) !important;
margin: 8px 0 8px auto;
border: 1px solid #9fb2c3;
border-radius: 4px;
background: #fff !important;
box-shadow: 0 2px 6px rgba(31, 52, 72, .12);
border: 1px solid #c7d4df;
background: #f8fafc;
}
/* Migration convention: nested data grids must remain visually distinct. */
.matrix-dedupe-workflow .tableContainer > table > tbody > tr:has(> td > table) > td {
padding: 6px 10px 8px !important;
background: #dfeaf3 !important;
}
.matrix-dedupe-workflow .tableContainer table table > tbody > tr > td {
background: #fff !important;
}
.matrix-dedupe-workflow .tableContainer table table > tbody > tr:nth-child(even) > td {
background: #f1f6fa !important;
}
.matrix-dedupe-workflow .matrix-workflow-actions {
display: flex;
justify-content: flex-end;
align-items: center;
gap: 8px;
min-height: 46px;
padding: 8px 10px;
border-top: 1px solid #b8c9d8;
background: #f7fafd;
}
.matrix-dedupe-workflow .matrix-workflow-actions .button {
.matrix-dedupe-workflow form > input.button {
min-width: 108px;
margin: 0 !important;
float: none !important;
min-height: 30px;
padding: 5px 14px !important;
border: 1px solid #245a91 !important;
border-radius: 4px !important;
color: #fff !important;
background: #28639b !important;
font-size: 12px !important;
font-weight: 600 !important;
line-height: 18px !important;
margin: 10px 0 0 8px !important;
float: right !important;
}
.matrix-dedupe-workflow form::after {
@@ -285,187 +106,39 @@
overflow: hidden;
}
.matrix-dedupe-match #dedupeDetails .title {
box-sizing: border-box;
display: flex;
min-height: 36px;
align-items: center;
gap: 7px;
margin: 0 !important;
padding: 6px 9px !important;
border-bottom: 1px solid #aebfcd !important;
background: #eef3f7 !important;
font-size: 13px;
line-height: 20px;
}
.matrix-dedupe-match #dedupeDetails .title > .matrix-title-icon {
display: block;
width: 17px !important;
height: 17px !important;
flex: 0 0 17px;
margin: 0 !important;
object-fit: contain;
}
.matrix-dedupe-match #dedupeDetails .title > .matrix-title-text {
min-width: 0;
line-height: 20px;
}
.matrix-dedupe-match #dedupeDetails .title > .nedtrem {
display: inline-flex;
align-items: center;
margin-left: auto;
}
.matrix-dedupe-match #dedupeDetails .title > .nedtrem img {
width: 17px;
height: 17px;
object-fit: contain;
cursor: pointer;
}
.matrix-dedupe-match .FormPanel {
padding: 5px 10px;
padding: 10px 12px;
border: 0 !important;
background: #f4f8fb !important;
}
.matrix-dedupe-match .matrix-form-controls {
width: 100% !important;
table-layout: fixed;
border-spacing: 8px 2px;
margin-top: 0 !important;
margin-bottom: 0 !important;
}
.matrix-dedupe-match .matrix-form-controls td {
height: auto !important;
padding: 1px 8px !important;
color: #34495b;
font-size: 11px;
font-weight: 600;
line-height: 14px;
vertical-align: middle;
border-spacing: 7px 4px;
}
.matrix-dedupe-match .matrix-form-controls input:not([type="hidden"]),
.matrix-dedupe-match .matrix-form-controls textarea {
box-sizing: border-box;
width: 100% !important;
max-width: 100%;
min-height: 30px;
padding: 4px 7px !important;
border: 1px solid #b8c7d3 !important;
border-radius: 3px;
background: #fff !important;
color: #24313d;
font-size: 12px !important;
font-weight: 400 !important;
line-height: 20px;
}
.matrix-dedupe-match .matrix-form-controls input:not([type="hidden"]) {
width: 100% !important;
height: 30px !important;
}
.matrix-dedupe-match .matrix-dedupe-match__comparison,
.matrix-dedupe-match .matrix-dedupe-match__remarks {
border: 1px solid #aebfcd !important;
background: #dfeaf3;
}
.matrix-dedupe-match .matrix-dedupe-match__comparison > table,
.matrix-dedupe-match .matrix-dedupe-match__remarks > table {
width: 100%;
table-layout: fixed;
}
.matrix-dedupe-match .matrix-dedupe-match__comparison > table > tbody > tr > td + td,
.matrix-dedupe-match .matrix-dedupe-match__remarks > table > tbody > tr > td + td {
border-left: 1px solid #b8c9d8;
}
.matrix-dedupe-match .matrix-record-navigation {
display: flex;
align-items: center;
gap: 5px;
padding-top: 5px;
}
.matrix-dedupe-match .matrix-phone-grid {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 10px;
width: 100%;
}
.matrix-dedupe-match .matrix-phone-grid label {
display: flex;
min-width: 0;
flex-direction: column;
gap: 3px;
margin: 0;
color: #34495b;
font-size: 11px;
font-weight: 600;
}
.matrix-dedupe-match .matrix-phone-grid input {
width: 100% !important;
min-width: 0;
}
.matrix-dedupe-match .matrix-record-nav {
width: 32px;
height: 29px;
flex: 0 0 32px;
padding: 0;
border: 1px solid #9fb3c4;
border-radius: 4px;
background-color: #f7fafc;
background-position: center;
background-repeat: no-repeat;
cursor: pointer;
}
.matrix-dedupe-match .matrix-record-nav:hover,
.matrix-dedupe-match .matrix-record-nav:focus-visible {
border-color: #28699d;
background-color: #e2edf6;
outline: none;
}
.matrix-dedupe-match .matrix-record-nav--first { background-image: url('/matrix/images/first.png'); }
.matrix-dedupe-match .matrix-record-nav--previous { background-image: url('/matrix/images/prev.png'); }
.matrix-dedupe-match .matrix-record-nav--next { background-image: url('/matrix/images/next.png'); }
.matrix-dedupe-match .matrix-record-nav--last { background-image: url('/matrix/images/last.png'); }
.matrix-dedupe-match .matrix-match-action {
width: auto !important;
min-width: 108px;
min-height: 29px;
margin: 0 0 0 auto !important;
padding: 4px 12px !important;
float: none !important;
background-image: none !important;
text-indent: 0 !important;
white-space: nowrap;
}
.matrix-dedupe-match .matrix-form-controls textarea {
resize: vertical;
}
.matrix-dedupe-match :is(#btnfirst, #btnprev, #btnnext, #btnlast) {
width: 30px !important;
min-width: 30px;
padding: 3px !important;
}
.matrix-dedupe-match :is(#btnear, #btnneg) {
color: #fff !important;
background-image: none !important;
background-color: #245a91 !important;
border-color: #245a91 !important;
text-indent: 0 !important;
white-space: nowrap;
}
@media (max-width: 760px) {

View File

@@ -1,73 +1,83 @@
"use strict";
var curPos = 0;
var maxRow = 0;
function cutoffMessage(message) {
if (window.CygnusNotifications) {
window.CygnusNotifications.showLegacy(message);
return;
var curPos=0;
var maxRow=0;
function ValidateSubmitCutOff(FormName)
{
if(ValidateList('chkrow')>0)
{
validate(document.getElementById('batchlist'),'t','');
if (invalidFields>0)
{
CallMessage('VLFRM:error:There are one or more error(s) in form. Please correct them and try again.',3000,200,300);
}
else
{
SubmitForm('savecut','_parent',FormName);
}
}
else
{
CallMessage('VLFRM:error:Please select atleast one portfolio to start cut-off process.',3000,200,300);
}
}
function ValidateSubmitSms(FormName)
{
SubmitForm('Sms','_parent',FormName);
}
function ValidateSubmitAllocation(FormName)
{
if(ValidateList('chkchild')>0)
{
SubmitForm('savealloc','_parent',FormName);
}
CallMessage(message, 4000, 200, 300);
}
function submitCutoffForm(formName, endpoint) {
var form = document.forms[formName] || document.getElementById(formName);
if (!form) return false;
form.action = endpoint;
form.target = "_self";
form.submit();
return false;
}
function withCsrf(parameters) {
var token = document.querySelector('input[name="_csrf"]');
if (!token) return parameters;
return parameters + "&" + encodeURIComponent(token.name) + "=" + encodeURIComponent(token.value);
}
function requireSelection(prefix, message, formName, endpoint) {
if (ValidateList(prefix) > 0) return submitCutoffForm(formName, endpoint);
cutoffMessage(message);
return false;
}
function ValidateSubmitCutOff(formName) {
if (ValidateList("chkrow") < 1) {
cutoffMessage("VLFRM:error:Please select at least one portfolio to start the cut-off process.");
return false;
else
{
CallMessage('VLFRM:error:Please select atleast one portfolio to start allocation process.',3000,200,300);
}
validate(document.getElementById("batchlist"), "t", "");
if (invalidFields > 0) {
cutoffMessage("VLFRM:error:Correct the highlighted fields and try again.");
return false;
}
function ValidateSubmitSopr(FormName)
{
if(ValidateList('chkchild')>0)
{
SubmitForm('sendcasestoopr','_parent',FormName);
}
else
{
CallMessage('VLFRM:error:Please select atleast one portfolio to start send to operation process.',3000,200,300);
}
return submitCutoffForm(formName, "savecut");
}
function ValidateSubmitSms(formName) { return submitCutoffForm(formName, "Sms"); }
function ValidateSubmitAllocation(formName) {
return requireSelection("chkchild", "VLFRM:error:Select at least one case to allocate.", formName, "savealloc");
function ValidateSubmitTelesheet(FormName)
{
if(ValidateList('chkchild')>0)
{
SubmitForm('gentelesheet','_parent',FormName);
}
else
{
CallMessage('VLFRM:error:Please select atleast one portfolio to start telesheet process.',3000,200,300);
}
}
function ValidateSubmitSopr(formName) {
return requireSelection("chkchild", "VLFRM:error:Select at least one case to send to operations.", formName, "sendcasestoopr");
function ValidateSubmitRefsheet(FormName)
{
if(ValidateList('chkchild')>0)
{
SubmitForm('genrefsheet','_parent',FormName);
}
else
{
CallMessage('VLFRM:error:Please select atleast one portfolio to start reference sheet process.',3000,200,300);
}
}
function ValidateSubmitTelesheet(formName) {
return requireSelection("chkchild", "VLFRM:error:Select at least one case for the Tele-Sheet.", formName, "gentelesheet");
function InitPage()
{
maxRow=$("#cutlist >tbody >tr").length;
if(maxRow<1)
{
document.getElementById("btnsave").style.display="none";
}
}
function ValidateSubmitRefsheet(formName) {
return requireSelection("chkchild", "VLFRM:error:Select at least one case for the Reference Sheet.", formName, "genrefsheet");
}
function InitPage() {
maxRow = document.querySelectorAll("#cutlist > tbody > tr").length;
var saveButton = document.getElementById("btnsave");
if (saveButton) saveButton.hidden = maxRow < 1;
}
function ExpandList(elementId) {
var child = document.getElementById(elementId + "child");
if (child) child.style.display = child.style.display === "none" ? "table-row" : "none";
function ExpandList(elmId)
{
$("#"+elmId+"child").toggle();
}
function editMessage(elm,msgfieldId)
{
@@ -131,7 +141,7 @@ function sendSMS(tableId)
}
else
{
cutoffMessage('EMPTOBX:info:Outbox is empty.');
CallMessage('EMPTOBX:info:Outbox is empty.',3000,200,300);
}
}
function getExtractMessage(oprId)
@@ -171,7 +181,7 @@ function FinalizePhotoCase()
if(svstatus==0 && upstatus==1)
{
$("#vid-"+curPos).html("<img src='/matrix/images/loading_small.gif' width='16' height='7' title='please wait, it will take few minutes' />");
QryStr=withCsrf("val0="+encodeURIComponent(uuid)+"&val1="+encodeURIComponent(mvcode)+"&val2="+encodeURIComponent($("#usid").val()));
QryStr="val0="+uuid+"&val1="+mvcode+"&val2="+($("#usid").val());
RunAjax("POST","finalizepcases",QryStr,2);
}
else

View File

@@ -0,0 +1,383 @@
var currow=0;
var lastrow=0;
var negIndx=0;
var earIndx=0;
var earlier= new Array(1);
var negative= new Array(1);
var earpos=0;
var negpos=0;
var ctrlear="";
var ctrlneg="";
function InitPage()
{
$('form tbody.scrollContent tr').hover(function () {
$(this).addClass('rowhover');
}, function () {
$(this).removeClass('rowhover');
});
$('form tbody.scrollContent tr').click(function () {
currow=$(this).index();
GetRowData(this);
});
}
function ResetRow()
{
currow=0;
lastrow=$('#casetable tr').length-1;
}
function GetRowData(SelectedRow)
{
var rowId=$(SelectedRow).attr('id');
QueryStr="rand="+Math.round(Math.random()*4+1)+"&uuid="+$("#"+rowId+"uuid").val();
OpenMatrixDialog("dedupefound?"+QueryStr,"Dedupe Details").then(function(retVal) {
if(retVal==1)
{
$(SelectedRow).remove();
lastrow=currow-1;
changeRow();
}
});
}
function keyListen(param1,param2,e) {
var keycode = e.keyCode;
if(keycode==13)
{
GetRowData($('tr:eq('+currow+')', $("#casetable")));
}
else
{
if(keycode==40)
{
currow=currow+1;
if(currow>=$('#casetable tr').length){currow=1;lastrow=$('#casetable tr').length-1;}
changeRow();
}
if(keycode==38)
{
currow=currow-1;
if(currow<=0){currow=$('#casetable tr').length-1;lastrow=1;}
changeRow();
}
}
}
function changeRow()
{
$('tr:eq('+currow+')', $("#casetable")).addClass('rowhover');
$('tr:eq('+lastrow+')', $("#casetable")).removeClass('rowhover');
$('tr:eq('+currow+')', $("#casetable")).focus();
lastrow=currow;
}
function callkeydownhandler(evnt) {
var ev = evnt;
keyListen('','',ev);
}
window.document.addEventListener("keydown", callkeydownhandler, false);
function FindMatchedRecords(uuid)
{
$("#efoundon").html("<b>Loading</b> <img src='/matrix/images/loading.gif' align='absmiddle' />");
$("#nfoundon").html("<b>Loading</b> <img src='/matrix/images/loading.gif' align='absmiddle' />");
RunAjax("GET","deduperecords","uuid="+uuid,1);
}
function AfterResponse(response,oprID)
{
if(oprID==1)
{
negIndx=0;
earIndx=0;
if(response.trim()!='')
{
var rows=response.split(RowDelim);
for(rindx=0;rindx<rows.length;rindx++)
{
var cols=rows[rindx].split(ColDelim);
if(cols[0]=='EAR')
{
earlier[earIndx]=new Array(cols.length);
for(cindx=0;cindx<cols.length;cindx++)
{
earlier[earIndx][cindx]=cols[cindx];
}
earIndx=earIndx+1;
}
else if(cols[0]=='NEG')
{
negative[negIndx]=new Array(cols.length);
for(cindx=0;cindx<cols.length;cindx++)
{
negative[negIndx][cindx]=cols[cindx];
}
negIndx=negIndx+1;
}
}
}
//earIndx= earIndx==0 ? earIndx : earIndx-1;
//negIndx= negIndx==0 ? negIndx : negIndx-1;
$("#efound").html("<b>("+(earIndx==0 ? "No" : earIndx)+" Match Found)</b>");
$("#nfound").html("<b>("+(negIndx==0 ? "No" : negIndx)+" Match Found)</b>");
FillDetails(1);
FillDetails(2);
}
}
function findRecord(arrOpr,opr)
{
tempPos= opr==1 ? earpos:negpos;
maxLen= opr==1 ? earIndx-1:negIndx-1;
if(arrOpr==1) tempPos=0;
if(arrOpr==2)
{
if(tempPos>0) tempPos=tempPos-1;
else return false;
}
if(arrOpr==3)
{
if(tempPos<maxLen) tempPos=tempPos+1;
else return false;
}
if(arrOpr==4) tempPos=maxLen;
earpos= opr==1 ? tempPos:earpos;
negpos= opr==2 ? tempPos:negpos;
FillDetails(opr);
}
function FillDetails(opr)
{
if(opr==1)
{
if(earIndx > 0)
{
var addropt=MatchWith(earlier[earpos][1],'ear');
MatchFoundOn(earlier[earpos][2],'ear');
$("#earname").val(earlier[earpos][6]);
$("#eardob").val(earlier[earpos][7]);
if(addropt==1)
{
$("#earaddress").val(earlier[earpos][8]+" "+earlier[earpos][9]+" "+earlier[earpos][10]);
}
else if(addropt==2)
{
$("#earaddress").val(earlier[earpos][14]+" "+earlier[earpos][15]+" "+earlier[earpos][16]);
}
else if(addropt==3)
{
addr=earlier[earpos][8].trim()!='' ? ('Residence Address: '+earlier[earpos][8]+" "+earlier[earpos][9]+" "+earlier[earpos][10]):'';
addr=(addr.length > 0 ? addr+'\n\n':'')+(earlier[earpos][14].trim()!='' ? ('Office Address: '+earlier[earpos][14]+" "+earlier[earpos][15]+" "+earlier[earpos][16]):'');
$("#earaddress").val(addr);
}
$("#earrphone").val(earlier[earpos][11]);
$("#earophone").val(earlier[earpos][12]);
$("#earmobile").val(earlier[earpos][13]);
$("#efoundon").html("Match Found On : <b>"+earlier[earpos][1]+"</b>");
$("#efound").html("<b>("+(Number(earpos)+1)+" / "+ earIndx+" Match Found)</b>");
//$("#ecurrecord").html("Current Record : <b>"+(Number(earpos)+1)+"</b>");
}
else
{
$("#efoundon").html("<b>No Match Found</b>");
}
}
else if(opr==2)
{
if(negIndx > 0)
{
var addropt=MatchWith(negative[negpos][1],'neg');
MatchFoundOn(negative[negpos][1],'neg');
$("#negname").val(negative[negpos][6]);
$("#negdob").val(negative[negpos][7]);
if(addropt==1)
{
$("#negaddress").val(negative[negpos][8]+" "+negative[negpos][9]+" "+negative[negpos][10]);
}
else if(addropt==2)
{
$("#negaddress").val(negative[negpos][14]+" "+negative[negpos][15]+" "+negative[negpos][16]);
}
else if(addropt==3)
{
addr=negative[negpos][8].trim()!='' ? ('Residence Address: '+negative[negpos][8]+" "+negative[negpos][9]+" "+negative[negpos][10]):'';
addr=(addr.length > 0 ? addr+'\n\n':'')+(negative[negpos][14].trim()!='' ? ('Office Address: '+negative[negpos][14]+" "+negative[negpos][15]+" "+negative[negpos][16]):'');
$("#negaddress").val(addr);
}
$("#negrphone").val(negative[negpos][11]);
$("#negophone").val(negative[negpos][12]);
$("#negmobile").val(negative[negpos][13]);
$("#nfoundon").html("Match Found On : <b>"+negative[negpos][1]+"</b>");
$("#nfound").html("<b>("+(Number(negpos)+1)+" / "+negIndx+" Match Found)</b>");
//$("#efound").html("Current Record : <b>"+(Number(negpos)+1)+"</b>");
}
else
{
$("#nfoundon").html("<b>No Match Found</b>");
}
}
}
function MatchFoundOn(MatchFoundOn,Opr)
{
if(MatchFoundOn.search("MATCH WITH SAME RESIDENCE ADDRESS") > -1)
{
Opr=="ear" ? ctrlear=ctrlear+",resiaddress" : ctrlneg=ctrlneg+",resiaddress";
$("#resiaddress").addClass(Opr+"match");
}
if(MatchFoundOn.search("MATCH WITH SAME OFFICE ADDRESS") > -1)
{
Opr=="ear" ? ctrlear=ctrlear+",offaddress" : ctrlneg=ctrlneg+",offaddress";
$("#offaddress").addClass(Opr+"match");
}
if(MatchFoundOn.search("MATCH WITH SAME RESIDENCE PHONE") > -1)
{
Opr=="ear" ? ctrlear=ctrlear+",rphone" : ctrlneg=ctrlneg+",rphone";
$("#rphone").addClass(Opr+"match");
}
if(MatchFoundOn.search("MATCH WITH SAME OFFICE PHONE") > -1)
{
Opr=="ear" ? ctrlear=ctrlear+",ophone" : ctrlneg=ctrlneg+",ophone";
$("#ophone").addClass(Opr+"match");
}
if(MatchFoundOn.search("MATCH WITH SAME MOBILE PHONE NUMBER") > -1)
{
Opr=="ear" ? ctrlear=ctrlear+",mobile" : ctrlneg=ctrlneg+",mobile";
$("#mobile").addClass(Opr+"match");
}
}
function MatchWith(MatchWith,Opr)
{
resetMarking(Opr);
Opr=="ear" ? ctrlear="" : ctrlneg="";
if(MatchWith=="RESIDENCE ADDRESS")
{
temp=Opr+"address";
Opr=="ear" ? ctrlear=temp : ctrlneg=temp;
$("#"+Opr+"address").addClass(Opr+"match");
return 1;
}
if(MatchWith=="OFFICE ADDRESS")
{
temp=Opr+"address";
Opr=="ear" ? ctrlear=temp : ctrlneg=temp;
$("#"+Opr+"address").addClass(Opr+"match");
return 2;
}
if(MatchWith=="RESIDENCE PHONE")
{
temp=Opr+"rphone";
Opr=="ear" ? ctrlear=temp : ctrlneg=temp;
$("#"+Opr+"rphone").addClass(Opr+"match");
return 1;
}
if(MatchWith=="OFFICE PHONE")
{
temp=Opr+"ophone";
Opr=="ear" ? ctrlear=temp : ctrlneg=temp;
$("#"+Opr+"ophone").addClass(Opr+"match");
return 2;
}
if(MatchWith=="MOBILE NUMBER")
{
temp=Opr+"mobile";
Opr=="ear" ? ctrlear=temp : ctrlneg=temp;
$("#"+Opr+"mobile").addClass(Opr+"match");
return 3;
}
if(MatchWith=="NAME AND DOB")
{
temp="name,"+Opr+"name,dob,"+Opr+"dob";
Opr=="ear" ? ctrlear=temp : ctrlneg=temp;
$("#"+Opr+"name").addClass(Opr+"match");
$("#name").addClass(Opr+"match");
$("#"+Opr+"dob").addClass(Opr+"match");
$("#dob").addClass(Opr+"match");
return 3;
}
}
function resetMarking(Opr)
{
var ctrls=null;
if(ctrlear.length!="" && Opr=="ear")
{
ctrls=ctrlear.split(",");
}
if(ctrlneg.length!="" && Opr=="neg")
{
ctrls=ctrlneg.split(",");
}
if(ctrls!=null)
{
for(i=0;i<ctrls.length;i++)
{
if(ctrls[i]!='')
{
$("#"+ctrls[i]).removeClass(Opr+"match");
}
}
}
}
function addRemarks(Opr,elemId)
{
var val=$("#"+elemId).val();
if(Opr==1 && earIndx > 0)
{
val= val.trim()=='' ? '':val+"\n\n";
$("#"+elemId).val(val+""+earlier[earpos][2]);
findRecord(3,Opr);
}
else if(Opr==2 && negIndx > 0)
{
val= val.trim()=='' ? '':val+"\n\n";
$("#"+elemId).val(val+""+negative[negpos][2]);
findRecord(3,Opr);
}
else
{
CallMessage('DEDDO:info:No match found.',3000,200,300);
}
}
function editRemarks(elmId,Opr)
{
if(confirm("Are you sure to remove current record remarks?"))
{
var rem=$("#"+elmId).val();
if(Opr==1 && rem.length > 0)
{
rem=rem.replace(earlier[earpos][2],"");
}
else if(Opr==2 && rem.length > 0)
{
rem=rem.replace(negative[negpos][2],"");
}
$("#"+elmId).val(rem);
}
}
function InitSendDedupe()
{
if($("#casetobesend >tbody >tr").length<1)
{
$("#btngenreport").hide();
}
$('form tbody.scrollContent tr').hover(function () {
$(this).addClass('rowhover');
}, function () {
$(this).removeClass('rowhover');
});
$('form tbody.scrollContent tr').click(function(event) {
if (event.target.type !== 'checkbox') {
$(':checkbox', this).trigger('click');
}
checkList('chkrow','selall');
});
}
function ValidateSendDedupe(formname)
{
setHFList("casetobesend");
var uuids=$("#hfdelstat").val();
if(uuids=='')
{
CallMessage('BKLIST:error:Please select atleast one case to start report generation process.',3000,200,300);
return false;
}
else
{
SubmitForm('senddedreports', '_parent', formname);
}
}

View File

@@ -0,0 +1,142 @@
var childCnt='';
var curProc='ear';
var curStatus='Waiting';
function ExpandList(elmId)
{
$("#"+elmId+"child").toggle();
}
function showDedupePanel(cutList)
{
var optDiv=document.createElement("div");
optDiv.setAttribute("id","FormPanel");
optDiv.setAttribute("class","FormPanel");
optDiv.setAttribute("style","font-family:Tahoma;overflow:visible;padding-right:3px;width:480px");
var ControlsPanel="<table border='0' cellspacing='0' width='100%' class='matrix-form-controls'>";
ControlsPanel=ControlsPanel+"<tr><td style='height:5px;width:210px'></td><td></td></tr>";
ControlsPanel=ControlsPanel+"<tr><td id='tdearlabel' style='height:35px;padding-left:15px;font-weight:normal;font-size:13px' valign='center'>Checking for Earlier</td><td id='tdearrun' height='30' valign='center' style='font-weight:normal;font-size:13px'><font color='#fe8900'>Waiting...</font></td></tr>";
ControlsPanel=ControlsPanel+"<tr><td id='tdneglabel' style='height:35px;font-weight:normal;padding-left:15px;font-size:13px' valign='center'>Checking for Negative</td><td id='tdnegrun' height='30' valign='center' style='font-weight:normal;font-size:13px'><font color='#fe8900'>Waiting...</font></td></tr>";
ControlsPanel=ControlsPanel+"<tr><td colspan='2'><input type='button' class='button' name='btncancel' style='margin-top:5px;float:right' value='Close' id='btncancel' accesskey='C' onclick=\"RemoveDialog(document.getElementById('ProcDialog'))\" /> <input type='button' class='button' name='btnstart' style='margin-top:5px;float:right' value='Start' id='btnstart' accesskey='S' onclick=\"StartDedupeRun('"+cutList+"',document.getElementById('ProcDialog'))\" /></td></tr>";
ControlsPanel=ControlsPanel+"</table>";
optDiv.innerHTML=ControlsPanel;
ShowInputDialog(optDiv,"Checking Earlier and Negative","dedupe","ProcDialog");
}
function StartDedupeRun(cutList,ProcDialog)
{
StartEarlierRun(cutList);
}
function StartEarlierRun(cutList)
{
curProc='ear';
curStatus='Checking for Earlier';
var label="<img src='/matrix/images/arrow_green_r.png' align='absmiddle'/>&nbsp;<font color='black'><b>"+curStatus+"</b></font>";
$("#tdearlabel").html(label);
ProgressBar("tdearrun","Record",cutList,12,"REGULAR");
StartDedupeProcess(cutList,'ear',1);
}
function StartNegativeRun(cutList)
{
curProc='neg';
curStatus='Checking for Negative';
var label="<img src='/matrix/images/arrow_green_r.png' align='absmiddle'/>&nbsp;<font color='black'><b>"+curStatus+"</b></font>";
$("#tdneglabel").html(label);
ProgressBar("tdnegrun","Record",cutList,12,"REGULAR");
StartDedupeProcess(cutList,'neg',2);
}
function updateLabels(Proc)
{
var label="<img src='/matrix/images/check.png' align='absmiddle'/>&nbsp;<font color='black'><b>"+curStatus+"</b></font>";
$("#td"+Proc+"label").html(label);
$("#td"+Proc+"run").html("<font size='1'>Processed : <b>"+nextPos+"</b> Success : <font color='green'><b>"+success+"</b></font> Failed : <font color='red'><b>"+failed+"</b></font> Skipped : <font color='blue'><b>"+skipped+"</b></font></font>");
}
function StartDedupeProcess(cutList,Childid,OprID)
{
success=0;
failed=0;
nextPos=1;
skipped=0;
progresswidth=0;
curPos=1;
SourceTable=cutList;
RowId='';
found=$("#"+SourceTable+" tr").length-1;
progbarwidth=$("#progressbar").width();
ProgPerRec=(progbarwidth/found).toFixed(2);
if(found>0)
{
ExtractSendRecord(Childid,OprID);
}
else
{
CallMessage('EMPTOBX:info:List is empty or already processed.',3000,200,300);
}
}
function ExtractSendRecord(Childid,oprId)
{
RowId=$("#"+SourceTable+" tr:eq("+curPos+")").attr("id").replace("row","");
var uuid=$("#uuid"+RowId).val();
var process=$("#row"+RowId+""+Childid);
var val3=$("#curu").val();
childCnt=Childid;
if($(process).val()=="Y")
{
QryStr="val="+uuid+"&val1="+oprId+"&val2=Y&val3="+val3;
RunAjax("GET","checkdedupe",QryStr,oprId);
}
else
{
AfterResponse('skipped:',oprId);
}
}
function AfterResponse(AjaxResponse,OprID)
{
if(OprID==1 || OprID==2)
{
if(AjaxResponse.search("success:")==0)
{
success=success+1;
$("#td"+RowId+""+childCnt).attr("bgcolor", '#a6fc8e');
$("#sp"+RowId+""+childCnt).html("D");
$("#row"+RowId+""+childCnt).val("D");
}
else if(AjaxResponse.search("skipped:")==0)
{
skipped=skipped+1;
/*if(OprID==1)
{
curPos=curPos+1;
}
else
{
$("#row"+RowId).remove();
}*/
}
else
{
failed=failed+1;
///$("#imgstatus"+RowId).attr("src", "/matrix/images/smsfailed.png");
$("#row"+RowId).attr("title", AjaxResponse);
$("#sp"+RowId+""+childCnt).html("F");
$("#td"+RowId+""+childCnt).attr("bgcolor", "#ffcabf");
}
if((nextPos==found))
{
if(OprID==1)
{
curStatus='Earlier Check Completed.';
updateLabels(curProc);
StartNegativeRun(SourceTable);
}
else
{
curStatus='Negative Check Completed.';
updateLabels(curProc);
}
return 0;
}
curPos=curPos+1;
UpdateProgress();
nextPos=nextPos+1;
ExtractSendRecord(childCnt,OprID);
}
}

View File

@@ -1,34 +0,0 @@
(() => {
"use strict";
const form = document.getElementById("dedupeWorkspace");
const portfolio = document.getElementById("portfolioId");
const table = document.getElementById("dedupeCaseTable");
if (!form || !portfolio || !table) return;
portfolio.addEventListener("change", () => form.requestSubmit());
const openCase = (row) => {
const caseId = row?.dataset.caseId;
if (!caseId) return;
const contextPath = document.body.dataset.contextPath || "";
const url = `${contextPath}/ver/dedupefound?uuid=${encodeURIComponent(caseId)}`;
const dialog = window.MatrixFrameDialog;
if (!dialog?.open) {
window.location.assign(url);
return;
}
dialog.open(url, "Dedupe Details").then((result) => {
if (Number(result) === 1) row.remove();
});
};
table.addEventListener("click", (event) =>
openCase(event.target.closest("tr[data-case-id]")));
table.addEventListener("keydown", (event) => {
if (event.key === "Enter" || event.key === " ") {
event.preventDefault();
openCase(event.target.closest("tr[data-case-id]"));
}
});
})();

View File

@@ -1,101 +0,0 @@
(() => {
"use strict";
const form = document.getElementById("dedupeDetails");
if (!form) return;
const state = { EAR: { rows: [], index: 0 }, NEG: { rows: [], index: 0 } };
const value = (id, next) => {
const element = document.getElementById(id);
if (element && next !== undefined) element.value = next || "";
return element?.value || "";
};
const notify = (type, message, code, referenceId) =>
window.CygnusNotifications?.show({ type, message, code, referenceId });
function address(record) {
return record?.residenceAddress || record?.officeAddress || "";
}
function render(type) {
const group = state[type];
const prefix = type === "EAR" ? "ear" : "neg";
const record = group.rows[group.index];
document.getElementById(type === "EAR" ? "efound" : "nfound").textContent =
group.rows.length ? `(${group.index + 1} / ${group.rows.length} Match Found)` : "(No Match Found)";
document.getElementById(type === "EAR" ? "efoundon" : "nfoundon").textContent =
record ? `Match Found On: ${record.foundOn || ""}` : "No Match Found";
value(`${prefix}name`, record?.customerName);
value(`${prefix}dob`, record?.dob);
value(`${prefix}address`, record ? address(record) : "");
value(`${prefix}rphone`, record?.residencePhone);
value(`${prefix}ophone`, record?.officePhone);
value(`${prefix}mobile`, record?.mobile);
}
async function load() {
const uuid = value("uuid");
try {
const response = await fetch(`${form.dataset.recordsUrl}?uuid=${encodeURIComponent(uuid)}`, {
credentials: "same-origin", headers: { Accept: "application/json" }
});
const payload = await response.json();
if (!response.ok || !payload.success) throw payload.message || {};
state.EAR.rows = payload.data.filter((row) => row.dedupeType === "EAR");
state.NEG.rows = payload.data.filter((row) => row.dedupeType === "NEG");
render("EAR");
render("NEG");
} catch (error) {
notify("danger", error.message || "Matching records could not be loaded.", error.code, error.referenceId);
}
}
window.findRecord = (operation, section) => {
const group = state[section === 1 ? "EAR" : "NEG"];
if (!group.rows.length) return;
if (operation === 1) group.index = 0;
if (operation === 2) group.index = Math.max(0, group.index - 1);
if (operation === 3) group.index = Math.min(group.rows.length - 1, group.index + 1);
if (operation === 4) group.index = group.rows.length - 1;
render(section === 1 ? "EAR" : "NEG");
};
window.addRemarks = (section, elementId) => {
const group = state[section === 1 ? "EAR" : "NEG"];
const record = group.rows[group.index];
if (!record) return notify("warning", "No match found.", "DDP-4001");
const current = value(elementId).trim();
value(elementId, `${current}${current ? "\n\n" : ""}${record.remarks || ""}`);
};
window.editRemarks = (elementId, section) => {
const group = state[section === 1 ? "EAR" : "NEG"];
const remarks = group.rows[group.index]?.remarks;
if (remarks && window.confirm("Remove the selected match remarks?")) {
value(elementId, value(elementId).replace(remarks, "").trim());
}
};
form.addEventListener("submit", async (event) => {
event.preventDefault();
const body = {
uuid: value("uuid"), sessuuid: value("sessuuid"),
earremarks: value("earremarks"), negremarks: value("negremarks")
};
try {
const response = await fetch(form.action, {
method: "POST", credentials: "same-origin",
headers: { "Content-Type": "application/json", Accept: "application/json" },
body: JSON.stringify(body)
});
const payload = await response.json();
if (!response.ok || !payload.success) throw payload.message || {};
notify("success", payload.message.message, payload.message.code);
window.setTimeout(() => window.MatrixDialog?.close(1), 300);
} catch (error) {
notify("danger", error.message || "Dedupe details could not be saved.", error.code, error.referenceId);
}
});
load();
})();

View File

@@ -1,127 +0,0 @@
(function (window, document) {
"use strict";
const endpoint = "/matrix/ver/checkdedupe";
const operations = [
{ id: 1, field: "earlier", label: "Earlier" },
{ id: 2, field: "negative", label: "Negative" }
];
function expandList(id) {
const child = document.getElementById(`${id}child`);
if (child) child.style.display = child.style.display === "none" ? "table-row" : "none";
}
function notify(type, code, message) {
window.CygnusNotifications?.show({ type, code, message, duration: 5000 });
}
function createProgress(label) {
const group = document.createElement("div");
group.className = "mb-3";
group.innerHTML = `<div class="d-flex justify-content-between mb-1"><strong>${label}</strong><span>Waiting</span></div>
<div class="progress" role="progressbar" aria-valuemin="0" aria-valuemax="100">
<div class="progress-bar" style="width:0%"></div>
</div>`;
return group;
}
function createDialog() {
document.getElementById("dedupe-run-modal")?.remove();
const root = document.createElement("div");
root.id = "dedupe-run-modal";
root.className = "modal fade";
root.tabIndex = -1;
root.innerHTML = `<div class="modal-dialog modal-dialog-centered"><div class="modal-content">
<div class="modal-header"><h5 class="modal-title">Checking Earlier and Negative</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button></div>
<div class="modal-body"></div><div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary js-start">Start</button></div></div></div>`;
const body = root.querySelector(".modal-body");
operations.forEach(operation => body.append(createProgress(operation.label)));
document.body.append(root);
return root;
}
function updateProgress(container, processed, total, counters) {
const percent = total === 0 ? 100 : Math.round((processed / total) * 100);
container.querySelector(".progress-bar").style.width = `${percent}%`;
container.querySelector("span").textContent =
`${processed}/${total} | Success ${counters.success} | Failed ${counters.failed} | Skipped ${counters.skipped}`;
}
async function check(row, operation) {
const response = await fetch(endpoint, {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-CSRF-TOKEN": document.getElementById("dedupe-csrf-token")?.value || ""
},
body: JSON.stringify({
documentCaseId: row.dataset.documentCaseId,
operation: operation.id
})
});
const payload = await response.json().catch(() => null);
if (!response.ok || !payload?.success) {
throw new Error(payload?.message?.message || "Dedupe check failed");
}
}
async function runOperation(rows, operation, progress) {
const counters = { success: 0, failed: 0, skipped: 0 };
for (let index = 0; index < rows.length; index += 1) {
const row = rows[index];
const statusCell = row.querySelector(`td[id$="${operation.field === "earlier" ? "ear" : "neg"}"]`);
if (row.dataset[operation.field] !== "Y") {
counters.skipped += 1;
} else {
try {
await check(row, operation);
counters.success += 1;
row.dataset[operation.field] = "D";
if (statusCell) {
statusCell.textContent = "D";
statusCell.classList.add("table-success");
}
} catch (error) {
counters.failed += 1;
if (statusCell) {
statusCell.textContent = "F";
statusCell.title = error.message;
statusCell.classList.add("table-danger");
}
}
}
updateProgress(progress, index + 1, rows.length, counters);
}
return counters;
}
async function run(tableId, modalRoot) {
const rows = Array.from(document.querySelectorAll(`#${CSS.escape(tableId)} tbody tr[data-document-case-id]`));
if (rows.length === 0) {
notify("info", "DDP-2002", "The selected list has no records to process.");
return;
}
const start = modalRoot.querySelector(".js-start");
start.disabled = true;
const progress = modalRoot.querySelectorAll(".modal-body > div");
for (let index = 0; index < operations.length; index += 1) {
await runOperation(rows, operations[index], progress[index]);
}
start.disabled = false;
notify("success", "DDP-2001", "Earlier and negative dedupe checks completed.");
}
document.addEventListener("click", event => {
const runButton = event.target.closest(".js-run-dedupe");
if (!runButton) return;
const modalRoot = createDialog();
modalRoot.querySelector(".js-start").addEventListener("click", () => run(runButton.dataset.table, modalRoot));
window.bootstrap.Modal.getOrCreateInstance(modalRoot).show();
});
window.ExpandList = expandList;
}(window, document));

View File

@@ -1,42 +0,0 @@
(() => {
"use strict";
const form = document.getElementById("senddedupe");
const table = document.getElementById("casetobesend");
const portfolio = document.getElementById("portlist");
const generate = document.getElementById("btngenreport");
if (!form || !table || !portfolio) return;
const checks = () => [...table.querySelectorAll('tbody input[type="checkbox"]')];
const sync = () => {
const selected = checks().filter((item) => item.checked);
document.getElementById("hfdelstat").value = selected.map((item) => item.value).join(",");
document.getElementById("selall").checked = selected.length > 0 && selected.length === checks().length;
};
portfolio.addEventListener("change", () => {
form.action = form.dataset.listUrl;
form.requestSubmit();
});
document.getElementById("selall")?.addEventListener("change", (event) => {
checks().forEach((item) => { item.checked = event.target.checked; });
sync();
});
table.addEventListener("change", sync);
table.addEventListener("click", (event) => {
const row = event.target.closest("tr[data-case-id]");
if (row && event.target.type !== "checkbox") row.querySelector('input[type="checkbox"]')?.click();
});
generate?.addEventListener("click", () => {
sync();
if (!document.getElementById("hfdelstat").value) {
window.CygnusNotifications?.show({
type: "warning", code: "DDP-4002", message: "Select at least one application."
});
return;
}
form.action = form.dataset.generateUrl;
form.requestSubmit();
});
if (!checks().length) generate?.setAttribute("hidden", "hidden");
sync();
})();

View File

@@ -218,6 +218,30 @@ public class Ajax {
}
return smsStatus;
}
//--> Running Earlier / Negative Dedupe
@RequestMapping(value="checkdedupe",method=RequestMethod.GET )
public @ResponseBody String checkDedupe(@RequestParam String val, @RequestParam String val1, @RequestParam String val2, @RequestParam String val3)
{
String DedCheckOn=GlobalClass.DateTime("yyyy/MM/dd HH:mm:ss", new java.util.Date());
DBFunctions DBF=new DBFunctions("1007");
DBF.setProcessFlag(true);
String response="failed:";
response=DBF.FetchRunQuery(43, (val+GlobalClass.ColDelim+val1+GlobalClass.ColDelim+val2+GlobalClass.ColDelim+DedCheckOn+GlobalClass.ColDelim+val3+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
response=response.replace(GlobalClass.ColDelim+GlobalClass.RowDelim, "");
return response;
}
//<-- Running Earlier / Negative Dedupe Ends
//--> Earlier / Negative Dedupe Do
@RequestMapping(value="deduperecords",method=RequestMethod.GET )
public @ResponseBody String DedupeRecords(@RequestParam String uuid)
{
DBFunctions DBF=new DBFunctions("1008");
DBF.setProcessFlag(true);
String response="failed:";
response=DBF.FetchRunQuery(56, (uuid+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
response=response.replace(GlobalClass.ColDelim+GlobalClass.RowDelim, GlobalClass.RowDelim);
return response;
}
////<--- OPERATOR ALLOCATION DE ALLOCATION -->
@RequestMapping(value="optralloc",method=RequestMethod.GET )
public @ResponseBody String OprAlloc(@RequestParam String val,@RequestParam String val1,@RequestParam String val2,@RequestParam String val3,@RequestParam String val4,@ModelAttribute(value="Sessvals") Session Sessvals)

View File

@@ -0,0 +1,276 @@
package matrix.nimble.edp.cutoff.controller;
//servlet libraries
import java.util.concurrent.TimeUnit;
import javax.naming.Reference;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpSession;
//spring libraries
import matrix.nimble.edp.cutoff.model.Allocation;
import matrix.nimble.edp.cutoff.model.PhotoCases;
import matrix.nimble.edp.cutoff.model.ReferenceSheet;
import matrix.nimble.edp.cutoff.model.SendToOperation;
import matrix.nimble.edp.cutoff.model.Telesheet;
import matrix.nimble.edp.cutoff.model.CutOffList;
import matrix.nimble.model.Session;
import matrix.nimble.utilities.GlobalClass;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.SessionAttributes;
@Controller
@SessionAttributes({"Sessvals"})
public class CutOff {
//---> Start Cut
@RequestMapping(value="cutoff",method=RequestMethod.POST )
public String OpenCutOff(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
CutOffList CList=new CutOffList();
CList.setErrCode("1003");
String UUID=GlobalClass.GenerateUUID();
session.setAttribute("UUID", UUID);
CList.setSessUUID(UUID);
model.addAttribute("cutOff",CList.getCutOffList(Sessvals.getCompanyID(), Sessvals.getBranchID(),Sessvals.getUserID()));
model.addAttribute("Sessvals",Sessvals);
return "edp/cutoff/cutoff";
}
@RequestMapping(value="savecut",method=RequestMethod.POST )
public String StartCut(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="cutOff") CutOffList CList,HttpSession session)
{
CList.setErrCode("1003");
if(session.getAttribute("UUID").toString().equals(CList.getSessUUID()))
{
CList.FinalizeCutoffList(Sessvals.getUserID(),Sessvals.getCompanyID(), Sessvals.getBranchID());
}
else
{
CList.setProcessFlag(true);
CList.setErrMsg("");
}
if(CList.isProcessFlag())
{
CutOffList BlankClist=new CutOffList();
BlankClist.setErrMsg(CList.getErrMsg());
BlankClist.setProcessFlag(false);
model.addAttribute("cutOff",BlankClist);
}
else
{
model.addAttribute("cutOff",CList);
}
model.addAttribute("Sessvals",Sessvals);
return "edp/cutoff/cutoff";
}
//<--- Start Cut Ends
//---> Allocation
@RequestMapping(value="allocation",method=RequestMethod.POST )
public String Allocation(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
Allocation AList=new Allocation();
AList.setErrCode("1004");
String UUID=GlobalClass.GenerateUUID();
session.setAttribute("UUID", UUID);
AList.setSessUUID(UUID);
model.addAttribute("allocation",AList.getAllocList(Sessvals.getCompanyID(), Sessvals.getBranchID(),Sessvals.getUserID()));
model.addAttribute("Sessvals",Sessvals);
return "edp/cutoff/allocation";
}
@RequestMapping(value="savealloc",method=RequestMethod.POST )
public String SaveAlloc(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="allocation") Allocation AList,HttpSession session)
{
AList.setErrCode("1004");
if(session.getAttribute("UUID").toString().equals(AList.getSessUUID()))
{
AList.FinalizeAllocation(Sessvals.getUserID(),Sessvals.getCompanyID(), Sessvals.getBranchID());
}
else
{
AList.setProcessFlag(true);
AList.setErrMsg("");
}
if(AList.isProcessFlag())
{
Allocation BlankAlloc=new Allocation();
BlankAlloc.setErrMsg(AList.getErrMsg());
BlankAlloc.setProcessFlag(false);
model.addAttribute("allocation",BlankAlloc);
}
else
{
model.addAttribute("allocation",AList);
}
model.addAttribute("Sessvals",Sessvals);
return "edp/cutoff/allocation";
}
//<--- Allocation Ends
//---> Telesheet
@RequestMapping(value="telesheet",method=RequestMethod.POST )
public String Telesheet(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
Telesheet TList=new Telesheet();
TList.setErrCode("1006");
String UUID=GlobalClass.GenerateUUID();
session.setAttribute("UUID", UUID);
TList.setSessUUID(UUID);
model.addAttribute("telesheet",TList.getTeleList(Sessvals.getCompanyID(), Sessvals.getBranchID(),Sessvals.getUserID()));
model.addAttribute("Sessvals",Sessvals);
return "edp/cutoff/telesheet";
}
@RequestMapping(value="gentelesheet",method=RequestMethod.POST )
public String GenTelesheet(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="telesheet") Telesheet TList,HttpSession session)
{
String Rootdir= request.getServletContext().getRealPath("/");
TList.setErrCode("1006");
if(session.getAttribute("UUID").toString().equals(TList.getSessUUID()))
{
TList.FinalizeTeleSheet(Sessvals.getUserID(),Sessvals.getCompanyID(), Sessvals.getBranchID(),Rootdir);
}
else
{
TList.setProcessFlag(true);
TList.setErrMsg("");
}
if(TList.isProcessFlag())
{
Telesheet BlankTList=new Telesheet();
BlankTList.setTelePDFLink(TList.getTelePDFLink());
BlankTList.setErrMsg(TList.getErrMsg());
BlankTList.setProcessFlag(false);
model.addAttribute("telesheet",BlankTList);
}
else
{
model.addAttribute("telesheet",TList);
}
model.addAttribute("Sessvals",Sessvals);
return "edp/cutoff/telesheet";
}
//<--- Telesheet Ends
//---> Referencesheet
@RequestMapping(value="refsheet",method=RequestMethod.POST )
public String Refsheet(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
ReferenceSheet RList=new ReferenceSheet();
RList.setErrCode("1006");
String UUID=GlobalClass.GenerateUUID();
session.setAttribute("UUID", UUID);
RList.setSessUUID(UUID);
model.addAttribute("refsheet",RList.getRefList(Sessvals.getCompanyID(), Sessvals.getBranchID(),Sessvals.getUserID()));
model.addAttribute("Sessvals",Sessvals);
return "edp/cutoff/referencesheet";
}
@RequestMapping(value="genrefsheet",method=RequestMethod.POST )
public String GenRefsheet(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="refsheet") ReferenceSheet RList,HttpSession session)
{
String Rootdir= request.getServletContext().getRealPath("/");
RList.setErrCode("1006");
if(session.getAttribute("UUID").toString().equals(RList.getSessUUID()))
{
RList.FinalizeRefList(Sessvals.getUserID(),Sessvals.getCompanyID(), Sessvals.getBranchID(),Rootdir);
}
else
{
RList.setProcessFlag(true);
RList.setErrMsg("");
}
if(RList.isProcessFlag())
{
ReferenceSheet BlankRList=new ReferenceSheet();
BlankRList.setTelePDFLink(RList.getTelePDFLink());
BlankRList.setErrMsg(RList.getErrMsg());
BlankRList.setProcessFlag(false);
model.addAttribute("refsheet",BlankRList);
}
else
{
model.addAttribute("telesheet",RList);
}
model.addAttribute("Sessvals",Sessvals);
return "edp/cutoff/referencesheet";
}
//<--- Telesheet Ends
//---> Send To Operation
@RequestMapping(value="sendtoopr",method=RequestMethod.POST )
public String GatherCaseList(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
SendToOperation Sopr=new SendToOperation();
Sopr.setErrCode("1007");
String UUID=GlobalClass.GenerateUUID();
session.setAttribute("UUID", UUID);
Sopr.setSessUUID(UUID);
Sopr=Sopr.getRecordList(Sessvals.getCompanyID(), Sessvals.getBranchID(),Sessvals.getUserID());
model.addAttribute("sendtoopr",Sopr);
model.addAttribute("Sessvals",Sessvals);
return "edp/cutoff/sendtoopr";
}
@RequestMapping(value="sendcasestoopr",method=RequestMethod.POST )
public String SendToOpr(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="sendtoopr") SendToOperation Sopr,HttpSession session)
{
Sopr.setErrCode("1004");
if(session.getAttribute("UUID").toString().equals(Sopr.getSessUUID()))
{
Sopr.SendToOpr(Sessvals.getUserID(),Sessvals.getCompanyID(), Sessvals.getBranchID());
}
else
{
Sopr.setProcessFlag(true);
Sopr.setErrMsg("");
}
if(Sopr.isProcessFlag())
{
SendToOperation BSopr=new SendToOperation();
BSopr.setErrMsg(Sopr.getErrMsg());
BSopr.setProcessFlag(false);
model.addAttribute("sendtoopr",BSopr);
}
else
{
model.addAttribute("sendtoopr",Sopr);
}
model.addAttribute("Sessvals",Sessvals);
return "edp/cutoff/sendtoopr";
}
//<--- Send To Operation Ends
//---> Generate F-SAM List Starts
@RequestMapping(value="photocases",method=RequestMethod.POST )
public String PhotoCaseList(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
String UUID=GlobalClass.GenerateUUID();
session.setAttribute("UUID", UUID);
PhotoCases pc=new PhotoCases();
pc.setProcessFlag(true);
pc.setErrCode("16001");
pc.setSessUUID(UUID);
model.addAttribute("caselist",pc.getPhotoCaseList(Sessvals.getBranchID()));
model.addAttribute("pcases",pc);
model.addAttribute("Sessvals",Sessvals);
return "edp/cutoff/mnimblepcases";
}
//<--- Generate F-SAM List Ends
//---> Finalize F-SAM List Starts
@RequestMapping(value="finalizepcases",method=RequestMethod.POST )
public @ResponseBody String PhotoCaseGenerated(@RequestParam String val0,@RequestParam String val1,@RequestParam String val2)
{
String OprTime=GlobalClass.DateTime("yyyy/MM/dd HH:mm:ss", new java.util.Date());
String [] Qvals=new String[4];
Qvals[0]=val0;
Qvals[1]=val1.trim().endsWith("R") ? "res":(val1.trim().endsWith("O") ? "off" : "pro");
Qvals[2]=val2;
Qvals[3]=OprTime;
PhotoCases pc=new PhotoCases();
pc.setProcessFlag(true);
pc.setErrCode("16001");
return pc.FinalizePhotoCaseList(Qvals);
}
//<--- Finalize F-SAM List Ends
}

View File

@@ -1,139 +0,0 @@
package matrix.nimble.edp.cutoff.controller;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;
import lib.models.Allocation;
import lib.models.CutOffList;
import lib.models.ReferenceSheet;
import lib.models.SendToOperation;
import lib.models.Telesheet;
import lib.models.UserSession;
import matrix.nimble.controller.AbstractAuthenticatedController;
import matrix.services.commons.CommonErrorService;
import matrix.services.commons.CommonService;
import matrix.services.edp.CutoffService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
public class CutOffController extends AbstractAuthenticatedController {
private final CutoffService cutoffService;
public CutOffController(CommonService commonService, CommonErrorService errorService,
CutoffService cutoffService) {
super(commonService, errorService);
this.cutoffService = cutoffService;
}
@RequestMapping(value = "cutoff", method = RequestMethod.POST)
public String cutoff(ModelMap model, HttpSession session, HttpServletResponse response) {
PageAuthorization auth = authorizePage("cutoff", model, session, response);
if (!auth.isGranted()) return auth.viewName();
model.addAttribute("cutOff", cutoffService.loadCutoff(auth.session()));
return "edp/cutoff/cutoff";
}
@RequestMapping(value = "savecut", method = RequestMethod.POST)
public String saveCut(@ModelAttribute("cutOff") CutOffList request, ModelMap model,
HttpSession session, HttpServletResponse response) {
PageAuthorization auth = authorizePage("cutoff", model, session, response);
if (!auth.isGranted()) return auth.viewName();
model.addAttribute("cutOff", cutoffService.saveCutoff(auth.session(), request));
return "edp/cutoff/cutoff";
}
@RequestMapping(value = "allocation", method = RequestMethod.POST)
public String allocation(ModelMap model, HttpSession session, HttpServletResponse response) {
PageAuthorization auth = authorizePage("allocation", model, session, response);
if (!auth.isGranted()) return auth.viewName();
model.addAttribute("allocation", cutoffService.loadAllocation(auth.session()));
return "edp/cutoff/allocation";
}
@RequestMapping(value = "savealloc", method = RequestMethod.POST)
public String saveAllocation(@ModelAttribute("allocation") Allocation request, ModelMap model,
HttpSession session, HttpServletResponse response) {
PageAuthorization auth = authorizePage("allocation", model, session, response);
if (!auth.isGranted()) return auth.viewName();
model.addAttribute("allocation", cutoffService.saveAllocation(auth.session(), request));
return "edp/cutoff/allocation";
}
@RequestMapping(value = "telesheet", method = RequestMethod.POST)
public String telesheet(ModelMap model, HttpSession session, HttpServletResponse response) {
PageAuthorization auth = authorizePage("telesheet", model, session, response);
if (!auth.isGranted()) return auth.viewName();
model.addAttribute("telesheet", cutoffService.loadTelesheet(auth.session()));
return "edp/cutoff/telesheet";
}
@RequestMapping(value = "gentelesheet", method = RequestMethod.POST)
public String generateTelesheet(@ModelAttribute("telesheet") Telesheet request,
ModelMap model, HttpServletRequest servletRequest, HttpSession session,
HttpServletResponse response) {
PageAuthorization auth = authorizePage("telesheet", model, session, response);
if (!auth.isGranted()) return auth.viewName();
model.addAttribute("telesheet", cutoffService.generateTelesheet(auth.session(), request,
servletRequest.getServletContext().getRealPath("/")));
return "edp/cutoff/telesheet";
}
@RequestMapping(value = "refsheet", method = RequestMethod.POST)
public String referenceSheet(ModelMap model, HttpSession session, HttpServletResponse response) {
PageAuthorization auth = authorizePage("refsheet", model, session, response);
if (!auth.isGranted()) return auth.viewName();
model.addAttribute("refsheet", cutoffService.loadReferenceSheet(auth.session()));
return "edp/cutoff/referencesheet";
}
@RequestMapping(value = "genrefsheet", method = RequestMethod.POST)
public String generateReferenceSheet(@ModelAttribute("refsheet") ReferenceSheet request,
ModelMap model, HttpServletRequest servletRequest, HttpSession session,
HttpServletResponse response) {
PageAuthorization auth = authorizePage("refsheet", model, session, response);
if (!auth.isGranted()) return auth.viewName();
model.addAttribute("refsheet", cutoffService.generateReferenceSheet(auth.session(), request,
servletRequest.getServletContext().getRealPath("/")));
return "edp/cutoff/referencesheet";
}
@RequestMapping(value = "sendtoopr", method = RequestMethod.POST)
public String sendToOperation(ModelMap model, HttpSession session, HttpServletResponse response) {
PageAuthorization auth = authorizePage("sendtoopr", model, session, response);
if (!auth.isGranted()) return auth.viewName();
model.addAttribute("sendtoopr", cutoffService.loadSendToOperation(auth.session()));
return "edp/cutoff/sendtoopr";
}
@RequestMapping(value = "sendcasestoopr", method = RequestMethod.POST)
public String saveSendToOperation(@ModelAttribute("sendtoopr") SendToOperation request,
ModelMap model, HttpSession session, HttpServletResponse response) {
PageAuthorization auth = authorizePage("sendtoopr", model, session, response);
if (!auth.isGranted()) return auth.viewName();
model.addAttribute("sendtoopr", cutoffService.sendToOperation(auth.session(), request));
return "edp/cutoff/sendtoopr";
}
@RequestMapping(value = "photocases", method = RequestMethod.POST)
public String photoCases(ModelMap model, HttpSession session, HttpServletResponse response) {
PageAuthorization auth = authorizePage("photocases", model, session, response);
if (!auth.isGranted()) return auth.viewName();
cutoffService.populatePhotoCases(model, auth.session());
return "edp/cutoff/mnimblepcases";
}
@RequestMapping(value = "finalizepcases", method = RequestMethod.POST)
@ResponseBody
public String finalizePhotoCase(@RequestParam String val0, @RequestParam String val1,
@RequestParam String val2, HttpSession session) {
ApiAuthorization auth = authorizeApiPage("photocases", session);
if (!auth.isGranted()) return "error:" + auth.error().getMessage();
return cutoffService.finalizePhotoCase(auth.session(), val0, val1, val2);
}
}

View File

@@ -3,8 +3,16 @@ package matrix.nimble.edp.cutoff.model;
import java.util.ArrayList;
import java.util.List;
import matrix.nimble.edp.output.model.ReportOutput;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.StringFunctions;
import org.apache.commons.collections.FactoryUtils;
import org.apache.commons.collections.list.LazyList;
public class ReferenceSheet {
private List<CutOffRecord> tvrlist = new ArrayList<>();
private List<CutOffRecord> tvrlist = LazyList.decorate(new ArrayList(),FactoryUtils.instantiateFactory(CutOffRecord.class));
private String TeleSheetTime;
private String ErrMsg;
private String ErrDesc;
@@ -61,4 +69,177 @@ public class ReferenceSheet {
public void setTelePDFLink(String telePDFLink) {
TelePDFLink = telePDFLink;
}
public Telesheet getRefList(String CompanyId,String BranchId,String UserId)
{
Telesheet TList=new Telesheet();
StringFunctions StrFunc=new StringFunctions(getErrCode());
DBFunctions DBF=new DBFunctions(getErrCode());
DBF.setProcessFlag(true);
String [] Vals=(CompanyId+GlobalClass.ColDelim+BranchId+GlobalClass.ColDelim+UserId+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
DBF.FetchRunQuery(216, Vals);
if(DBF.isProcessFlag())
{
String ResultData=DBF.FetchRunQuery(217, Vals); //Generating list of portfolios those reference sheet to be generated
if(DBF.isProcessFlag())
{
String [][] TvrListData=StrFunc.ConverTo2DArray(ResultData, GlobalClass.RowDelim, GlobalClass.ColDelim);
ArrayList<CutOffRecord> Record=new ArrayList<CutOffRecord>();
for(int RecCount=0;RecCount<TvrListData.length;RecCount++)
{
DBF.setProcessFlag(true);
CutOffRecord CORec=new CutOffRecord();
CORec.setPortfolioid(TvrListData[RecCount][0]);
CORec.setPortname(TvrListData[RecCount][1]);
CORec.setTotref(Integer.parseInt(TvrListData[RecCount][2]));
CORec.setIslocked(Integer.parseInt(TvrListData[RecCount][3]));
if(CORec.getIslocked() > 0)
{
CORec.setTv(false);
}
else
{
CORec.setTv(Integer.parseInt(TvrListData[RecCount][4])<=0 ? false:true);
}
CORec.setLockedby(TvrListData[RecCount][5]);
CORec.setRepformat(TvrListData[RecCount][6]);
CORec.setRepfunction(TvrListData[RecCount][7]);
//Collecting records for sublist
String [] Vals1=(CompanyId+GlobalClass.ColDelim+BranchId+GlobalClass.ColDelim+UserId+GlobalClass.ColDelim+CORec.getPortfolioid()+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
String ResultData1=DBF.FetchRunQuery(218, Vals1); //Generating sublist records
if(DBF.isProcessFlag())
{
String [][] SubListData=StrFunc.ConverTo2DArray(ResultData1, GlobalClass.RowDelim, GlobalClass.ColDelim);
ArrayList<CutOffRecord> SubRecord=new ArrayList<CutOffRecord>();
for(int ListCount=0;ListCount<SubListData.length;ListCount++)
{
CutOffRecord SCORec=new CutOffRecord();
SCORec.setMvcode(SubListData[ListCount][0]);
SCORec.setApplno(SubListData[ListCount][1]);
SCORec.setCustomername(SubListData[ListCount][2]);
SCORec.setApptype(SubListData[ListCount][3]);
SCORec.setTotref(Integer.parseInt(SubListData[ListCount][4]));
SCORec.setIslocked(Integer.parseInt(SubListData[ListCount][5]));
SCORec.setLockedby(SubListData[ListCount][6]);
SCORec.setTv(Integer.parseInt(SubListData[ListCount][7])<=0 ? false:true);
SCORec.setUuid(SubListData[ListCount][8]);
SubRecord.add(SCORec);
}
CORec.setSublist(SubRecord);
}
Record.add(CORec);
}
TList.setTvrlist(Record);
TList.setSessUUID(getSessUUID());
TList.setErrCode(getErrCode());
}
else
{
setProcessFlag(false);
setErrDesc(DBF.getErrDesc());
setErrMsg(DBF.getErrMsg());
TList.setErrDesc(DBF.getErrDesc());
TList.setErrMsg(DBF.getErrMsg());
TList.setErrCode(getErrCode());
}
}
else
{
setProcessFlag(false);
setErrDesc(DBF.getErrDesc());
setErrMsg(DBF.getErrMsg());
TList.setErrDesc(DBF.getErrDesc());
TList.setErrMsg(DBF.getErrMsg());
TList.setErrCode(getErrCode());
}
return TList;
}
public void FinalizeRefList(String UserId,String CompanyId,String BranchId,String RootPath)
{
String TeleSheetLink="";
setTelePDFLink("");
setProcessFlag(true);
//---> Refsheet status
int TotRef=0;
int TotRefGen=0;
int TotRefFailed=0;
setTeleSheetTime(new StringFunctions(getErrCode()).FormatDate("yyyy/MM/dd HH:mm:ss", new java.util.Date()));
//<--- Refsheet status ends
DBFunctions DBF=new DBFunctions(getErrCode());
int PortList=getTvrlist().size();
String [][] TeleCutList=new String[PortList][6];
int CutListIndx=0;
for(int LIndx=0;LIndx<PortList;LIndx++)
{
CutOffRecord TvrRec=(CutOffRecord)getTvrlist().get(LIndx);
TeleCutList[LIndx][4]="empty";
if (TvrRec.getIslocked()==0 && TvrRec.isTv())
{
int SubList=TvrRec.getSublist().size();
// Filling list of portfolios and their respective tele format
TeleCutList[CutListIndx][0]=TvrRec.getPortfolioid();
TeleCutList[CutListIndx][1]=getTeleSheetTime();
TeleCutList[CutListIndx][2]=TvrRec.getRepformat();
TeleCutList[CutListIndx][3]=UserId;
TeleCutList[CutListIndx][5]=TvrRec.getRepfunction();
//<--- Ends
for(int SIndx=0;SIndx<SubList;SIndx++)
{
CutOffRecord SubRec=(CutOffRecord)TvrRec.getSublist().get(SIndx);
if(SubRec.isTv())
{
TeleCutList[CutListIndx][4]="notempty";
TotRef=TotRef+SubRec.getTotref();
}
DBF.setProcessFlag(true);
String Query="";
Query=Query+""+(SubRec.isTv() ? UserId:0)+""+GlobalClass.ColDelim;
Query=Query+""+(SubRec.isTv() ? getTeleSheetTime():"NULL")+""+GlobalClass.ColDelim;
Query=Query+""+(SubRec.isTv() ? UserId:"NULL")+""+GlobalClass.ColDelim;
Query=Query+""+SubRec.getUuid()+""+GlobalClass.ColDelim;
String Temp=DBF.FetchRunQuery(219, Query.split(GlobalClass.ColDelim));
if(DBF.isProcessFlag())
{
if(SubRec.isTv())
{
TotRefGen=TotRefGen+SubRec.getTotref();
}
}
else
{
if(SubRec.isTv())
{
TotRefFailed=TotRefFailed+SubRec.getTotref();;
}
}
}
CutListIndx=CutListIndx+1;
}
}
if (TotRefGen > 0)
{
ReportOutput TS=new ReportOutput();
TS.setProcessFlag(true);
TS.setErrCode(getErrCode());
TeleSheetLink=TS.GenerateCallingSheet(TeleCutList,GlobalClass.getStoragePath(),CompanyId,BranchId,"refsheet");
if(!TS.isProcessFlag())
{
setProcessFlag(false);
setErrMsg(TS.getErrMsg());
setErrDesc(TS.getErrDesc());
}
else
{
setProcessFlag(true);
setErrMsg(getErrCode()+"TSGEN:Info:Referencesheet generated successfully. Please use link in a page to open Tele Sheet.");
setTelePDFLink(GlobalClass.DocServer+TeleSheetLink);
DBF.FetchRunQuery(103, (getTeleSheetTime()+GlobalClass.ColDelim+"telesheet"+GlobalClass.ColDelim+TeleSheetLink+GlobalClass.ColDelim+BranchId+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
}
}
else
{
setProcessFlag(true);
setErrMsg(getErrCode()+"ETLST:Error:No records found to generate Tele Sheet.");
}
}
}

View File

@@ -0,0 +1,234 @@
package matrix.nimble.edp.dedupe.controller;
//servlet libraries
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpSession;
//spring libraries
import matrix.nimble.edp.dedupe.model.DedupeDetails;
import matrix.nimble.edp.dedupe.model.DedupeDo;
import matrix.nimble.edp.dedupe.model.DedupeHandler;
import matrix.nimble.edp.dedupe.model.DedupeRun;
import matrix.nimble.edp.dedupe.model.SendDedupe;
import matrix.nimble.edp.punching.model.CaseGrid;
import matrix.nimble.model.Session;
import matrix.nimble.operation.output.model.BankReportHandler;
import matrix.nimble.operation.output.model.ReportSettings;
import matrix.nimble.operation.reporting.model.ReportingHandler;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.ModuleFunctions;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.SessionAttributes;
@Controller
@SessionAttributes({"Sessvals"})
public class Dedupe {
//---> Run Dedupe
@RequestMapping(value="rundedupe",method=RequestMethod.POST )
public String OpenCutOff(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
DedupeRun DRun=new DedupeRun();
DRun.setErrCode("1007");
String UUID=GlobalClass.GenerateUUID();
session.setAttribute("UUID", UUID);
DRun.setSessUUID(UUID);
DRun.getDedList(Sessvals.getCompanyID(), Sessvals.getBranchID(), Sessvals.getUserID());
model.addAttribute("dedupeRun",DRun);
model.addAttribute("Sessvals",Sessvals);
return "edp/dedupe/deduperun";
}
//<--- Run Dedupe Ends
//---> Do Dedupe
@RequestMapping(value="dodedupe",method=RequestMethod.POST )
public String Allocation(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
String [][]CaseList=null;
DedupeDo Ddo= new DedupeDo();
Ddo.setErrCode("1008");
String UUID=GlobalClass.GenerateUUID();
session.setAttribute("UUID", UUID);
model.addAttribute("caseGrid",Ddo);
model.addAttribute("caseList",CaseList);
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("portlist",FillDedupePortList(Sessvals.getBranchID()));
return "edp/dedupe/dedupedo";
}
//<--- Do Dedupe Ends
//---> Dedupe Do Case List
@RequestMapping(value="dedupecaselist",method=RequestMethod.POST )
public String ListCases(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="caseGrid") CaseGrid caseGrid)
{
DedupeDo Ddo=new DedupeDo();
Ddo.setErrCode("1008");
Ddo.setPortfolioId(caseGrid.getPortfolioId());
String [][]CaseList=Ddo.FillCaseList(caseGrid.getPortfolioId());
if(Ddo.isProcessFlag())
{
model.addAttribute("caseList",CaseList);
model.addAttribute("caseGrid",Ddo);
}
else
{
caseGrid.setErrMsg(Ddo.getErrMsg());
model.addAttribute("caseList",CaseList);
model.addAttribute("caseGrid",Ddo);
}
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("portlist",FillDedupePortList(Sessvals.getBranchID()));
return "edp/dedupe/dedupedo";
}
//<--- Dedupe Do Case List Ends
//---> Found Records
@RequestMapping(value="dedupefound",method=RequestMethod.GET )
public String DedupeFound(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@RequestParam String rand,@RequestParam String uuid,HttpSession session)
{
DedupeHandler dedupeHandler=new DedupeHandler();
String uid=GlobalClass.GenerateUUID();
session.setAttribute("UUID", uid);
dedupeHandler.setErrCode("1008");
model.addAttribute("dedupeDetails",dedupeHandler.GetMatchFound(uuid,uid));
model.addAttribute("msg",dedupeHandler.getErrMsg());
model.addAttribute("status",dedupeHandler.isProcessFlag());
model.addAttribute("Sessvals",Sessvals);
return "edp/dedupe/matchfound";
}
//<--- Dedupe Do Found Records
//---> Found Records
@RequestMapping(value="updatededupe",method=RequestMethod.POST )
public String UpdateMatch(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="dedupeDetails") DedupeDetails dedupeDetails,HttpSession session)
{
DedupeHandler dedupeHandler=new DedupeHandler();
dedupeHandler.setErrCode("1008");
session.getAttribute("UUID");
if(!session.getAttribute("UUID").toString().equals(dedupeDetails.getSessuuid()))
{
dedupeHandler.setProcessFlag(true);
dedupeHandler.setErrMsg("");
}
else
{
dedupeHandler.UpdateDedupe(dedupeDetails,Sessvals.getUserID());
}
if(dedupeHandler.isProcessFlag())
{
dedupeHandler.setErrMsg("1008DEDUPD:info:Details saved successfully");
}
model.addAttribute("dedupeDetails",dedupeDetails);
model.addAttribute("msg",dedupeHandler.getErrMsg());
model.addAttribute("status",dedupeHandler.isProcessFlag());
model.addAttribute("Sessvals",Sessvals);
return "edp/dedupe/matchfound";
}
//<--- Dedupe Do Found Records
//---> Send Dedupe
@RequestMapping(value="senddedupe",method=RequestMethod.POST )
public String SendDedupe(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
DedupeHandler dedupeHandler=new DedupeHandler();
dedupeHandler.setErrCode("1008");
model.addAttribute("senddedupe",new matrix.nimble.edp.dedupe.model.SendDedupe());
model.addAttribute("portlist",new ModuleFunctions("1008").GetResultArray(134,(Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("msg",dedupeHandler.getErrMsg());
model.addAttribute("status",dedupeHandler.isProcessFlag());
model.addAttribute("Sessvals",Sessvals);
return "edp/dedupe/dedupesend";
}
//<--- End Send Dedupe
//---> Send Dedupe Fetch Case List
@RequestMapping(value="dedupetosend",method=RequestMethod.POST )
public String DedupeToSend(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="senddedupe") SendDedupe senddedupe,HttpSession session)
{
DedupeHandler dedupeHandler=new DedupeHandler();
dedupeHandler.setErrCode("1008");
dedupeHandler.SendDedupe(senddedupe);
String suuid=GlobalClass.GenerateUUID();
session.setAttribute("UUID", suuid);
senddedupe.setSuuid(suuid);
model.addAttribute("senddedupe",senddedupe);
model.addAttribute("portlist",new ModuleFunctions("1008").GetResultArray(134,(Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("msg",dedupeHandler.getErrMsg());
model.addAttribute("status",dedupeHandler.isProcessFlag());
model.addAttribute("Sessvals",Sessvals);
return "edp/dedupe/dedupesend";
}
//<--- End Send Dedupe Fetch Case List
//---> Send Dedupe Fetch Case List
@RequestMapping(value="senddedreports",method=RequestMethod.POST )
public String SendDedupeReports(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="senddedupe") SendDedupe senddedupe,HttpSession session)
{
BankReportHandler BRH=new BankReportHandler();
BRH.setErrCode("1008");
String suuid=GlobalClass.GenerateUUID();
if(!session.getAttribute("UUID").toString().equals(senddedupe.getSuuid()))
{
BRH.setProcessFlag(true);
BRH.setErrMsg("");
}
else
{
ReportSettings RS=new ReportSettings();
RS.setArchivebatch(false);
RS.setAttachannexure(false);
RS.setAutoemail(true);
RS.setDdformat(senddedupe.getFid());
RS.setDdqid(senddedupe.getDqid());
RS.setOffsaqid(0);
RS.setOrformat("0");
RS.setOrsaformat("0");
RS.setOvqid(0);
RS.setPortfolioid(senddedupe.getPortfolioid());
RS.setPrformat("0");
RS.setPvqid(0);
RS.setRefvqid(0);
RS.setRrformat("0");
RS.setRtrformat("0");
RS.setRvqid(0);
RS.setTracker("0");
RS.setTrackqid(0);
RS.setTrformat("0");
RS.setTvqid(0);
RS.setUuids(senddedupe.getUuids());
RS.setReportby("0");
RS.setReporttype("0");
RS.setPortname(senddedupe.getPortname());
RS.setPortsupervisor(senddedupe.getSupervisor());
String Rootdir= GlobalClass.getStoragePath()+"output/dedupe/"+Sessvals.getCompanyID()+"/"+Sessvals.getBranchID()+"/";
BRH.setProcessFlag(true);
BRH.setErrCode("5001");
BRH.setRunningmode("dedupesend");
BRH.setSignPath(request.getServletContext().getRealPath("/"));
BRH.setRootPath(Rootdir);
BRH.GenerateReport(RS,Sessvals.getUserID(),Sessvals.getBranchID());
if(BRH.isProcessFlag())
{
senddedupe.setUuids("");
senddedupe.setCaselist(null);
}
}
session.setAttribute("UUID", suuid);
model.addAttribute("senddedupe",senddedupe);
model.addAttribute("portlist",new ModuleFunctions("1008").GetResultArray(134,(Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("msg",BRH.getErrMsg());
model.addAttribute("status",BRH.isProcessFlag());
model.addAttribute("Sessvals",Sessvals);
return "edp/dedupe/dedupesend";
}
//<--- End Send Dedupe Fetch Case List
public String [][] FillPortList(String BranchId)
{
return new ModuleFunctions("1008").GetResultArray(3,(BranchId+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
}
//<--- End Send Dedupe Fetch Case List
public String [][] FillDedupePortList(String BranchId)
{
return new ModuleFunctions("1008").GetResultArray(446,(BranchId+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
}
}

View File

@@ -1,251 +0,0 @@
package matrix.nimble.edp.dedupe.controller;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;
import jakarta.servlet.http.HttpServletRequest;
import java.util.UUID;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import lib.constants.ApplicationMessage;
import lib.models.ApiResponse;
import lib.models.DedupeCheckData;
import lib.models.DedupeCheckRequest;
import lib.models.MessageDetails;
import lib.models.DedupeWorkspace;
import lib.models.DedupeDetails;
import lib.models.DedupeMatchRecord;
import lib.models.SendDedupe;
import lib.models.UserSession;
import matrix.nimble.controller.AbstractAuthenticatedController;
import matrix.services.commons.CommonErrorService;
import matrix.services.commons.CommonService;
import matrix.services.edp.DedupeService;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.List;
@Controller
public class DedupeController extends AbstractAuthenticatedController {
private static final String CSRF_SESSION_ATTRIBUTE = "dedupeCsrfToken";
private static final String MATCH_TOKEN_ATTRIBUTE = "dedupeMatchToken";
private static final String SEND_TOKEN_ATTRIBUTE = "dedupeSendToken";
private static final Logger LOGGER = Logger.getLogger(DedupeController.class.getName());
private final DedupeService dedupeService;
public DedupeController(CommonService commonService, CommonErrorService errorService,
DedupeService dedupeService) {
super(commonService, errorService);
this.dedupeService = dedupeService;
}
@RequestMapping(value = "rundedupe", method = RequestMethod.POST)
public String runDedupe(ModelMap model, HttpSession httpSession,
HttpServletResponse response) {
PageAuthorization authorization = authorizePage(
"rundedupe", model, httpSession, response);
if (!authorization.isGranted()) {
return authorization.viewName();
}
UserSession session = authorization.session();
String csrfToken = UUID.randomUUID().toString();
httpSession.setAttribute(CSRF_SESSION_ATTRIBUTE, csrfToken);
try {
model.addAttribute("dedupeRun", dedupeService.loadRun(session, csrfToken));
return "edp/dedupe/deduperun";
} catch (RuntimeException exception) {
LOGGER.log(Level.SEVERE, "Unable to load dedupe run", exception);
throw exception;
}
}
@RequestMapping(value = "checkdedupe", method = RequestMethod.POST,
consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
public ResponseEntity<ApiResponse<DedupeCheckData>> checkDedupe(
@RequestBody DedupeCheckRequest request,
@RequestHeader(value = "X-CSRF-TOKEN", required = false) String csrfToken,
HttpSession httpSession) {
ApiAuthorization authorization = authorizeApiPage("rundedupe", httpSession);
if (!authorization.isGranted()) {
return ResponseEntity.status(authorization.error().getHttpStatus())
.body(ApiResponse.failure(authorization.error()));
}
if (!validCsrf(httpSession, csrfToken)) {
MessageDetails error = new MessageDetails(ApplicationMessage.ACCESS_DENIED);
return ResponseEntity.status(error.getHttpStatus()).body(ApiResponse.failure(error));
}
try {
dedupeService.runCheck(authorization.session(), request.documentCaseId(), request.operation());
return ResponseEntity.ok(ApiResponse.success(
new DedupeCheckData(request.documentCaseId(), request.operation()),
new MessageDetails(ApplicationMessage.DEDUPE_CHECK_COMPLETED)));
} catch (IllegalArgumentException exception) {
MessageDetails error = new MessageDetails(ApplicationMessage.BAD_REQUEST);
return ResponseEntity.status(error.getHttpStatus()).body(ApiResponse.failure(error));
} catch (RuntimeException exception) {
LOGGER.log(Level.WARNING, "Dedupe check failed", exception);
MessageDetails error = new MessageDetails(ApplicationMessage.DEDUPE_CHECK_FAILED);
return ResponseEntity.status(error.getHttpStatus()).body(ApiResponse.failure(error));
}
}
private boolean validCsrf(HttpSession session, String suppliedToken) {
Object expected = session.getAttribute(CSRF_SESSION_ATTRIBUTE);
return expected instanceof String token && suppliedToken != null
&& MessageDigest.isEqual(token.getBytes(StandardCharsets.UTF_8),
suppliedToken.getBytes(StandardCharsets.UTF_8));
}
@RequestMapping(value = "dodedupe", method = RequestMethod.POST)
public String doDedupe(ModelMap model, HttpSession httpSession,
HttpServletResponse response) {
return showWorkspace(model, httpSession, response, null);
}
@RequestMapping(value = "dedupecaselist", method = RequestMethod.POST)
public String dedupeCaseList(@ModelAttribute("dedupeWorkspace") DedupeWorkspace request,
ModelMap model, HttpSession httpSession, HttpServletResponse response) {
return showWorkspace(model, httpSession, response, request.getPortfolioId());
}
private String showWorkspace(ModelMap model, HttpSession httpSession,
HttpServletResponse response, Integer portfolioId) {
PageAuthorization authorization = authorizePage(
"dodedupe", model, httpSession, response);
if (!authorization.isGranted()) {
return authorization.viewName();
}
model.addAttribute("dedupeWorkspace",
dedupeService.loadWorkspace(authorization.session(), portfolioId));
return "edp/dedupe/dedupedo";
}
@RequestMapping(value = "dedupefound", method = RequestMethod.GET)
public String dedupeFound(@RequestParam String uuid, ModelMap model,
HttpSession httpSession, HttpServletResponse response) {
PageAuthorization authorization = authorizePage("dodedupe", model, httpSession, response);
if (!authorization.isGranted()) return authorization.viewName();
String token = rotateToken(httpSession, MATCH_TOKEN_ATTRIBUTE);
model.addAttribute("dedupeDetails",
dedupeService.loadMatch(authorization.session(), uuid, token));
return "edp/dedupe/matchfound";
}
@RequestMapping(value = "deduperecords", method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
public ResponseEntity<ApiResponse<List<DedupeMatchRecord>>> dedupeRecords(
@RequestParam String uuid, HttpSession httpSession) {
ApiAuthorization authorization = authorizeApiPage("dodedupe", httpSession);
if (!authorization.isGranted()) {
return ResponseEntity.status(authorization.error().getHttpStatus())
.body(ApiResponse.failure(authorization.error()));
}
try {
return ResponseEntity.ok(ApiResponse.success(
dedupeService.loadMatchRecords(authorization.session(), uuid),
new MessageDetails(ApplicationMessage.DEDUPE_DETAILS_LOADED)));
} catch (IllegalArgumentException exception) {
MessageDetails error = new MessageDetails(ApplicationMessage.BAD_REQUEST);
return ResponseEntity.status(error.getHttpStatus()).body(ApiResponse.failure(error));
}
}
@RequestMapping(value = "updatededupe", method = RequestMethod.POST,
consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<ApiResponse<Void>> updateDedupe(@RequestBody DedupeDetails details,
HttpSession httpSession) {
ApiAuthorization authorization = authorizeApiPage("dodedupe", httpSession);
if (!authorization.isGranted()) {
return ResponseEntity.status(authorization.error().getHttpStatus())
.body(ApiResponse.failure(authorization.error()));
}
if (!validToken(httpSession, MATCH_TOKEN_ATTRIBUTE, details.getSessuuid())) {
MessageDetails error = new MessageDetails(ApplicationMessage.ACCESS_DENIED);
return ResponseEntity.status(error.getHttpStatus()).body(ApiResponse.failure(error));
}
try {
dedupeService.updateMatch(authorization.session(), details);
rotateToken(httpSession, MATCH_TOKEN_ATTRIBUTE);
return ResponseEntity.ok(ApiResponse.success(null,
new MessageDetails(ApplicationMessage.DEDUPE_DETAILS_SAVED)));
} catch (RuntimeException exception) {
LOGGER.log(Level.WARNING, "Unable to save dedupe details", exception);
MessageDetails error = new MessageDetails(ApplicationMessage.DEDUPE_CHECK_FAILED);
return ResponseEntity.status(error.getHttpStatus()).body(ApiResponse.failure(error));
}
}
@RequestMapping(value = "senddedupe", method = RequestMethod.POST)
public String sendDedupe(ModelMap model, HttpSession httpSession,
HttpServletResponse response) {
return showSendDedupe(model, httpSession, response, null);
}
@RequestMapping(value = "dedupetosend", method = RequestMethod.POST)
public String dedupeToSend(@ModelAttribute("senddedupe") SendDedupe request,
ModelMap model, HttpSession httpSession, HttpServletResponse response) {
return showSendDedupe(model, httpSession, response, request.getPortfolioid());
}
@RequestMapping(value = "senddedreports", method = RequestMethod.POST)
public String sendDedupeReports(@ModelAttribute("senddedupe") SendDedupe request,
ModelMap model, HttpServletRequest servletRequest, HttpSession httpSession,
HttpServletResponse response) {
PageAuthorization authorization = authorizePage("senddedupe", model, httpSession, response);
if (!authorization.isGranted()) return authorization.viewName();
if (!validToken(httpSession, SEND_TOKEN_ATTRIBUTE, request.getSuuid())) {
throw new IllegalArgumentException("The report form has expired");
}
dedupeService.generateDedupeReports(authorization.session(), request,
servletRequest.getServletContext().getRealPath("/"));
String token = rotateToken(httpSession, SEND_TOKEN_ATTRIBUTE);
SendDedupe refreshed = dedupeService.loadSendCases(
authorization.session(), request.getPortfolioid(), token);
model.addAttribute("senddedupe", refreshed);
model.addAttribute("portlist", dedupeService.loadSendPortfolios(authorization.session()));
model.addAttribute("status", true);
model.addAttribute("msg", "Reports generated successfully");
return "edp/dedupe/dedupesend";
}
private String showSendDedupe(ModelMap model, HttpSession httpSession,
HttpServletResponse response, Integer portfolioId) {
PageAuthorization authorization = authorizePage("senddedupe", model, httpSession, response);
if (!authorization.isGranted()) return authorization.viewName();
String token = rotateToken(httpSession, SEND_TOKEN_ATTRIBUTE);
model.addAttribute("senddedupe",
dedupeService.loadSendCases(authorization.session(), portfolioId, token));
model.addAttribute("portlist", dedupeService.loadSendPortfolios(authorization.session()));
return "edp/dedupe/dedupesend";
}
private String rotateToken(HttpSession session, String attribute) {
String token = UUID.randomUUID().toString();
session.setAttribute(attribute, token);
return token;
}
private boolean validToken(HttpSession session, String attribute, String suppliedToken) {
Object expected = session.getAttribute(attribute);
return expected instanceof String token && suppliedToken != null
&& MessageDigest.isEqual(token.getBytes(StandardCharsets.UTF_8),
suppliedToken.getBytes(StandardCharsets.UTF_8));
}
}

View File

@@ -0,0 +1,123 @@
package matrix.nimble.edp.dedupe.model;
import java.util.List;
public class DedupeDetails {
private String sessuuid;
private String uuid;
private String mvcode;
private String customername;
private String dob;
private String mobile;
private String resiaddress;
private String offaddress;
private String resiphone;
private String offphone;
private String earremarks;
private String negremarks;
private String category;
public String getSessuuid() {
return sessuuid;
}
public void setSessuuid(String sessuuid) {
this.sessuuid = sessuuid;
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public String getMvcode() {
return mvcode;
}
public void setMvcode(String mvcode) {
this.mvcode = mvcode;
}
public String getCustomername() {
return customername;
}
public void setCustomername(String customername) {
this.customername = customername;
}
public String getDob() {
return dob;
}
public void setDob(String dob) {
this.dob = dob;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getResiaddress() {
return resiaddress;
}
public void setResiaddress(String resiaddress) {
this.resiaddress = resiaddress;
}
public String getOffaddress() {
return offaddress;
}
public void setOffaddress(String offaddress) {
this.offaddress = offaddress;
}
public String getResiphone() {
return resiphone;
}
public void setResiphone(String resiphone) {
this.resiphone = resiphone;
}
public String getOffphone() {
return offphone;
}
public void setOffphone(String offphone) {
this.offphone = offphone;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getEarremarks() {
return earremarks;
}
public void setEarremarks(String earremarks) {
this.earremarks = earremarks;
}
public String getNegremarks() {
return negremarks;
}
public void setNegremarks(String negremarks) {
this.negremarks = negremarks;
}
}

View File

@@ -0,0 +1,70 @@
package matrix.nimble.edp.dedupe.model;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.StringFunctions;
public class DedupeDo {
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private boolean ProcessFlag;
private String PortfolioId;
private String UUID;
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public String getPortfolioId() {
return PortfolioId;
}
public void setPortfolioId(String portfolioId) {
PortfolioId = portfolioId;
}
public String getUUID() {
return UUID;
}
public void setUUID(String uUID) {
UUID = uUID;
}
public String[][] FillCaseList(String PortfolioID)
{
String [][]CaseList=null;
DBFunctions DBF=new DBFunctions(getErrCode());
DBF.setProcessFlag(true);
String ResultData=DBF.FetchRunQuery(53, (PortfolioID+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(DBF.isProcessFlag())
{
setProcessFlag(DBF.isProcessFlag());
CaseList=new StringFunctions(getErrCode()).ConverTo2DArray(ResultData, GlobalClass.RowDelim, GlobalClass.ColDelim);
}
else
{
setProcessFlag(false);
setErrMsg(DBF.getErrMsg());
setErrDesc(DBF.getErrDesc());
}
return CaseList;
}
}

View File

@@ -0,0 +1,111 @@
package matrix.nimble.edp.dedupe.model;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.StringFunctions;
public class DedupeHandler {
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private boolean ProcessFlag;
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public DedupeDetails GetMatchFound(String Uuid,String Sessuuid)
{
DedupeDetails dedupeDetails=new DedupeDetails();
dedupeDetails.setSessuuid(Sessuuid);
DBFunctions dbFunc=new DBFunctions(getErrCode());
dbFunc.setProcessFlag(true);
String ResultData=dbFunc.FetchRunQuery(54, (Uuid+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(dbFunc.isProcessFlag())
{
String [] Details=ResultData.split(GlobalClass.ColDelim);
dedupeDetails.setUuid(Uuid);
dedupeDetails.setCustomername(Details[1]);
dedupeDetails.setMvcode(Details[2]);
dedupeDetails.setDob(Details[3]);
dedupeDetails.setMobile(Details[4]);
dedupeDetails.setResiaddress(Details[5]);
dedupeDetails.setOffaddress(Details[6]);
dedupeDetails.setResiphone(Details[7]);
dedupeDetails.setOffphone(Details[8]);
dedupeDetails.setCategory(Details[9]);
setProcessFlag(true);
}
else
{
setProcessFlag(false);
setErrDesc(dbFunc.getErrDesc());
setErrMsg(dbFunc.getErrMsg());
}
return dedupeDetails;
}
public void UpdateDedupe(DedupeDetails dedupeDetails,String UserId)
{
StringFunctions strFunc=new StringFunctions(getErrCode());
String Dedruntime=strFunc.FormatDate("yyyy/MM/dd HH:mm:ss", new java.util.Date());
String [] QueryVals=new String[7];
QueryVals[0]=dedupeDetails.getUuid();
QueryVals[1]=dedupeDetails.getEarremarks().trim().replace("\n", "<br>");
QueryVals[2]=dedupeDetails.getNegremarks().trim().replace("\n", "<br>");
QueryVals[3]=dedupeDetails.getEarremarks().trim().replace("\n", "").length() > 10 ? "Y":"N";
QueryVals[4]=dedupeDetails.getNegremarks().trim().replace("\n", "").length() > 10 ? "Y":"N";
QueryVals[5]=Dedruntime;
QueryVals[6]=UserId;
DBFunctions dbFunc=new DBFunctions(getErrCode());
dbFunc.setProcessFlag(true);
dbFunc.FetchRunQuery(58, QueryVals);
setProcessFlag(dbFunc.isProcessFlag());
setErrMsg(dbFunc.getErrMsg());
setErrDesc(dbFunc.getErrDesc());
}
public void SendDedupe(SendDedupe senddedupe)
{
senddedupe.setCaselist(null);
DBFunctions dbf=new DBFunctions(getErrCode());
dbf.setProcessFlag(true);
dbf.FetchRunQuery(132, (senddedupe.getPortfolioid()+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(dbf.isProcessFlag())
{
senddedupe.setFid(dbf.getResultArray()[0][10]);
senddedupe.setDqid(Integer.parseInt(dbf.getResultArray()[0][11]));
senddedupe.setPortname(dbf.getResultArray()[0][12]);
senddedupe.setSupervisor(dbf.getResultArray()[0][13]);
senddedupe.setCaselist(dbf.getResultArray());
}
else
{
setProcessFlag(false);
setErrMsg(dbf.getErrMsg());
setErrDesc(dbf.getErrDesc());
}
}
public void GenerateSendDedupe(SendDedupe senddedupe)
{
}
}

View File

@@ -0,0 +1,123 @@
package matrix.nimble.edp.dedupe.model;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.collections.FactoryUtils;
import org.apache.commons.collections.list.LazyList;
public class DedupeRecord {
private List<DedupeRecord> sublist = LazyList.decorate(new ArrayList(),FactoryUtils.instantiateFactory(DedupeRecord.class));
private String cutoffon;
private int totaddr;
private int totcase;
private int islocked;
private String lockedby;
private String mvcode;
private String applno;
private String customername;
private String apptype;
private String uuid;
private int totrv;
private int totov;
private int totpv;
private String earlier;
private String negative;
public List<DedupeRecord> getSublist() {
return sublist;
}
public void setSublist(List<DedupeRecord> sublist) {
this.sublist = sublist;
}
public int getIslocked() {
return islocked;
}
public void setIslocked(int islocked) {
this.islocked = islocked;
}
public String getLockedby() {
return lockedby;
}
public void setLockedby(String lockedby) {
this.lockedby = lockedby;
}
public String getCutoffon() {
return cutoffon;
}
public void setCutoffon(String cutoffon) {
this.cutoffon = cutoffon;
}
public int getTotaddr() {
return totaddr;
}
public void setTotaddr(int totaddr) {
this.totaddr = totaddr;
}
public int getTotcase() {
return totcase;
}
public void setTotcase(int totcase) {
this.totcase = totcase;
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public String getMvcode() {
return mvcode;
}
public void setMvcode(String mvcode) {
this.mvcode = mvcode;
}
public String getApplno() {
return applno;
}
public void setApplno(String applno) {
this.applno = applno;
}
public String getCustomername() {
return customername;
}
public void setCustomername(String customername) {
this.customername = customername;
}
public String getApptype() {
return apptype;
}
public void setApptype(String apptype) {
this.apptype = apptype;
}
public int getTotrv() {
return totrv;
}
public void setTotrv(int totrv) {
this.totrv = totrv;
}
public int getTotov() {
return totov;
}
public void setTotov(int totov) {
this.totov = totov;
}
public int getTotpv() {
return totpv;
}
public void setTotpv(int totpv) {
this.totpv = totpv;
}
public String getEarlier() {
return earlier;
}
public void setEarlier(String earlier) {
this.earlier = earlier;
}
public String getNegative() {
return negative;
}
public void setNegative(String negative) {
this.negative = negative;
}
}

View File

@@ -0,0 +1,133 @@
package matrix.nimble.edp.dedupe.model;
import java.util.ArrayList;
import java.util.List;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.StringFunctions;
import org.apache.commons.collections.FactoryUtils;
import org.apache.commons.collections.list.LazyList;
public class DedupeRun {
private List<DedupeRecord> dedupelist = LazyList.decorate(new ArrayList(),
FactoryUtils.instantiateFactory(DedupeRecord.class));
private String DedcutTime;
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private String SessUUID;
private boolean ProcessFlag;
public List<DedupeRecord> getDedupelist() {
return dedupelist;
}
public String getDedcutTime() {
return DedcutTime;
}
public void setDedcutTime(String dedcutTime) {
DedcutTime = dedcutTime;
}
public void setDedupelist(List<DedupeRecord> allocationlist) {
this.dedupelist = allocationlist;
}
public String getSessUUID() {
return SessUUID;
}
public void setSessUUID(String sessUUID) {
SessUUID = sessUUID;
}
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public void getDedList(String CompanyId, String BranchId, String UserId) {
// DedupeRun DedList=new DedupeRun();
StringFunctions StrFunc = new StringFunctions(getErrCode());
setDedcutTime(StrFunc.FormatDate("yyyy/MM/dd HH:mm:ss",new java.util.Date()));
DBFunctions DBF = new DBFunctions(getErrCode());
DBF.setProcessFlag(true);
String[] Vals = (CompanyId + GlobalClass.ColDelim + BranchId + GlobalClass.ColDelim+ UserId + GlobalClass.ColDelim).split(GlobalClass.ColDelim);
String ResultData = DBF.FetchRunQuery(41, Vals); // Generating list of cut-off batch
if (DBF.isProcessFlag()) {
String[][] DedListData = StrFunc.ConverTo2DArray(ResultData,GlobalClass.RowDelim, GlobalClass.ColDelim);
ArrayList<DedupeRecord> Record = new ArrayList<DedupeRecord>();
for (int RecCount = 0; RecCount < DedListData.length; RecCount++) {
DBF.setProcessFlag(true);
DedupeRecord CORec = new DedupeRecord();
CORec.setCutoffon(DedListData[RecCount][1]);
CORec.setTotaddr(Integer.parseInt(DedListData[RecCount][2]));
CORec.setTotcase(Integer.parseInt(DedListData[RecCount][3]));
CORec.setIslocked(Integer.parseInt(DedListData[RecCount][4]));
CORec.setLockedby(DedListData[RecCount][5]);
// Collecting records for sublist
String[] Vals1 = (CompanyId + GlobalClass.ColDelim + BranchId+ GlobalClass.ColDelim + CORec.getCutoffon() + GlobalClass.ColDelim+ UserId + GlobalClass.ColDelim+ DedListData[RecCount][1] + GlobalClass.ColDelim).split(GlobalClass.ColDelim);
String ResultData1 = DBF.FetchRunQuery(42, Vals1); // Generating sublist records
if (DBF.isProcessFlag()) {
String[][] SubListData = StrFunc.ConverTo2DArray(ResultData1, GlobalClass.RowDelim,GlobalClass.ColDelim);
ArrayList<DedupeRecord> SubRecord = new ArrayList<DedupeRecord>();
for (int ListCount = 0; ListCount < SubListData.length; ListCount++) {
DedupeRecord SCORec = new DedupeRecord();
SCORec.setMvcode(SubListData[ListCount][0]);
SCORec.setApplno(SubListData[ListCount][1]);
SCORec.setCustomername(SubListData[ListCount][2]);
SCORec.setApptype(SubListData[ListCount][3]);
SCORec.setTotrv(Integer.parseInt(SubListData[ListCount][4]));
SCORec.setTotov(Integer.parseInt(SubListData[ListCount][5]));
SCORec.setTotpv(Integer.parseInt(SubListData[ListCount][6]));
SCORec.setIslocked(Integer.parseInt(SubListData[ListCount][7]));
SCORec.setLockedby(SubListData[ListCount][8]);
SCORec.setUuid(SubListData[ListCount][9]);
SCORec.setNegative(SubListData[ListCount][10].equals("1") ? "Y":"N");
SCORec.setEarlier(SubListData[ListCount][11].equals("1") ? "Y":"N");
SubRecord.add(SCORec);
}
CORec.setSublist(SubRecord);
}
Record.add(CORec);
}
setDedcutTime(getDedcutTime());
setDedupelist(Record);
setSessUUID(getSessUUID());
} else {
setProcessFlag(false);
setErrDesc(DBF.getErrDesc());
setErrMsg(DBF.getErrMsg());
}
}
}

View File

@@ -0,0 +1,61 @@
package matrix.nimble.edp.dedupe.model;
public class SendDedupe {
private String portfolioid;
private String portname;
private String supervisor;
private int dqid;
private String fid;
private String [][] caselist;
private String suuid;
private String uuids;
public String getPortfolioid() {
return portfolioid;
}
public void setPortfolioid(String portfolioid) {
this.portfolioid = portfolioid;
}
public int getDqid() {
return dqid;
}
public void setDqid(int dqid) {
this.dqid = dqid;
}
public String getFid() {
return fid;
}
public void setFid(String fid) {
this.fid = fid;
}
public String[][] getCaselist() {
return caselist;
}
public void setCaselist(String[][] caselist) {
this.caselist = caselist;
}
public String getSuuid() {
return suuid;
}
public void setSuuid(String suuid) {
this.suuid = suuid;
}
public String getUuids() {
return uuids;
}
public void setUuids(String uuids) {
this.uuids = uuids;
}
public String getPortname() {
return portname;
}
public void setPortname(String portname) {
this.portname = portname;
}
public String getSupervisor() {
return supervisor;
}
public void setSupervisor(String supervisor) {
this.supervisor = supervisor;
}
}

View File

@@ -7,15 +7,22 @@ import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpSession;
//spring libraries
import matrix.nimble.edp.dedupe.model.DedupeDetails;
import matrix.nimble.edp.dedupe.model.DedupeDo;
import matrix.nimble.edp.dedupe.model.DedupeHandler;
import matrix.nimble.edp.dedupe.model.DedupeRun;
import matrix.nimble.edp.documents.model.EDPDocumentHandler;
import matrix.nimble.edp.punching.model.CaseGrid;
import matrix.nimble.model.Session;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.ModuleFunctions;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.SessionAttributes;
@Controller

View File

@@ -1,5 +1,4 @@
package matrix.nimble.edp.output.model;
import java.util.Date;
import java.io.*;
import matrix.nimble.utilities.FileFunctions;
@@ -14,21 +13,21 @@ public class ReportOutput {
private String ErrDesc;
private String ErrMsg;
private String TeleSheetLink;
String[] RepData = null;
String[] fontStyle = null;
String[] colSpan = null;
String[] cellAlignment = null;
String[] cellBorder = null;
String[] cellPaddLeft = null;
String[] cellPaddTop = null;
String[] cellPaddBott = null;
String[] cellPaddRight = null;
String [] RepData=null;
String [] fontStyle=null;
String [] colSpan=null;
String [] cellAlignment=null;
String [] cellBorder=null;
String [] cellPaddLeft=null;
String [] cellPaddTop=null;
String [] cellPaddBott=null;
String [] cellPaddRight=null;
private int TabCols;
private String RepFormat;
private PDFFormatter PDFFile;
private String RootPath;
public String getErrCode() {
public String getErrCode() {
return ErrCode;
}
@@ -59,7 +58,6 @@ public class ReportOutput {
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
private String getTeleSheetLink() {
return TeleSheetLink;
}
@@ -100,193 +98,207 @@ public class ReportOutput {
RootPath = rootPath;
}
public String GenerateCallingSheet(String[][] TeleCutList, String RootPath, String CompanyId, String BranchId,
String reptype) {
public String GenerateCallingSheet(String [][] TeleCutList,String RootPath,String CompanyId,String BranchId,String reptype)
{
setRootPath(RootPath);
setTeleSheetLink(getErrCode() + "FNFND:Error:File Not Created");
CreatePDF(TeleCutList[0][3], TeleCutList[0][1], CompanyId, BranchId, reptype);
if (isProcessFlag()) {
for (int Indx = 0; Indx < TeleCutList.length; Indx++) {
if (TeleCutList[Indx][4].equals("notempty")) {
if (!TeleCutList[Indx][2].equals(getRepFormat())) {
setTeleSheetLink(getErrCode()+"FNFND:Error:File Not Created");
CreatePDF(TeleCutList[0][3], TeleCutList[0][1],CompanyId,BranchId,reptype);
if(isProcessFlag())
{
for(int Indx=0;Indx<TeleCutList.length;Indx++)
{
if(TeleCutList[Indx][4].equals("notempty"))
{
if(!TeleCutList[Indx][2].equals(getRepFormat()))
{
setRepFormat(TeleCutList[Indx][2]);
InitReportArrays(getRepFormat());
if (!isProcessFlag()) {
setTeleSheetLink(getErrCode() + "FNFND:Error:File Not Created");
try {
if(!isProcessFlag())
{
setTeleSheetLink(getErrCode()+"FNFND:Error:File Not Created");
try
{
new FileFunctions(getErrCode()).DeleteFile(getTeleSheetLink());
} catch (Exception exce) {
}catch(Exception exce)
{
}
return getTeleSheetLink();
}
}
InvokeMethod(TeleCutList[Indx][5], TeleCutList[Indx][0], TeleCutList[Indx][3],
TeleCutList[Indx][1]);
InvokeMethod(TeleCutList[Indx][5], TeleCutList[Indx][0], TeleCutList[Indx][3], TeleCutList[Indx][1]);
}
}
ClosePDF();
}
return getTeleSheetLink();
}
public void CreatePDF(String UserId, String TeleSheetOn, String CompanyId, String BranchId, String reptype) {
StringFunctions strFunc = new StringFunctions(getErrCode());
PDFFormatter PDFF = new PDFFormatter();
public void CreatePDF(String UserId,String TeleSheetOn,String CompanyId,String BranchId,String reptype)
{
StringFunctions strFunc=new StringFunctions(getErrCode());
PDFFormatter PDFF=new PDFFormatter();
PDFF.setErrCode(getErrCode());
PDFF.setProcessFlag(true);
String dt = strFunc.FormatDate("yyyy/MM/dd", new Date());
String timeStamp = (TeleSheetOn.replaceAll("/| |:", "_"));
String FileName = getRootPath() + "output/" + CompanyId + "/" + BranchId + "/" + dt + "/telesheet";
File f = new File(FileName);
if (!f.isDirectory()) {
String dt=strFunc.FormatDate("yyyy/MM/dd", new Date());
String timeStamp=(TeleSheetOn.replaceAll("/| |:", "_"));
String FileName=getRootPath()+"output/telesheet/"+CompanyId+"/"+BranchId+"/telesheet/"+dt;
File f=new File(FileName);
if(!f.isDirectory())
{
f.mkdirs();
}
if (f.isDirectory()) {
FileName = FileName + "/" + reptype + "_" + UserId + "_" + timeStamp + ".pdf";
if(f.isDirectory())
{
FileName=FileName+"/"+reptype+"_"+UserId+"_"+timeStamp+".pdf";
PDFF.CreateFile(FileName);
if (!PDFF.isProcessFlag()) {
if(!PDFF.isProcessFlag())
{
setProcessFlag(false);
setErrDesc(PDFF.getErrDesc());
setErrMsg(PDFF.getErrMsg());
} else {
setTeleSheetLink("output/" + CompanyId + "/" + BranchId + "/" + dt + "/telesheet/" + reptype
+ "_" + UserId + "_" + timeStamp + ".pdf");
}
else
{
setTeleSheetLink("output/telesheet/"+CompanyId+"/"+BranchId+"/telesheet/"+dt+"/"+reptype+"_"+UserId+"_"+timeStamp+".pdf");
setPDFFile(PDFF);
}
} else {
}
else
{
setProcessFlag(false);
setErrDesc(getErrCode()
+ "CRDIR:Error:Directory creation failed. Please check you have permission to access the target location.");
setErrDesc(getErrCode()+"CRDIR:Error:Directory creation failed. Please check you have permission to access the target location.");
setErrMsg(getErrDesc());
}
}
public void ClosePDF() {
public void ClosePDF()
{
getPDFFile().closeDocument();
}
public void GenerateReport(String PortfolioId, String UserId, String TeleSheetOn) {
DBFunctions DBF = new DBFunctions(getErrCode());
public void GenerateReport(String PortfolioId,String UserId,String TeleSheetOn)
{
DBFunctions DBF=new DBFunctions(getErrCode());
DBF.setProcessFlag(true);
String ResultData = DBF.FetchRunQuery(35, (PortfolioId + GlobalClass.ColDelim + UserId + GlobalClass.ColDelim
+ TeleSheetOn + GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if (DBF.isProcessFlag()) {
StringFunctions StrFunc = new StringFunctions(getErrCode());
String[][] TeleSheetData = StrFunc.ConverTo2DArray(ResultData, GlobalClass.RowDelim, GlobalClass.ColDelim);
if (TeleSheetData.length > 0) {
String ResultData=DBF.FetchRunQuery(35, (PortfolioId+GlobalClass.ColDelim+UserId+GlobalClass.ColDelim+TeleSheetOn+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(DBF.isProcessFlag())
{
StringFunctions StrFunc=new StringFunctions(getErrCode());
String [][] TeleSheetData=StrFunc.ConverTo2DArray(ResultData, GlobalClass.RowDelim, GlobalClass.ColDelim);
if(TeleSheetData.length > 0)
{
getPDFFile().createTable(getTabCols());
int rtvStat = 1;
int otvStat = 1;
for (int rindx = 0; rindx < TeleSheetData.length; rindx++) {
int rtvStat=1;
int otvStat=1;
for(int rindx=0;rindx<TeleSheetData.length;rindx++)
{
getPDFFile().setFontBlack();
getPDFFile().SetFont("Times", 15);
rtvStat = 1;
otvStat = 1;
for (int cindx = 0; cindx < TeleSheetData[rindx].length - 2; cindx++) {
if ((cindx >= 11 && cindx <= 61) && TeleSheetData[rindx][138].equals("0")) {
rtvStat = 0;
cindx = 61;
rtvStat=1;
otvStat=1;
for(int cindx=0;cindx<TeleSheetData[rindx].length-2;cindx++)
{
if((cindx>=11 && cindx<=61) && TeleSheetData[rindx][138].equals("0"))
{
rtvStat=0;
cindx=61;
continue;
}
if (cindx >= 62 && TeleSheetData[rindx][139].equals("0")) {
otvStat = 0;
if(cindx>=62 && TeleSheetData[rindx][139].equals("0"))
{
otvStat=0;
break;
}
getPDFFile().createCell(TeleSheetData[rindx][cindx], Integer.parseInt(fontStyle[cindx]),
Integer.parseInt(colSpan[cindx]), Integer.parseInt(cellPaddLeft[cindx]),
cellAlignment[cindx], Integer.parseInt(cellBorder[cindx]),
Integer.parseInt(cellPaddTop[cindx]), Integer.parseInt(cellPaddBott[cindx]),
Integer.parseInt(cellPaddRight[cindx]), 0);
getPDFFile().createCell(TeleSheetData[rindx][cindx], Integer.parseInt(fontStyle[cindx]), Integer.parseInt(colSpan[cindx]), Integer.parseInt(cellPaddLeft[cindx]),cellAlignment[cindx],Integer.parseInt(cellBorder[cindx]),Integer.parseInt(cellPaddTop[cindx]),Integer.parseInt(cellPaddBott[cindx]),Integer.parseInt(cellPaddRight[cindx]),0);
getPDFFile().setFontSize(10);
}
if (rtvStat == 1 || otvStat == 1) {
if(rtvStat==1 || otvStat==1)
{
getPDFFile().addTable();
getPDFFile().addPageBreak();
getPDFFile().createTable(getTabCols());
}
}
}
} else {
}
else
{
setProcessFlag(false);
setErrDesc(DBF.getErrDesc());
setErrMsg(DBF.getErrMsg());
}
}
public void GenerateRefReport(String PortfolioId, String UserId, String TeleSheetOn) {
DBFunctions DBF = new DBFunctions(getErrCode());
public void GenerateRefReport(String PortfolioId,String UserId,String TeleSheetOn)
{
DBFunctions DBF=new DBFunctions(getErrCode());
DBF.setProcessFlag(true);
String ResultData = DBF.FetchRunQuery(215, (PortfolioId + GlobalClass.ColDelim + UserId + GlobalClass.ColDelim
+ TeleSheetOn + GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if (DBF.isProcessFlag()) {
StringFunctions StrFunc = new StringFunctions(getErrCode());
String[][] RefSheetData = StrFunc.ConverTo2DArray(ResultData, GlobalClass.RowDelim, GlobalClass.ColDelim);
if (RefSheetData.length > 0) {
String ResultData=DBF.FetchRunQuery(215, (PortfolioId+GlobalClass.ColDelim+UserId+GlobalClass.ColDelim+TeleSheetOn+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(DBF.isProcessFlag())
{
StringFunctions StrFunc=new StringFunctions(getErrCode());
String [][] RefSheetData=StrFunc.ConverTo2DArray(ResultData, GlobalClass.RowDelim, GlobalClass.ColDelim);
if(RefSheetData.length > 0)
{
getPDFFile().createTable(getTabCols());
for (int rindx = 0; rindx < RefSheetData.length; rindx++) {
for(int rindx=0;rindx<RefSheetData.length;rindx++)
{
getPDFFile().setFontBlack();
getPDFFile().SetFont("Arial", 16);
for (int cindx = 0; cindx < RefSheetData[rindx].length - 1; cindx++) {
getPDFFile().createCell(RefSheetData[rindx][cindx], Integer.parseInt(fontStyle[cindx]),
Integer.parseInt(colSpan[cindx]), Integer.parseInt(cellPaddLeft[cindx]),
cellAlignment[cindx], Integer.parseInt(cellBorder[cindx]),
Integer.parseInt(cellPaddTop[cindx]), Integer.parseInt(cellPaddBott[cindx]),
Integer.parseInt(cellPaddRight[cindx]), 0);
for(int cindx=0;cindx<RefSheetData[rindx].length-1;cindx++)
{
getPDFFile().createCell(RefSheetData[rindx][cindx], Integer.parseInt(fontStyle[cindx]), Integer.parseInt(colSpan[cindx]), Integer.parseInt(cellPaddLeft[cindx]),cellAlignment[cindx],Integer.parseInt(cellBorder[cindx]),Integer.parseInt(cellPaddTop[cindx]),Integer.parseInt(cellPaddBott[cindx]),Integer.parseInt(cellPaddRight[cindx]),0);
getPDFFile().setFontSize(12);
}
getPDFFile().addTable();
getPDFFile().addPageBreak();
getPDFFile().createTable(getTabCols());
getPDFFile().addTable();
getPDFFile().addPageBreak();
getPDFFile().createTable(getTabCols());
}
}
} else {
}
else
{
setProcessFlag(false);
setErrDesc(DBF.getErrDesc());
setErrMsg(DBF.getErrMsg());
}
}
private void InitReportArrays(String fileName) {
try {
FileFunctions FFunc = new FileFunctions(getErrCode());
setTabCols(Integer.parseInt(FFunc.GetKeyValue("cols", "templates/" + fileName + ".tmpl")));
// RepData=FFunc.GetKeyValue("repdata", fileName).split(GlobalClass.ColDelim);
fontStyle = FFunc.GetKeyValue("fontstyle", "templates/" + fileName + ".tmpl").split(GlobalClass.ColDelim);
cellPaddLeft = FFunc.GetKeyValue("paddingleft", "templates/" + fileName + ".tmpl")
.split(GlobalClass.ColDelim);
cellPaddRight = FFunc.GetKeyValue("paddingright", "templates/" + fileName + ".tmpl")
.split(GlobalClass.ColDelim);
cellPaddTop = FFunc.GetKeyValue("paddingtop", "templates/" + fileName + ".tmpl")
.split(GlobalClass.ColDelim);
cellPaddBott = FFunc.GetKeyValue("paddingbottom", "templates/" + fileName + ".tmpl")
.split(GlobalClass.ColDelim);
colSpan = FFunc.GetKeyValue("colspan", "templates/" + fileName + ".tmpl").split(GlobalClass.ColDelim);
cellBorder = FFunc.GetKeyValue("border", "templates/" + fileName + ".tmpl").split(GlobalClass.ColDelim);
cellAlignment = FFunc.GetKeyValue("alignment", "templates/" + fileName + ".tmpl")
.split(GlobalClass.ColDelim);
private void InitReportArrays(String fileName)
{
try
{
FileFunctions FFunc=new FileFunctions(getErrCode());
setTabCols(Integer.parseInt(FFunc.GetKeyValue("cols","templates/"+fileName+".tmpl")));
//RepData=FFunc.GetKeyValue("repdata", fileName).split(GlobalClass.ColDelim);
fontStyle=FFunc.GetKeyValue("fontstyle", "templates/"+fileName+".tmpl").split(GlobalClass.ColDelim);
cellPaddLeft=FFunc.GetKeyValue("paddingleft", "templates/"+fileName+".tmpl").split(GlobalClass.ColDelim);
cellPaddRight=FFunc.GetKeyValue("paddingright", "templates/"+fileName+".tmpl").split(GlobalClass.ColDelim);
cellPaddTop=FFunc.GetKeyValue("paddingtop", "templates/"+fileName+".tmpl").split(GlobalClass.ColDelim);
cellPaddBott=FFunc.GetKeyValue("paddingbottom", "templates/"+fileName+".tmpl").split(GlobalClass.ColDelim);
colSpan=FFunc.GetKeyValue("colspan", "templates/"+fileName+".tmpl").split(GlobalClass.ColDelim);
cellBorder=FFunc.GetKeyValue("border", "templates/"+fileName+".tmpl").split(GlobalClass.ColDelim);
cellAlignment=FFunc.GetKeyValue("alignment", "templates/"+fileName+".tmpl").split(GlobalClass.ColDelim);
setProcessFlag(true);
} catch (Exception exce) {
}catch(Exception exce)
{
setProcessFlag(false);
setErrDesc(exce.getMessage());
setErrMsg(getErrCode() + "RPFMT:Error:Error reading report template. Please check the existence of file.");
setErrMsg(getErrCode()+"RPFMT:Error:Error reading report template. Please check the existence of file.");
}
}
private void InvokeMethod(String methodName, String PortfolioId, String UserId, String TeleSheetOn) {
try {
Class partypes[] = new Class[3];
partypes[0] = String.class;
partypes[1] = String.class;
partypes[2] = String.class;
java.lang.reflect.Method meth = this.getClass().getMethod(methodName, partypes);
Object arglist[] = new Object[3];
arglist[0] = new String(PortfolioId);
arglist[1] = new String(UserId);
arglist[2] = new String(TeleSheetOn);
meth.invoke(this, arglist);
} catch (Throwable e) {
System.err.println(e);
}
private void InvokeMethod(String methodName,String PortfolioId,String UserId,String TeleSheetOn)
{
try {
Class partypes[] = new Class[3];
partypes[0] = String.class;
partypes[1] = String.class;
partypes[2] = String.class;
java.lang.reflect.Method meth = this.getClass().getMethod(methodName, partypes);
Object arglist[] = new Object[3];
arglist[0] = new String(PortfolioId);
arglist[1] = new String(UserId);
arglist[2] = new String(TeleSheetOn);
meth.invoke(this, arglist);
}
catch (Throwable e) {
System.err.println(e);
}
}
}

View File

@@ -28,7 +28,7 @@ import lib.models.MessageDetails;
import lib.models.PunchedRecordsData;
import lib.models.DuplicateDetailsData;
import lib.models.LocalityData;
import lib.models.CaseGrid;
import matrix.nimble.edp.punching.model.CaseGrid;
import lib.constants.ApplicationMessage;
import matrix.nimble.security.PayloadCryptoService;
import lib.exceptions.ApplicationException;
@@ -37,6 +37,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
@Controller
public class PunchingController extends AbstractAuthenticatedController {
private static final Logger LOGGER = Logger.getLogger(PunchingController.class.getName());
private static final String INIT_VIEW_ROUTE = "initview";
@@ -45,10 +46,6 @@ public class PunchingController extends AbstractAuthenticatedController {
private static final String DUPLICATE_DETAILS_ROUTE = "findsdet";
private static final String LOCALITY_ROUTE = "getlocality";
private static final String EDIT_GRID_ROUTE = "editgrid";
private static final String GET_PUNCHED_RECORDS = "punchedrecs";
private static final String GET_PAYLOAD_KEY = "payload-key";
private static final String SAVE_APPLICATION = "application-save";
private static final String GET_CASE_LIST = "caselist";
private final PunchingService punchingService;
private final PayloadCryptoService cryptoService;
@@ -59,19 +56,20 @@ public class PunchingController extends AbstractAuthenticatedController {
this.cryptoService = cryptoService;
}
@RequestMapping(value = GET_PAYLOAD_KEY, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
@RequestMapping(value = "payload-key", method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
public ResponseEntity<?> caseSaveKey(HttpSession httpSession) {
ApiAuthorization authorization = authorizeApiPage(INIT_VIEW_ROUTE, httpSession);
if (!authorization.isGranted())
return error(authorization.error());
if (!authorization.isGranted()) return error(authorization.error());
return ResponseEntity.ok(Map.of(
"keyId", cryptoService.keyId(),
"algorithm", "RSA-OAEP-256",
"publicKey", cryptoService.encodedPublicKey()));
}
@RequestMapping(value = GET_PUNCHED_RECORDS, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
@RequestMapping(value = "punchedrecs", method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
public ResponseEntity<ApiResponse<PunchedRecordsData>> punchedRecords(
@RequestParam("portfolioId") Short portfolioId,
@@ -98,7 +96,8 @@ public class PunchingController extends AbstractAuthenticatedController {
}
}
@RequestMapping(value = DUPLICATE_DETAILS_ROUTE, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
@RequestMapping(value = DUPLICATE_DETAILS_ROUTE, method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
public ResponseEntity<ApiResponse<DuplicateDetailsData>> findDuplicateDetails(
@RequestParam("applicationNumber") String applicationNumber,
@@ -126,7 +125,8 @@ public class PunchingController extends AbstractAuthenticatedController {
}
}
@RequestMapping(value = LOCALITY_ROUTE, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
@RequestMapping(value = LOCALITY_ROUTE, method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
public ResponseEntity<ApiResponse<LocalityData>> findLocalities(
@RequestParam("city") String city,
@@ -152,13 +152,14 @@ public class PunchingController extends AbstractAuthenticatedController {
}
}
@RequestMapping(value = SAVE_APPLICATION, method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
@RequestMapping(value = "application-save", method = RequestMethod.POST,
consumes = MediaType.APPLICATION_JSON_VALUE,
produces = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
public ResponseEntity<ApiResponse<ApplicationSaveData>> saveApplication(
@RequestBody CaseSaveRequest request, HttpSession httpSession) {
ApiAuthorization authorization = authorizeApiPage(INIT_VIEW_ROUTE, httpSession);
if (!authorization.isGranted())
return applicationError(authorization.error());
if (!authorization.isGranted()) return applicationError(authorization.error());
try {
ApplicationDetails details = cryptoService.decrypt(request, ApplicationDetails.class);
ApplicationSaveResult saved = punchingService.saveApplication(details, authorization.session());
@@ -252,7 +253,7 @@ public class PunchingController extends AbstractAuthenticatedController {
return "edp/punching/editcases";
}
@RequestMapping(value = GET_CASE_LIST, method = RequestMethod.POST)
@RequestMapping(value = "caselist", method = RequestMethod.POST)
public String listEditableCases(
@ModelAttribute("caseGrid") CaseGrid caseGrid,
ModelMap model,

View File

@@ -1,14 +1,11 @@
package matrix.services.commons;
import com.cygnus.db.CygnusDbExecutor;
import com.cygnus.client.CloudIdentityClient;
import com.cygnus.client.model.CloudDataItem;
import jakarta.servlet.http.HttpSession;
import lib.models.Option;
import lib.models.UserSession;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -26,19 +23,16 @@ public class CommonService {
Pattern.CASE_INSENSITIVE);
private final CygnusDbExecutor dbExecutor;
private final CloudIdentityClient cloudIdentityClient;
@Autowired
public CommonService(CygnusDbExecutor dbExecutor, CloudIdentityClient cloudIdentityClient) {
public CommonService(CygnusDbExecutor dbExecutor) {
this.dbExecutor = Objects.requireNonNull(dbExecutor, "dbExecutor");
this.cloudIdentityClient = Objects.requireNonNull(cloudIdentityClient, "cloudIdentityClient");
}
/* Used by the session-only unit tests. Production construction is handled
by Spring through the CygnusDbExecutor constructor above. */
public CommonService() {
this.dbExecutor = null;
this.cloudIdentityClient = null;
}
public Session getSession(HttpSession httpSession) {
@@ -144,22 +138,4 @@ public class CommonService {
Object[] parameters = queryParams == null ? new Object[0] : queryParams;
return dbExecutor.query(queryId, parameters, Option.class);
}
public List<Option> getCloudOptions(String scope, Map<String, Object> data) {
if (cloudIdentityClient == null) {
throw new IllegalStateException("CloudIdentityClient is not configured");
}
return cloudIdentityClient.fetchData(scope, data)
.map(items -> items.stream().map(this::option).toList())
.blockOptional()
.orElseGet(List::of);
}
private Option option(CloudDataItem item) {
Option option = new Option();
option.setValue(item.value());
option.setLabel(item.label());
option.setGroup(item.group());
return option;
}
}

View File

@@ -1,335 +0,0 @@
package matrix.services.edp;
import com.cygnus.db.CygnusDbExecutor;
import com.cygnus.db.RowView;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import lib.models.Allocation;
import lib.models.CutOffList;
import lib.models.CutOffRecord;
import lib.models.PhotoCases;
import lib.models.ReferenceSheet;
import lib.models.SendToOperation;
import lib.models.Telesheet;
import lib.models.UserSession;
import matrix.nimble.edp.output.model.ReportOutput;
import matrix.nimble.utilities.GlobalClass;
import org.springframework.stereotype.Service;
import org.springframework.ui.ModelMap;
@Service
public class CutoffService {
private static final DateTimeFormatter DB_TIME = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss");
private final CygnusDbExecutor dbExecutor;
public CutoffService(CygnusDbExecutor dbExecutor) {
this.dbExecutor = dbExecutor;
}
public CutOffList loadCutoff(UserSession session) {
requireScope(session);
String now = now();
dbExecutor.update(17, new Object[] {now, session.getUserId(), auditUser(session),
session.getCompanyId(), session.getBranchId(), session.getUserId()});
CutOffList value = cutoff(new CutOffList(), "1003");
value.setCutoffTime(now);
value.setCofflist(dbExecutor.query(18,
new Object[] {session.getUserId(), session.getCompanyId(), session.getBranchId()})
.stream().map(this::cutoffRecord).toList());
return value;
}
public CutOffList saveCutoff(UserSession session, CutOffList value) {
requireScope(session);
cutoff(value, "1003");
int changed = 0;
for (CutOffRecord record : safe(value.getCofflist())) {
changed += dbExecutor.update(26, new Object[] {
record.isDocut(), flag(record.isAllocation()), flag(record.isSms()), flag(record.isTelesheet()),
flag(record.isEarlier()), flag(record.isNegative()), session.getUserId(),
auditUser(session), value.getBatch(), session.getCompanyId(), session.getBranchId(),
integer(record.getPortfolioid()), value.getCutoffTime(), session.getUserId()})
* (record.isDocut() ? 1 : 0);
}
value.setProcessFlag(changed > 0);
value.setErrMsg(changed > 0 ? "1003STCUT:Info:Cut list is ready to be processed."
: "1003STCUT:Error:Please select at least one portfolio.");
return value;
}
public Allocation loadAllocation(UserSession session) {
requireScope(session);
dbExecutor.update(27, lockParameters(session));
Allocation value = allocation(new Allocation(), "1004");
value.setAllocTime(now());
value.setAllocationlist(nestedRecords(
dbExecutor.query(28, listScope(session)),
dbExecutor.query(29, childScope(session)), Workflow.ALLOCATION));
return value;
}
public Allocation saveAllocation(UserSession session, Allocation value) {
requireScope(session);
allocation(value, "1004");
int changed = 0;
for (CutOffRecord parent : safe(value.getAllocationlist())) {
for (CutOffRecord record : safe(parent.getSublist())) {
dbExecutor.procedure(30, new Object[] {record.getUuid(), flag01(record.isAllocation()),
record.getTotrv(), record.getTotov(), record.getTotpv(), integerOrZero(record.getResiloc()),
integerOrZero(record.getOffloc()), integerOrZero(record.getProploc()), now(), session.getCompanyId(),
session.getBranchId(), integer(parent.getPortfolioid()), record.getPortgroup()}, String.class);
if (record.isAllocation()) changed++;
}
}
value.setProcessFlag(changed > 0);
value.setErrMsg(changed > 0 ? "1004ALLOC:Info:Cases allocated successfully."
: "1004ALLOC:Error:Please select at least one case.");
return value;
}
public Telesheet loadTelesheet(UserSession session) {
requireScope(session);
dbExecutor.update(31, lockParameters(session));
Telesheet value = telesheet(new Telesheet(), "1006");
value.setTeleSheetTime(now());
value.setTvrlist(nestedRecords(dbExecutor.query(32, listScope(session)),
dbExecutor.query(33, childScope(session)), Workflow.TELESHEET));
return value;
}
public Telesheet generateTelesheet(UserSession session, Telesheet value, String rootPath) {
requireScope(session);
telesheet(value, "1006");
GeneratedSheet generated = generateSheet(session, value.getTvrlist(), 34, "telesheet");
value.setProcessFlag(generated.generated());
value.setTelePDFLink(generated.link());
value.setErrMsg(generated.generated()
? "1006TSGEN:Info:Telesheet generated successfully."
: "1006ETLST:Error:No records found to generate Telesheet.");
return value;
}
public ReferenceSheet loadReferenceSheet(UserSession session) {
requireScope(session);
dbExecutor.update(216, lockParameters(session));
ReferenceSheet value = reference(new ReferenceSheet(), "1006");
value.setTeleSheetTime(now());
value.setTvrlist(nestedRecords(dbExecutor.query(217, listScope(session)),
dbExecutor.query(218, childScope(session)), Workflow.REFERENCE));
return value;
}
public ReferenceSheet generateReferenceSheet(UserSession session, ReferenceSheet value,
String rootPath) {
requireScope(session);
reference(value, "1006");
GeneratedSheet generated = generateSheet(session, value.getTvrlist(), 219, "refsheet");
value.setProcessFlag(generated.generated());
value.setTelePDFLink(generated.link());
value.setErrMsg(generated.generated()
? "1006RFGEN:Info:Reference sheet generated successfully."
: "1006ERFST:Error:No records found to generate Reference sheet.");
return value;
}
public SendToOperation loadSendToOperation(UserSession session) {
requireScope(session);
dbExecutor.update(44, lockParameters(session));
SendToOperation value = send(new SendToOperation(), "1007");
value.setSendTime(now());
value.setCaselist(nestedRecords(dbExecutor.query(45, listScope(session)),
dbExecutor.query(46, childScope(session)), Workflow.OPERATION));
return value;
}
public SendToOperation sendToOperation(UserSession session, SendToOperation value) {
requireScope(session);
send(value, "1007");
int selected = 0;
for (CutOffRecord parent : safe(value.getCaselist())) {
for (CutOffRecord record : safe(parent.getSublist())) {
if (!record.isOprsend()) continue;
dbExecutor.procedure(47, new Object[] {record.getUuid(), flag01(record.isOprsend()),
now(), session.getUserId(), session.getCompanyId(), session.getBranchId(),
integer(parent.getPortfolioid())}, String.class);
selected++;
}
}
SendToOperation refreshed = loadSendToOperation(session);
refreshed.setProcessFlag(selected > 0);
refreshed.setErrMsg(selected > 0 ? "1007OPR:Info:Cases sent to operations successfully."
: "1007OPR:Error:Please select at least one case.");
return refreshed;
}
public void populatePhotoCases(ModelMap model, UserSession session) {
PhotoCases value = new PhotoCases();
value.setErrCode("16001");
value.setProcessFlag(true);
requireScope(session);
model.addAttribute("caselist", photoRows(dbExecutor.query(303,
new Object[] {session.getCompanyId(), session.getBranchId()})));
model.addAttribute("pcases", value);
}
public String finalizePhotoCase(UserSession session, String uuid, String mvCode, String userId) {
requireScope(session);
String visit = mvCode.trim().endsWith("R") ? "res" : mvCode.trim().endsWith("O") ? "off" : "pro";
List<RowView> rows = dbExecutor.query(300, new Object[] {uuid, session.getCompanyId(),
session.getBranchId(), uuid, visit, session.getUserId(), now()});
return rows.isEmpty() ? "error:No result returned" : text(rows.getFirst().get("result"));
}
private CutOffList cutoff(CutOffList value, String code) { value.setErrCode(code); return value; }
private Allocation allocation(Allocation value, String code) { value.setErrCode(code); return value; }
private Telesheet telesheet(Telesheet value, String code) { value.setErrCode(code); return value; }
private ReferenceSheet reference(ReferenceSheet value, String code) { value.setErrCode(code); return value; }
private SendToOperation send(SendToOperation value, String code) { value.setErrCode(code); return value; }
private String text(Object value) { return value == null ? "" : value.toString(); }
private List<CutOffRecord> nestedRecords(List<RowView> parents, List<RowView> children,
Workflow workflow) {
Map<String, List<CutOffRecord>> grouped = new LinkedHashMap<>();
for (RowView row : children) grouped.computeIfAbsent(text(row.get("portfolio_id")),
ignored -> new ArrayList<>()).add(childRecord(row, workflow));
List<CutOffRecord> result = new ArrayList<>(parents.size());
for (RowView row : parents) {
CutOffRecord record = cutoffRecord(row);
setTotals(record, row, workflow);
record.setRepformat(text(row.get("outputformat")));
record.setRepfunction(text(row.get("outputfunction")));
record.setAllocation(booleanValue(row, "allocation"));
record.setTv(workflow == Workflow.TELESHEET ? booleanValue(row, "telesheet")
: workflow == Workflow.REFERENCE && booleanValue(row, "refsheet"));
record.setOprsend(workflow == Workflow.OPERATION);
record.setSublist(grouped.getOrDefault(record.getPortfolioid(), List.of()));
result.add(record);
}
return result;
}
private CutOffRecord childRecord(RowView row, Workflow workflow) {
CutOffRecord record = cutoffRecord(row);
record.setMvcode(text(row.get("mvcode")));
record.setApplno(text(row.get("applno")));
record.setCustomername(text(row.get("customername")));
record.setApptype(text(row.get("apptype")));
setTotals(record, row, workflow);
record.setAllocation(booleanValue(row, "allocation"));
record.setTv(workflow == Workflow.TELESHEET ? booleanValue(row, "telesheet")
: workflow == Workflow.REFERENCE && booleanValue(row, "telesheet"));
record.setOprsend(workflow == Workflow.OPERATION);
record.setResiloc(text(row.get("rcolony")));
record.setOffloc(text(row.get("ocolony")));
record.setProploc(text(row.get("pcolony")));
record.setUuid(text(row.get("uuid")));
record.setPortgroup(text(row.get("portgroup")));
return record;
}
private void setTotals(CutOffRecord record, RowView row, Workflow workflow) {
if (workflow == Workflow.ALLOCATION || workflow == Workflow.OPERATION) {
record.setTotrv(number(row, "rv"));
record.setTotov(number(row, "ov"));
record.setTotpv(number(row, "pv"));
}
if (workflow == Workflow.TELESHEET || workflow == Workflow.OPERATION) {
record.setTotrtv(number(row, "rtv"));
record.setTototv(number(row, "otv"));
}
if (workflow != Workflow.ALLOCATION) record.setTotref(number(row, "refv"));
}
private CutOffRecord cutoffRecord(RowView row) {
CutOffRecord record = new CutOffRecord();
record.setPortfolioid(text(row.get("portfolio_id")));
record.setPortname(text(row.get("portname")));
record.setAllocation(booleanValue(row, "allocation"));
record.setSms(booleanValue(row, "sms"));
record.setTelesheet(booleanValue(row, "telesheet"));
record.setEarlier(booleanValue(row, "earlier"));
record.setNegative(booleanValue(row, "negative"));
record.setIslocked(number(row, "islocked"));
record.setLockedby(text(row.get("lockedby")));
record.setDocut(record.getIslocked() == 0);
return record;
}
private Object[] lockParameters(UserSession session) {
return new Object[] {session.getUserId(), auditUser(session), session.getUserId(),
session.getCompanyId(), session.getBranchId()};
}
private Object[] listScope(UserSession session) {
return new Object[] {session.getUserId(), session.getCompanyId(), session.getBranchId()};
}
private Object[] childScope(UserSession session) {
return new Object[] {session.getUserId(), session.getUserId(),
session.getCompanyId(), session.getBranchId()};
}
private void requireScope(UserSession session) {
if (session == null || session.getUserId() == null || session.getCompanyId() == null
|| session.getBranchId() == null) throw new IllegalArgumentException("Authenticated scope required");
}
private String auditUser(UserSession session) {
String login = text(session.getUsername()).trim();
String name = text(session.getUserDisplayName()).trim();
return name.isEmpty() ? login : login.isEmpty() ? name : name + "(" + login + ")";
}
private String now() { return LocalDateTime.now().format(DB_TIME); }
private int number(RowView row, String column) {
Object value = row.get(column);
return value instanceof Number n ? n.intValue() : value == null ? 0 : Integer.parseInt(value.toString());
}
private boolean booleanValue(RowView row, String column) { return number(row, column) > 0; }
private int flag(boolean value) { return value ? 1 : -2; }
private int flag01(boolean value) { return value ? 1 : 0; }
private int integer(String value) { return Integer.parseInt(value); }
private int integerOrZero(String value) {
return value == null || value.isBlank() ? 0 : Integer.parseInt(value);
}
private <T> List<T> safe(List<T> values) { return values == null ? List.of() : values; }
private String[][] photoRows(List<RowView> rows) {
String[] columns = {"uuid", "fmvcode", "applno", "customername", "apptype", "visit",
"addr", "city", "pincode", "phoneno", "notes", "verifier", "portname", "product",
"contactperson", "addedon", "inittype", "requiredphoto"};
String[][] result = new String[rows.size()][columns.length];
for (int i = 0; i < rows.size(); i++) {
for (int j = 0; j < columns.length; j++) result[i][j] = text(rows.get(i).get(columns[j]));
}
return result;
}
private GeneratedSheet generateSheet(UserSession session, List<CutOffRecord> parents,
int updateQuery, String process) {
String processTime = now();
List<String[]> reportRows = new ArrayList<>();
int selected = 0;
for (CutOffRecord parent : safe(parents)) {
if (parent.getIslocked() != 0 || !parent.isTv()) continue;
boolean hasSelectedChild = false;
for (CutOffRecord child : safe(parent.getSublist())) {
int selectedBy = child.isTv() ? session.getUserId() : 0;
dbExecutor.update(updateQuery, new Object[] {selectedBy, selectedBy,
auditUser(session), selectedBy, processTime, selectedBy, child.getUuid(),
session.getCompanyId(), session.getBranchId()});
if (child.isTv()) { hasSelectedChild = true; selected++; }
}
if (hasSelectedChild) reportRows.add(new String[] {parent.getPortfolioid(), processTime,
parent.getRepformat(), text(session.getUserId()), "notempty", parent.getRepfunction()});
}
if (selected == 0) return new GeneratedSheet(false, "");
ReportOutput output = new ReportOutput();
output.setProcessFlag(true);
output.setErrCode("1006");
String relativeLink = output.GenerateCallingSheet(reportRows.toArray(String[][]::new),
GlobalClass.getStoragePath(), text(session.getCompanyId()), text(session.getBranchId()), process);
if (!output.isProcessFlag()) throw new IllegalStateException(output.getErrMsg());
dbExecutor.insert(103, new Object[] {processTime, process, relativeLink, session.getBranchId()});
return new GeneratedSheet(true, GlobalClass.DocServer + relativeLink);
}
private record GeneratedSheet(boolean generated, String link) {}
private enum Workflow { ALLOCATION, TELESHEET, REFERENCE, OPERATION }
}

View File

@@ -1,304 +0,0 @@
package matrix.services.edp;
import org.springframework.stereotype.Service;
import com.cygnus.db.CygnusDbExecutor;
import com.cygnus.db.RowView;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import lib.models.DedupeBatch;
import lib.models.DedupeCase;
import lib.models.DedupeRun;
import lib.models.DedupeCaseSummary;
import lib.models.DedupeWorkspace;
import lib.models.DedupeDetails;
import lib.models.DedupeMatchRecord;
import lib.models.DedupeSendCase;
import lib.models.Option;
import lib.models.SendDedupe;
import lib.models.UserSession;
import matrix.nimble.operation.output.model.BankReportHandler;
import matrix.nimble.operation.output.model.ReportSettings;
import matrix.nimble.utilities.GlobalClass;
@Service
public class DedupeService {
private static final int DEDUPE_BATCH_QUERY = 41;
private static final int DEDUPE_CASE_QUERY = 42;
private static final int DEDUPE_WORKLIST_QUERY = 53;
private static final int DEDUPE_PORTFOLIO_QUERY = 446;
private static final int DEDUPE_CHECK_QUERY = 43;
private static final int DEDUPE_DETAILS_QUERY = 54;
private static final int DEDUPE_UPDATE_QUERY = 58;
private static final int DEDUPE_MATCH_RECORDS_QUERY = 56;
private static final int DEDUPE_SEND_QUERY = 132;
private static final int DEDUPE_SEND_PORTFOLIO_QUERY = 134;
private static final DateTimeFormatter RUN_TIME = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss");
private final CygnusDbExecutor dbExecutor;
public DedupeService(CygnusDbExecutor dbExecutor) {
this.dbExecutor = dbExecutor;
}
public DedupeRun loadRun(UserSession session, String csrfToken) {
if (session == null || session.getCompanyId() == null || session.getBranchId() == null
|| session.getUserId() == null) {
throw new IllegalArgumentException("Authenticated session scope is required");
}
Object[] scope = {session.getUserId(), session.getCompanyId(), session.getBranchId()};
List<RowView> batches = dbExecutor.query(DEDUPE_BATCH_QUERY, scope);
List<RowView> cases = dbExecutor.query(DEDUPE_CASE_QUERY, scope);
Map<String, List<DedupeCase>> children = new LinkedHashMap<>();
for (RowView row : cases) {
children.computeIfAbsent(key(row), ignored -> new ArrayList<>()).add(toCase(row));
}
List<DedupeBatch> records = batches.stream().map(row -> {
DedupeBatch batch = new DedupeBatch();
batch.setCutoffKey(text(row, "cutoff_key"));
batch.setCutoffon(text(row, "cutoffon"));
batch.setTotalAddresses(number(row, "totaddr"));
batch.setTotalCases(number(row, "totcase"));
batch.setIslocked(number(row, "islocked"));
batch.setLockedby(text(row, "lockedby"));
batch.setLockOwnerId(integer(row, "lock_owner_id"));
batch.setCases(children.getOrDefault(key(row), List.of()));
return batch;
}).toList();
DedupeRun result = new DedupeRun();
result.setBatches(records);
result.setDedcutTime(LocalDateTime.now().format(RUN_TIME));
result.setCsrfToken(csrfToken);
return result;
}
public void runCheck(UserSession session, String documentCaseId, int operation) {
requireScope(session);
if (documentCaseId == null || documentCaseId.isBlank() || (operation != 1 && operation != 2)) {
throw new IllegalArgumentException("A valid application and dedupe operation are required");
}
List<RowView> rows = dbExecutor.query(DEDUPE_CHECK_QUERY, new Object[] {
documentCaseId, session.getCompanyId(), session.getBranchId(),
documentCaseId, operation, LocalDateTime.now().format(RUN_TIME), session.getUserId(),
auditUser(session)
});
String result = rows.isEmpty() ? "" : text(rows.getFirst(), "result");
if (!result.startsWith("success:")) {
throw new IllegalStateException(result.isBlank() ? "Dedupe check returned no result" : result);
}
}
public DedupeWorkspace loadWorkspace(UserSession session, Integer portfolioId) {
requireScope(session);
DedupeWorkspace workspace = new DedupeWorkspace();
workspace.setPortfolioId(portfolioId);
workspace.setPortfolios(dbExecutor.query(DEDUPE_PORTFOLIO_QUERY,
new Object[] {session.getCompanyId(), session.getBranchId()}, Option.class));
if (portfolioId != null && portfolioId > 0) {
workspace.setCases(dbExecutor.query(DEDUPE_WORKLIST_QUERY,
new Object[] {portfolioId, session.getCompanyId(), session.getBranchId()},
DedupeCaseSummary.class));
}
return workspace;
}
public DedupeDetails loadMatch(UserSession session, String uuid, String requestToken) {
requireScope(session);
if (uuid == null || uuid.isBlank()) {
throw new IllegalArgumentException("Application identifier is required");
}
DedupeDetails details = dbExecutor.queryOne(DEDUPE_DETAILS_QUERY,
new Object[] {uuid, session.getCompanyId(), session.getBranchId()}, DedupeDetails.class)
.orElseThrow(() -> new IllegalArgumentException("Application was not found"));
details.setSessuuid(requestToken);
return details;
}
public List<DedupeMatchRecord> loadMatchRecords(UserSession session, String uuid) {
requireScope(session);
if (uuid == null || uuid.isBlank()) {
throw new IllegalArgumentException("Application identifier is required");
}
return dbExecutor.query(DEDUPE_MATCH_RECORDS_QUERY,
new Object[] {session.getCompanyId(), session.getBranchId(), uuid},
DedupeMatchRecord.class);
}
public void updateMatch(UserSession session, DedupeDetails details) {
requireScope(session);
if (details == null || details.getUuid() == null || details.getUuid().isBlank()) {
throw new IllegalArgumentException("Application identifier is required");
}
String earlierRemarks = normalizeRemarks(details.getEarremarks());
String negativeRemarks = normalizeRemarks(details.getNegremarks());
String processedOn = LocalDateTime.now().format(RUN_TIME);
List<RowView> result = dbExecutor.query(DEDUPE_UPDATE_QUERY, new Object[] {
details.getUuid(), session.getCompanyId(), session.getBranchId(),
earlierRemarks, negativeRemarks, matchFlag(earlierRemarks), matchFlag(negativeRemarks),
processedOn, session.getUserId(), session.getUserId(), auditUser(session), processedOn
});
if (result.isEmpty() || number(result.getFirst(), "result") != 1) {
throw new IllegalStateException("Dedupe details were not saved");
}
}
public List<Option> loadSendPortfolios(UserSession session) {
requireScope(session);
return dbExecutor.query(DEDUPE_SEND_PORTFOLIO_QUERY,
new Object[] {session.getCompanyId(), session.getBranchId()}, Option.class);
}
public SendDedupe loadSendCases(UserSession session, Integer portfolioId, String requestToken) {
requireScope(session);
SendDedupe result = new SendDedupe();
result.setPortfolioid(portfolioId);
result.setSuuid(requestToken);
if (portfolioId == null || portfolioId <= 0) {
return result;
}
List<DedupeSendCase> cases = dbExecutor.query(DEDUPE_SEND_QUERY,
new Object[] {portfolioId, session.getCompanyId(), session.getBranchId()},
DedupeSendCase.class);
result.setCaselist(cases);
if (!cases.isEmpty()) {
DedupeSendCase configuration = cases.getFirst();
result.setFid(configuration.getFid());
result.setDqid(configuration.getDqid());
result.setPortname(configuration.getPortname());
result.setSupervisor(configuration.getSupervisor());
}
return result;
}
public void generateDedupeReports(UserSession session, SendDedupe request, String signPath) {
requireScope(session);
if (request == null || request.getPortfolioid() == null || request.getPortfolioid() <= 0) {
throw new IllegalArgumentException("Portfolio is required");
}
SendDedupe scoped = loadSendCases(session, request.getPortfolioid(), request.getSuuid());
String selectedUuids = selectedUuids(request.getUuids(), scoped.getCaselist());
if (selectedUuids.isBlank()) {
throw new IllegalArgumentException("Select at least one application");
}
ReportSettings settings = new ReportSettings();
settings.setArchivebatch(false);
settings.setAttachannexure(false);
settings.setAutoemail(true);
settings.setDdformat(scoped.getFid());
settings.setDdqid(scoped.getDqid());
settings.setOffsaqid(0);
settings.setOrformat("0");
settings.setOrsaformat("0");
settings.setOvqid(0);
settings.setPortfolioid(String.valueOf(scoped.getPortfolioid()));
settings.setPrformat("0");
settings.setPvqid(0);
settings.setRefvqid(0);
settings.setRrformat("0");
settings.setRtrformat("0");
settings.setRvqid(0);
settings.setTracker("0");
settings.setTrackqid(0);
settings.setTrformat("0");
settings.setTvqid(0);
settings.setUuids(selectedUuids);
settings.setReportby("0");
settings.setReporttype("0");
settings.setPortname(scoped.getPortname());
settings.setPortsupervisor(scoped.getSupervisor());
BankReportHandler reportHandler = new BankReportHandler();
reportHandler.setProcessFlag(true);
reportHandler.setErrCode("5001");
reportHandler.setRunningmode("dedupesend");
reportHandler.setSignPath(signPath);
reportHandler.setRootPath(GlobalClass.getStoragePath() + "output/dedupe/"
+ session.getCompanyId() + "/" + session.getBranchId() + "/");
reportHandler.GenerateReport(settings, String.valueOf(session.getUserId()),
String.valueOf(session.getBranchId()));
if (!reportHandler.isProcessFlag()) {
throw new IllegalStateException(reportHandler.getErrMsg());
}
}
private String normalizeRemarks(String remarks) {
return remarks == null ? "" : remarks.trim().replace("\n", "<br>");
}
private String matchFlag(String remarks) {
return remarks.replace("<br>", "").length() > 10 ? "Y" : "N";
}
private String selectedUuids(String submitted, List<DedupeSendCase> allowedCases) {
if (submitted == null || submitted.isBlank()) return "";
java.util.Set<String> allowed = allowedCases.stream()
.map(DedupeSendCase::getUuid).collect(java.util.stream.Collectors.toSet());
StringBuilder result = new StringBuilder();
java.util.regex.Matcher matcher = java.util.regex.Pattern
.compile("[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}")
.matcher(submitted);
while (matcher.find()) {
String uuid = matcher.group();
if (allowed.contains(uuid)) result.append('\'').append(uuid).append("',");
}
return result.toString();
}
private void requireScope(UserSession session) {
if (session == null || session.getCompanyId() == null || session.getBranchId() == null
|| session.getUserId() == null) {
throw new IllegalArgumentException("Authenticated session scope is required");
}
}
private DedupeCase toCase(RowView row) {
DedupeCase record = new DedupeCase();
record.setMvcode(text(row, "mvcode"));
record.setApplno(text(row, "applno"));
record.setCustomername(text(row, "customername"));
record.setApptype(text(row, "apptype"));
record.setTotrv(number(row, "totrv"));
record.setTotov(number(row, "totov"));
record.setTotpv(number(row, "totpv"));
record.setLockedby(text(row, "lockedby"));
record.setUuid(text(row, "uuid"));
record.setNegative(text(row, "negative"));
record.setEarlier(text(row, "earlier"));
return record;
}
private String key(RowView row) {
return text(row, "cutoff_key") + ':' + integer(row, "lock_owner_id");
}
private String text(RowView row, String column) {
Object value = row.get(column);
return value == null ? "" : value.toString();
}
private int number(RowView row, String column) {
Integer value = integer(row, column);
return value == null ? 0 : value;
}
private Integer integer(RowView row, String column) {
Object value = row.get(column);
return value instanceof Number number ? number.intValue()
: value == null ? null : Integer.valueOf(value.toString());
}
private String auditUser(UserSession session) {
String loginId = session.getUsername() == null ? "" : session.getUsername().trim();
String displayName = session.getUserDisplayName() == null ? "" : session.getUserDisplayName().trim();
if (displayName.isEmpty()) return loginId;
return loginId.isEmpty() ? displayName : displayName + "(" + loginId + ")";
}
}

View File

@@ -2,6 +2,7 @@ package matrix.services.edp;
import com.cygnus.db.CygnusDbExecutor;
import com.cygnus.db.RowView;
import com.cygnus.db.SqlArrayParameter;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -9,7 +10,6 @@ import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.regex.Pattern;
import java.sql.SQLException;
import java.sql.Date;
@@ -31,7 +31,8 @@ import lib.models.LocalityOption;
import lib.models.UserSession;
import lib.constants.ApplicationMessage;
import lib.exceptions.ApplicationException;
import matrix.nimble.utilities.CommonFunctions;
import matrix.nimble.edp.punching.model.PunchingHandler;
import matrix.nimble.utilities.GlobalClass;
import matrix.services.commons.CommonService;
@Service
@@ -54,19 +55,23 @@ public class PunchingService {
private static final int OFFICE_DETAILS_QUERY = 20;
private static final int PROPERTY_DETAILS_QUERY = 21;
private static final int CO_APPLICANT_DETAILS_QUERY = 22;
private static final int VISIBLE_SECTIONS_QUERY = 10;
private static final int DYNAMIC_CONTROLS_QUERY = 74;
private static final Short CASE_INITIATION_PAGE = Short.valueOf((short) 10);
private static final String ADD_CASE_TEMPLATE = "ADDCASE";
private static final Pattern DYNAMIC_FIELD = Pattern.compile(
"(?:field(?:[1-9]|1[0-2]|150(?:_2)?)|dtfield1)", Pattern.CASE_INSENSITIVE);
private static final List<String> GENERAL_OPTION_TYPES = List.of("CITY", "APPTYPE");
private static final List<String> PORTFOLIO_OPTION_TYPES = List.of("CATEGORY", "PRODUCT");
private static final SqlArrayParameter GENERAL_OPTION_TYPES =
SqlArrayParameter.text("CITY", "APPTYPE");
private static final SqlArrayParameter PORTFOLIO_OPTION_TYPES =
SqlArrayParameter.text("CATEGORY", "PRODUCT");
private final CommonService commonService;
private final CygnusDbExecutor dbExecutor;
private final ObjectMapper objectMapper;
public PunchingService(CommonService commonService) {
this.commonService = commonService;
this.dbExecutor = null;
this.objectMapper = null;
}
@Autowired
public PunchingService(
CommonService commonService, CygnusDbExecutor dbExecutor, ObjectMapper objectMapper) {
@@ -84,9 +89,8 @@ public class PunchingService {
try {
String json = objectMapper.writeValueAsString(details);
ApplicationSaveResult result = dbExecutor.procedure("APPLICATION_SAVE",
new Object[] { json, session.getCompanyId(), session.getBranchId(),
session.getUserId(), auditUser(session) },
ApplicationSaveResult.class);
new Object[] {json, session.getCompanyId(), session.getBranchId(),
session.getUserId()}, ApplicationSaveResult.class);
if (result == null || result.getApplicationId() == null) {
throw new ApplicationException(
ApplicationMessage.APPLICATION_SAVE_FAILED, "Database returned no application result");
@@ -146,8 +150,7 @@ public class PunchingService {
ApplicationMessage.APPLICATION_VALIDATION_FAILED, "Portfolio is required");
}
String caseUuid = documentCaseId != null && documentCaseId.trim().length() > 20
? documentCaseId.trim()
: "";
? documentCaseId.trim() : "";
try {
List<RowView> rows = dbExecutor.query(PUNCHED_RECORDS_QUERY, new Object[] {
caseUuid, caseUuid, caseUuid, portfolioId,
@@ -175,11 +178,11 @@ public class PunchingService {
Date receivedDate = Date.valueOf(LocalDate.now());
Object[] parameters = switch (queryId) {
case RESIDENCE_DETAILS_QUERY, OFFICE_DETAILS_QUERY, CO_APPLICANT_DETAILS_QUERY ->
new Object[] { applicationNumber.trim(), portfolioId, receivedDate,
session.getCompanyId(), session.getBranchId() };
new Object[] {applicationNumber.trim(), portfolioId, receivedDate,
session.getCompanyId(), session.getBranchId()};
case PROPERTY_DETAILS_QUERY ->
new Object[] { applicationNumber.trim(), portfolioId,
session.getCompanyId(), session.getBranchId(), receivedDate };
new Object[] {applicationNumber.trim(), portfolioId,
session.getCompanyId(), session.getBranchId(), receivedDate};
default -> throw new ApplicationException(
ApplicationMessage.APPLICATION_VALIDATION_FAILED, "Unsupported duplicate search type");
};
@@ -234,16 +237,13 @@ public class PunchingService {
private Map<String, Object> toPunchedRecord(RowView row) {
Map<String, Object> record = new LinkedHashMap<>();
row.asMap().forEach((name, value) -> {
if (!"dynamic_fields".equalsIgnoreCase(name))
record.put(name, value == null ? "" : value);
if (!"dynamic_fields".equalsIgnoreCase(name)) record.put(name, value == null ? "" : value);
});
Object dynamicValue = row.get("dynamic_fields");
if (dynamicValue == null || dynamicValue.toString().isBlank())
return record;
if (dynamicValue == null || dynamicValue.toString().isBlank()) return record;
try {
Map<String, Object> dynamicFields = objectMapper.readValue(
dynamicValue.toString(), new TypeReference<Map<String, Object>>() {
});
dynamicValue.toString(), new TypeReference<Map<String, Object>>() {});
dynamicFields.forEach((name, value) -> {
if (name != null && DYNAMIC_FIELD.matcher(name).matches()) {
record.put(name, value == null ? "" : value);
@@ -326,24 +326,16 @@ public class PunchingService {
"Database read failed", exception);
}
private boolean blank(String value) {
return value == null || value.isBlank();
}
private String auditUser(UserSession session) {
String loginId = defaultString(session.getUsername()).trim();
String displayName = defaultString(session.getUserDisplayName()).trim();
if (displayName.isEmpty()) {
return loginId;
}
return loginId.isEmpty() ? displayName : displayName + "(" + loginId + ")";
}
private boolean blank(String value) { return value == null || value.isBlank(); }
public CasePunching init(
Short branchId,
Short userId,
String verificationCaseId,
String documentCaseId) {
PunchingHandler punchingHandler = new PunchingHandler();
punchingHandler.setErrCode("1001");
CasePunching casePunching = new CasePunching();
Map<String, List<Option>> options = new LinkedHashMap<>();
List<Option> portfolios = commonService.getOptions(
@@ -384,126 +376,44 @@ public class PunchingService {
}
Short portfolioId = submitted.getPortfolioId();
try {
DynamicContent dynamicContent = loadDynamicContent(portfolioId);
result.setDynamicFields(dynamicContent.fields());
result.setDynamicHtml(dynamicContent.html());
result.setVisibleSections(dynamicContent.visibleSections());
} catch (RuntimeException exception) {
throw databaseReadFailure(exception);
PunchingHandler punchingHandler = new PunchingHandler();
punchingHandler.setErrCode("1001");
punchingHandler.setPortfolioid(Short.toString(portfolioId));
punchingHandler.setProcessFlag(true);
punchingHandler.DynamicHtml("10");
if (punchingHandler.isProcessFlag()) {
result.setDynamicFields(defaultString(punchingHandler.getDynamicfields()));
result.setDynamicHtml(defaultString(punchingHandler.getDynamicpanel()));
String sections = defaultString(punchingHandler.GetVisibleSections())
+ defaultString(punchingHandler.getDynamicsection());
result.setVisibleSections(toVisibleSections(sections));
} else {
result.setDynamicFields("");
result.setDynamicHtml("");
result.setVisibleSections(List.of());
result.setMessageDetails(new MessageDetails(ApplicationMessage.INTERNAL_SERVER_ERROR));
}
result.setOptions(loadOptions(branchId, companyId, portfolioId));
return result;
}
private DynamicContent loadDynamicContent(Short portfolioId) {
if (dbExecutor == null) {
throw new IllegalStateException("Database dependencies are not configured");
}
List<String> visibleSections = dbExecutor.query(
VISIBLE_SECTIONS_QUERY,
new Object[] { CASE_INITIATION_PAGE, portfolioId })
.stream()
.map(row -> rowText(row, "control").trim())
.filter(value -> !value.isEmpty())
.distinct()
.collect(java.util.stream.Collectors.toCollection(java.util.ArrayList::new));
List<RowView> controls = dbExecutor.query(
DYNAMIC_CONTROLS_QUERY,
new Object[] { portfolioId, CASE_INITIATION_PAGE, ADD_CASE_TEMPLATE });
if (controls.isEmpty()) {
return new DynamicContent("", "", List.copyOf(visibleSections));
}
CommonFunctions controlsRenderer = new CommonFunctions();
controlsRenderer.setGeneratedHtml("");
controlsRenderer.setPrevControl("");
controlsRenderer.setDynamicCtrls("");
StringBuilder html = new StringBuilder();
for (RowView row : controls) {
String container = controlsRenderer.DynamicControls(
dynamicControlValues(row), "");
if (!"Othersec".equals(container)) {
continue;
}
String generated = defaultString(controlsRenderer.getGeneratedHtml());
trimDuplicateSelectClosing(html, generated);
html.append(generated);
}
visibleSections.add("section6");
return new DynamicContent(
defaultString(controlsRenderer.getDynamicCtrls()),
html.toString(),
visibleSections.stream().distinct().toList());
}
private String[] dynamicControlValues(RowView row) {
String[] columns = {
"field_id", "label", "controlid", "cssclass", "containerid", "maxlength",
"onclick", "ondbclick", "onfocus", "onblur", "onkeypress", "onkeydown",
"onkeyup", "onchange", "ctrltype", "ctrlwidth", "ctrlheight", "defaultvalue",
"fieldorder", "fieldvalue", "valorder", "page_id", "portfolio_id",
"template_id", "template", "template_type", "isvisible"
};
String[] values = new String[columns.length];
for (int index = 0; index < columns.length; index++) {
values[index] = rowText(row, columns[index]);
}
return values;
}
private void trimDuplicateSelectClosing(StringBuilder html, String generated) {
String closing = "</select></div></div></div>";
if (html.toString().endsWith(closing)
&& generated.endsWith(closing)
&& !generated.startsWith("<div class='widget'>")) {
html.setLength(html.length() - closing.length());
}
}
Map<String, List<Option>> loadOptions(
Short branchId, Short companyId, Short portfolioId) {
Map<String, List<Option>> options = new LinkedHashMap<>();
List<Option> portfolios = commonService.getOptions(
3, new Object[] { branchId, ACTIVE });
addOptions(options, PORTFOLIO, portfolios);
addOptions(options, PORTFOLIO, commonService.getOptions(
3, new Object[] {branchId, ACTIVE}));
addOptions(options, BRANCH, commonService.getOptions(
4, new Object[] { portfolioId, ACTIVE }));
addGroupedOptions(options, commonService.getCloudOptions(
"company-options", Map.of(
"companyId", companyId,
"descriptions", GENERAL_OPTION_TYPES)));
addGroupedOptions(options, commonService.getCloudOptions(
"portfolio-options", Map.of(
"companyId", companyId,
"branchId", branchId,
"portfolioReference", portfolioReference(portfolios, portfolioId),
"descriptions", PORTFOLIO_OPTION_TYPES)));
4, new Object[] {portfolioId, ACTIVE}));
addGroupedOptions(options, commonService.getOptions(
5, new Object[] {companyId, GENERAL_OPTION_TYPES}));
addGroupedOptions(options, commonService.getOptions(
70, new Object[] {portfolioId, PORTFOLIO_OPTION_TYPES}));
return freezeOptions(options);
}
private UUID portfolioReference(List<Option> portfolios, Short portfolioId) {
String reference = portfolios.stream()
.filter(option -> option != null
&& String.valueOf(option.getValue()).equals(String.valueOf(portfolioId)))
.map(Option::getDescription)
.filter(candidate -> candidate != null && !candidate.isBlank())
.findFirst()
.orElseThrow(() -> new ApplicationException(
ApplicationMessage.APPLICATION_ACCESS_DENIED,
"Portfolio reference is unavailable"));
try {
return UUID.fromString(reference);
} catch (IllegalArgumentException exception) {
throw new ApplicationException(
ApplicationMessage.APPLICATION_ACCESS_DENIED,
"Portfolio reference is invalid");
}
}
public CasePunching prepareApplicationEdit(
Short portfolioId,
String documentCaseId,
@@ -561,12 +471,9 @@ public class PunchingService {
if (DATABASE_APPLICATION_TYPE.equalsIgnoreCase(normalized)) {
return APPLICATION_TYPE;
}
if (CITY.equalsIgnoreCase(normalized))
return CITY;
if (CATEGORY.equalsIgnoreCase(normalized))
return CATEGORY;
if (PRODUCT.equalsIgnoreCase(normalized))
return PRODUCT;
if (CITY.equalsIgnoreCase(normalized)) return CITY;
if (CATEGORY.equalsIgnoreCase(normalized)) return CATEGORY;
if (PRODUCT.equalsIgnoreCase(normalized)) return PRODUCT;
return null;
}
@@ -579,13 +486,18 @@ public class PunchingService {
return Collections.unmodifiableMap(immutable);
}
private List<String> toVisibleSections(String sections) {
if (sections == null || sections.isBlank()) {
return List.of();
}
return List.of(sections.split(Pattern.quote(GlobalClass.ColDelim))).stream()
.map(String::trim)
.filter(section -> !section.isEmpty() && !"null".equalsIgnoreCase(section))
.distinct()
.toList();
}
private String defaultString(String value) {
return value == null ? "" : value;
}
private record DynamicContent(
String fields,
String html,
List<String> visibleSections) {
}
}

View File

@@ -371,7 +371,7 @@ class RoleVisibleBatchMigrationTest {
String content = Files.readString(edpTools.resolve(page));
assertTrue(content.contains("matrix-shell matrix-tool-workspace"), page);
assertTrue(content.contains("tool-workspace-v3.css"), page);
assertTrue(content.contains("app-shell-header.jspf"), page);
assertTrue(content.contains("Sessvals.menuHtml"), page);
assertFalse(content.contains("z-index:-1"), page);
assertFalse(content.contains("centerDivBoth(\"formcontainer\""), page);
}
@@ -464,19 +464,18 @@ class RoleVisibleBatchMigrationTest {
String content = Files.readString(dedupe.resolve(page));
assertTrue(content.contains("matrix-shell matrix-tool-workspace"), page);
assertTrue(content.contains("tool-workspace-v3.css"), page);
assertTrue(content.contains("app-shell-header.jspf"), page);
assertTrue(content.contains("Sessvals.menuHtml"), page);
assertFalse(content.contains("z-index:-1"), page);
assertFalse(content.contains("centerDivBoth(\"formcontainer\""), page);
}
String run = Files.readString(dedupe.resolve("deduperun.jsp"));
assertTrue(run.contains("ExpandList(this.id)"));
assertTrue(run.contains("/js/edp/dedupe/dedupe-run.js"));
assertTrue(run.contains("showDedupePanel('cutlist${mystatus.count}')"));
String send = Files.readString(dedupe.resolve("dedupesend.jsp"));
assertTrue(send.contains("dedupe-send.js"));
assertTrue(send.contains("data-list-url="));
assertTrue(send.contains("data-generate-url="));
assertTrue(send.contains("ToggleChecks('chkrow',this.checked)"));
assertTrue(send.contains("ValidateSendDedupe('senddedupe')"));
String viewer = Files.readString(dedupe.resolve("matchfound.jsp"));
assertTrue(viewer.contains("matrix-dialog-child.js"));

View File

@@ -1,120 +0,0 @@
package matrix.services.edp;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import com.cygnus.db.CygnusDbExecutor;
import com.cygnus.db.RowView;
import java.lang.reflect.Proxy;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import lib.models.UserSession;
import org.junit.jupiter.api.Test;
class DedupeServiceTest {
@Test
void runsTenantScopedDedupeCheck() {
List<Object[]> parameters = new ArrayList<>();
CygnusDbExecutor executor = (CygnusDbExecutor) Proxy.newProxyInstance(
getClass().getClassLoader(), new Class<?>[] {CygnusDbExecutor.class},
(proxy, method, args) -> {
if (!method.getName().equals("query") || args.length != 2) {
throw new UnsupportedOperationException(method.toString());
}
assertEquals(43, args[0]);
parameters.add(((Object[]) args[1]).clone());
return List.of(row(Map.of("result", "success:")));
});
UserSession session = UserSession.builder()
.userId((short) 9).companyId((short) 1).branchId((short) 5).build();
new DedupeService(executor).runCheck(session, "case-1", 2);
Object[] values = parameters.getFirst();
assertArrayEquals(new Object[] {"case-1", (short) 1, (short) 5},
new Object[] {values[0], values[1], values[2]});
assertEquals("case-1", values[3]);
assertEquals(2, values[4]);
assertEquals((short) 9, values[6]);
}
@Test
void loadsTenantScopedDedupeWorkspace() {
List<Integer> queryIds = new ArrayList<>();
List<Object[]> parameters = new ArrayList<>();
CygnusDbExecutor executor = (CygnusDbExecutor) Proxy.newProxyInstance(
getClass().getClassLoader(), new Class<?>[] {CygnusDbExecutor.class},
(proxy, method, args) -> {
if (!method.getName().equals("query") || args.length != 3) {
throw new UnsupportedOperationException(method.toString());
}
queryIds.add((Integer) args[0]);
parameters.add(((Object[]) args[1]).clone());
return List.of();
});
UserSession session = UserSession.builder()
.userId((short) 9).companyId((short) 1).branchId((short) 5).build();
var workspace = new DedupeService(executor).loadWorkspace(session, 23);
assertEquals(List.of(446, 53), queryIds);
assertArrayEquals(new Object[] {(short) 1, (short) 5}, parameters.getFirst());
assertArrayEquals(new Object[] {23, (short) 1, (short) 5}, parameters.getLast());
assertEquals(23, workspace.getPortfolioId());
}
@Test
void loadsBatchesAndCasesWithSessionScopeInTwoQueries() {
List<Object[]> parameters = new ArrayList<>();
AtomicInteger calls = new AtomicInteger();
CygnusDbExecutor executor = (CygnusDbExecutor) Proxy.newProxyInstance(
getClass().getClassLoader(), new Class<?>[] {CygnusDbExecutor.class},
(proxy, method, args) -> {
if (!method.getName().equals("query") || args.length != 2) {
throw new UnsupportedOperationException(method.toString());
}
parameters.add(((Object[]) args[1]).clone());
int queryId = (Integer) args[0];
calls.incrementAndGet();
return queryId == 41 ? List.of(row(Map.of(
"cutoff_key", "2026-08-09 10:00:00.000000",
"cutoffon", "09-Aug-2026 10:00:00 AM",
"totaddr", 2L, "totcase", 1L, "islocked", 0,
"lockedby", "None", "lock_owner_id", 0)))
: List.of(row(Map.ofEntries(
Map.entry("cutoff_key", "2026-08-09 10:00:00.000000"),
Map.entry("lock_owner_id", 0), Map.entry("mvcode", "MV1"),
Map.entry("applno", "APP1"), Map.entry("customername", "Customer"),
Map.entry("apptype", "Applicant"), Map.entry("totrv", 1),
Map.entry("totov", 1), Map.entry("totpv", 0),
Map.entry("islocked", 0), Map.entry("lockedby", "None"),
Map.entry("uuid", "case-1"), Map.entry("negative", "Y"),
Map.entry("earlier", "N"))));
});
UserSession session = UserSession.builder()
.userId((short) 9).companyId((short) 1).branchId((short) 5).build();
var result = new DedupeService(executor).loadRun(session, "session-1");
assertEquals(2, calls.get());
assertArrayEquals(new Object[] {(short) 9, (short) 1, (short) 5}, parameters.getFirst());
assertArrayEquals(parameters.getFirst(), parameters.getLast());
assertEquals("session-1", result.getCsrfToken());
assertEquals("MV1", result.getBatches().getFirst().getCases().getFirst().getMvcode());
}
private RowView row(Map<String, Object> values) {
Map<String, Object> columns = new LinkedHashMap<>(values);
return (RowView) Proxy.newProxyInstance(getClass().getClassLoader(),
new Class<?>[] {RowView.class}, (proxy, method, args) -> {
if (method.getName().equals("get") && args.length == 1) {
return columns.get(args[0].toString());
}
if (method.getName().equals("asMap")) return columns;
throw new UnsupportedOperationException(method.toString());
});
}
}

View File

@@ -6,6 +6,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
import com.cygnus.db.CygnusDbExecutor;
import com.cygnus.db.RowView;
import com.cygnus.db.SqlArrayParameter;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.lang.reflect.Proxy;
import java.util.ArrayList;
@@ -17,7 +18,6 @@ import java.sql.Date;
import java.time.LocalDate;
import lib.exceptions.ApplicationException;
import lib.models.PunchedRecordsData;
import lib.models.CasePunching;
import lib.models.UserSession;
import lib.models.Option;
import matrix.services.commons.CommonService;
@@ -25,222 +25,170 @@ import org.junit.jupiter.api.Test;
class PunchingServiceTest {
@Test
void loadsDuplicateDetailsWithAllowlistedQueryAndSessionScope() {
AtomicReference<Integer> query = new AtomicReference<>();
AtomicReference<Object[]> parameters = new AtomicReference<>();
RowView row = row(new LinkedHashMap<>(Map.of("paddr1", "House 1", "pcolony", 42)));
CygnusDbExecutor executor = (CygnusDbExecutor) Proxy.newProxyInstance(
getClass().getClassLoader(), new Class<?>[] { CygnusDbExecutor.class },
(proxy, method, args) -> {
if (method.getName().equals("query") && args.length == 2) {
query.set((Integer) args[0]);
parameters.set(((Object[]) args[1]).clone());
return List.of(row);
}
throw new UnsupportedOperationException(method.toString());
});
PunchingService service = new PunchingService(
new CommonService(), executor, new ObjectMapper());
UserSession session = UserSession.builder()
.companyId((short) 3).branchId((short) 7).build();
@Test
void loadsDuplicateDetailsWithAllowlistedQueryAndSessionScope() {
AtomicReference<Integer> query = new AtomicReference<>();
AtomicReference<Object[]> parameters = new AtomicReference<>();
RowView row = row(new LinkedHashMap<>(Map.of("paddr1", "House 1", "pcolony", 42)));
CygnusDbExecutor executor = (CygnusDbExecutor) Proxy.newProxyInstance(
getClass().getClassLoader(), new Class<?>[] {CygnusDbExecutor.class},
(proxy, method, args) -> {
if (method.getName().equals("query") && args.length == 2) {
query.set((Integer) args[0]);
parameters.set(((Object[]) args[1]).clone());
return List.of(row);
}
throw new UnsupportedOperationException(method.toString());
});
PunchingService service = new PunchingService(
new CommonService(), executor, new ObjectMapper());
UserSession session = UserSession.builder()
.companyId((short) 3).branchId((short) 7).build();
var result = service.findDuplicateDetails(" APP-1 ", (short) 38, 21, session);
var result = service.findDuplicateDetails(" APP-1 ", (short) 38, 21, session);
assertEquals(21, query.get());
assertArrayEquals(new Object[] { "APP-1", (short) 38, (short) 3, (short) 7,
Date.valueOf(LocalDate.now()) }, parameters.get());
assertEquals("House 1", result.records().getFirst().get("paddr1"));
assertThrows(ApplicationException.class,
() -> service.findDuplicateDetails("APP-1", (short) 38, 23, session));
assertEquals(21, query.get());
assertArrayEquals(new Object[] {"APP-1", (short) 38, (short) 3, (short) 7,
Date.valueOf(LocalDate.now())}, parameters.get());
assertEquals("House 1", result.records().getFirst().get("paddr1"));
assertThrows(ApplicationException.class,
() -> service.findDuplicateDetails("APP-1", (short) 38, 23, session));
}
@Test
void derivesLocalityCompanyScopeFromSessionBranch() {
AtomicReference<Object[]> parameters = new AtomicReference<>();
Map<String, Object> columns = new LinkedHashMap<>();
columns.put("id", 42);
columns.put("location", "Sector 14");
columns.put("pincode", "122001 ");
columns.put("city", "Gurugram");
CygnusDbExecutor executor = (CygnusDbExecutor) Proxy.newProxyInstance(
getClass().getClassLoader(), new Class<?>[] {CygnusDbExecutor.class},
(proxy, method, args) -> {
if (method.getName().equals("query") && args.length == 2) {
assertEquals(13, args[0]);
parameters.set(((Object[]) args[1]).clone());
return List.of(row(columns));
}
throw new UnsupportedOperationException(method.toString());
});
PunchingService service = new PunchingService(
new CommonService(), executor, new ObjectMapper());
UserSession session = UserSession.builder()
.companyId((short) 3).branchId((short) 7).build();
var result = service.findLocalities(" Gurugram ", " Sec ", session);
assertArrayEquals(new Object[] {(short) 7, "Sec", "Gurugram", "Gurugram"},
parameters.get());
assertEquals(42, result.localities().getFirst().id());
assertEquals("122001", result.localities().getFirst().pincode());
}
@Test
void loadsPunchedRecordsAsFormShapedObjectsAndMergesDynamicFields() {
AtomicReference<Object[]> parameters = new AtomicReference<>();
Map<String, Object> columns = new LinkedHashMap<>();
columns.put("case_id", 101);
columns.put("applno", "APP-1");
columns.put("dynamic_fields", "{\"field1\":\"Dealer\",\"field150_2\":\"Note\"}");
RowView row = row(columns);
CygnusDbExecutor executor = (CygnusDbExecutor) Proxy.newProxyInstance(
getClass().getClassLoader(), new Class<?>[] {CygnusDbExecutor.class},
(proxy, method, args) -> {
if (method.getName().equals("query") && args.length == 2) {
assertEquals(24, args[0]);
parameters.set(((Object[]) args[1]).clone());
return List.of(row);
}
throw new UnsupportedOperationException(method.toString());
});
PunchingService service = new PunchingService(
new CommonService(), executor, new ObjectMapper());
UserSession session = UserSession.builder()
.companyId((short) 3).branchId((short) 7).build();
PunchedRecordsData result = service.loadPunchedRecords(
(short) 38, "c4e2680c-fdb0-48cb-aa07-a563aa64cdb9", session);
assertArrayEquals(new Object[] {"c4e2680c-fdb0-48cb-aa07-a563aa64cdb9",
"c4e2680c-fdb0-48cb-aa07-a563aa64cdb9",
"c4e2680c-fdb0-48cb-aa07-a563aa64cdb9", (short) 38, (short) 3, (short) 7},
parameters.get());
assertEquals(101, result.records().getFirst().get("case_id"));
assertEquals("Dealer", result.records().getFirst().get("field1"));
assertEquals("Note", result.records().getFirst().get("field150_2"));
assertEquals(false, result.records().getFirst().containsKey("dynamic_fields"));
}
@Test
void loadsParameterizedOptionsAndNormalizesApplicationTypeGroup() {
RecordingCommonService commonService = new RecordingCommonService();
PunchingService service = new PunchingService(commonService);
Map<String, List<Option>> options = service.loadOptions((short) 5, (short) 1, (short) 38);
assertEquals(List.of(3, 4, 5, 70),
commonService.calls.stream().map(Call::queryId).toList());
assertArrayEquals(new Object[] {(short) 5, (short) 1},
commonService.calls.get(0).parameters());
assertArrayEquals(new Object[] {(short) 38, (short) 1},
commonService.calls.get(1).parameters());
assertEquals((short) 1, commonService.calls.get(2).parameters()[0]);
assertArrayEquals(new Object[] {"CITY", "APPTYPE"},
((SqlArrayParameter) commonService.calls.get(2).parameters()[1]).values());
assertEquals((short) 38, commonService.calls.get(3).parameters()[0]);
assertArrayEquals(new Object[] {"CATEGORY", "PRODUCT"},
((SqlArrayParameter) commonService.calls.get(3).parameters()[1]).values());
assertEquals("Portfolio", options.get("portfolio.").getFirst().getLabel());
assertEquals("Branch", options.get("branch.").getFirst().getLabel());
assertEquals("City", options.get("city.").getFirst().getLabel());
assertEquals("Applicant", options.get("applicationType.").getFirst().getLabel());
assertEquals("Category", options.get("category.").getFirst().getLabel());
assertEquals("Product", options.get("product.").getFirst().getLabel());
assertThrows(UnsupportedOperationException.class,
() -> options.put("other.", List.of()));
}
private static final class RecordingCommonService extends CommonService {
private final List<Call> calls = new ArrayList<>();
@Override
public List<Option> getOptions(Integer queryId, Object[] queryParams) {
calls.add(new Call(queryId, queryParams.clone()));
return switch (queryId) {
case 3 -> List.of(option(38, "Portfolio", "portfolio."));
case 4 -> List.of(option(7, "Branch", "branch."));
case 5 -> List.of(
option("DEL", "City", "city."),
option("APPLICANT", "Applicant", "apptype."));
case 70 -> List.of(
option("DIRECTOR", "Category", "category."),
option("AUTO", "Product", "product."));
default -> List.of();
};
}
}
@Test
void derivesLocalityCompanyScopeFromSessionBranch() {
AtomicReference<Object[]> parameters = new AtomicReference<>();
Map<String, Object> columns = new LinkedHashMap<>();
columns.put("id", 42);
columns.put("location", "Sector 14");
columns.put("pincode", "122001 ");
columns.put("city", "Gurugram");
CygnusDbExecutor executor = (CygnusDbExecutor) Proxy.newProxyInstance(
getClass().getClassLoader(), new Class<?>[] { CygnusDbExecutor.class },
(proxy, method, args) -> {
if (method.getName().equals("query") && args.length == 2) {
assertEquals(13, args[0]);
parameters.set(((Object[]) args[1]).clone());
return List.of(row(columns));
}
throw new UnsupportedOperationException(method.toString());
});
PunchingService service = new PunchingService(
new CommonService(), executor, new ObjectMapper());
UserSession session = UserSession.builder()
.companyId((short) 3).branchId((short) 7).build();
private static Option option(Object value, String label, String group) {
Option option = new Option();
option.setValue(value);
option.setLabel(label);
option.setGroup(group);
return option;
}
var result = service.findLocalities(" Gurugram ", " Sec ", session);
private static RowView row(Map<String, Object> columns) {
return new RowView() {
@Override public Object get(String column) { return columns.get(column); }
@Override public <T> T get(String column, Class<T> type) {
return type.cast(columns.get(column));
}
@Override public Map<String, Object> asMap() { return columns; }
};
}
assertArrayEquals(new Object[] { (short) 7, "Sec", "Gurugram", "Gurugram" },
parameters.get());
assertEquals(42, result.localities().getFirst().id());
assertEquals("122001", result.localities().getFirst().pincode());
}
@Test
void loadsPunchedRecordsAsFormShapedObjectsAndMergesDynamicFields() {
AtomicReference<Object[]> parameters = new AtomicReference<>();
Map<String, Object> columns = new LinkedHashMap<>();
columns.put("case_id", 101);
columns.put("applno", "APP-1");
columns.put("dynamic_fields", "{\"field1\":\"Dealer\",\"field150_2\":\"Note\"}");
RowView row = row(columns);
CygnusDbExecutor executor = (CygnusDbExecutor) Proxy.newProxyInstance(
getClass().getClassLoader(), new Class<?>[] { CygnusDbExecutor.class },
(proxy, method, args) -> {
if (method.getName().equals("query") && args.length == 2) {
assertEquals(24, args[0]);
parameters.set(((Object[]) args[1]).clone());
return List.of(row);
}
throw new UnsupportedOperationException(method.toString());
});
PunchingService service = new PunchingService(
new CommonService(), executor, new ObjectMapper());
UserSession session = UserSession.builder()
.companyId((short) 3).branchId((short) 7).build();
PunchedRecordsData result = service.loadPunchedRecords(
(short) 38, "c4e2680c-fdb0-48cb-aa07-a563aa64cdb9", session);
assertArrayEquals(new Object[] { "c4e2680c-fdb0-48cb-aa07-a563aa64cdb9",
"c4e2680c-fdb0-48cb-aa07-a563aa64cdb9",
"c4e2680c-fdb0-48cb-aa07-a563aa64cdb9", (short) 38, (short) 3, (short) 7 },
parameters.get());
assertEquals(101, result.records().getFirst().get("case_id"));
assertEquals("Dealer", result.records().getFirst().get("field1"));
assertEquals("Note", result.records().getFirst().get("field150_2"));
assertEquals(false, result.records().getFirst().containsKey("dynamic_fields"));
}
@Test
void loadsParameterizedOptionsAndNormalizesApplicationTypeGroup() {
RecordingCommonService commonService = new RecordingCommonService();
PunchingService service = new PunchingService(
commonService, null, new ObjectMapper());
Map<String, List<Option>> options = service.loadOptions((short) 5, (short) 1, (short) 38);
assertEquals(List.of(3, 4),
commonService.calls.stream().map(Call::queryId).toList());
assertArrayEquals(new Object[] { (short) 5, (short) 1 },
commonService.calls.get(0).parameters());
assertArrayEquals(new Object[] { (short) 38, (short) 1 },
commonService.calls.get(1).parameters());
assertEquals("Portfolio", options.get("portfolio.").getFirst().getLabel());
assertEquals("Branch", options.get("branch.").getFirst().getLabel());
assertEquals("City", options.get("city.").getFirst().getLabel());
assertEquals("Applicant", options.get("applicationType.").getFirst().getLabel());
assertEquals("Category", options.get("category.").getFirst().getLabel());
assertEquals("Product", options.get("product.").getFirst().getLabel());
assertThrows(UnsupportedOperationException.class,
() -> options.put("other.", List.of()));
}
@Test
void preparesNewApplicationWithoutLegacyPunchingHandlerQueries() {
List<Call> databaseCalls = new ArrayList<>();
CygnusDbExecutor executor = (CygnusDbExecutor) Proxy.newProxyInstance(
getClass().getClassLoader(), new Class<?>[] { CygnusDbExecutor.class },
(proxy, method, args) -> {
if (!method.getName().equals("query") || args.length != 2) {
throw new UnsupportedOperationException(method.toString());
}
int queryId = (Integer) args[0];
databaseCalls.add(new Call(queryId, ((Object[]) args[1]).clone()));
return queryId == 10
? List.of(row(new LinkedHashMap<>(
Map.of("control", "section1"))))
: List.of();
});
PunchingService service = new PunchingService(
new RecordingCommonService(), executor, new ObjectMapper());
CasePunching submitted = new CasePunching();
submitted.setPortfolioId((short) 38);
CasePunching result = service.prepareNewApplication(
submitted, (short) 5, (short) 1, (short) 9);
assertEquals(List.of(10, 74),
databaseCalls.stream().map(Call::queryId).toList());
assertArrayEquals(new Object[] { (short) 10, (short) 38 },
databaseCalls.get(0).parameters());
assertArrayEquals(new Object[] { (short) 38, (short) 10, "ADDCASE" },
databaseCalls.get(1).parameters());
assertEquals(List.of("section1"), result.getVisibleSections());
assertEquals("", result.getDynamicHtml());
assertEquals("", result.getDynamicFields());
}
private static final class RecordingCommonService extends CommonService {
private final List<Call> calls = new ArrayList<>();
@Override
public List<Option> getOptions(Integer queryId, Object[] queryParams) {
calls.add(new Call(queryId, queryParams.clone()));
return switch (queryId) {
case 3 -> List.of(option(38, "Portfolio", "portfolio.",
"88e0cb4a-3b4d-401c-b11b-fe4117842fef"));
case 4 -> List.of(option(7, "Branch", "branch."));
default -> List.of();
};
}
@Override
public List<Option> getCloudOptions(String scope, Map<String, Object> data) {
return switch (scope) {
case "company-options" -> List.of(
option("DEL", "City", "city."),
option("APPLICANT", "Applicant", "apptype."));
case "portfolio-options" -> List.of(
option("DIRECTOR", "Category", "category."),
option("AUTO", "Product", "product."));
default -> List.of();
};
}
}
private static Option option(Object value, String label, String group) {
return option(value, label, group, null);
}
private static Option option(Object value, String label, String group, String description) {
Option option = new Option();
option.setValue(value);
option.setLabel(label);
option.setGroup(group);
option.setDescription(description);
return option;
}
private static RowView row(Map<String, Object> columns) {
return new RowView() {
@Override
public Object get(String column) {
return columns.get(column);
}
@Override
public <T> T get(String column, Class<T> type) {
return type.cast(columns.get(column));
}
@Override
public Map<String, Object> asMap() {
return columns;
}
};
}
private record Call(int queryId, Object[] parameters) {
}
private record Call(int queryId, Object[] parameters) {}
}

View File

@@ -1,20 +0,0 @@
UPDATE platform.application_query
SET query_text =
'select!C0L!SELECT control '
'FROM app_process '
'WHERE page_id=? '
'AND process_id NOT IN ('
'SELECT process_id FROM denied_process WHERE portfolio_id=? AND isdenied=1'
')'
WHERE query_id=10;
UPDATE platform.application_query
SET query_text =
'select!C0L!SELECT field_id, label, controlid, cssclass, containerid, maxlength, '
'onclick, ondbclick, onfocus, onblur, onkeypress, onkeydown, onkeyup, onchange, '
'ctrltype, ctrlwidth, ctrlheight, defaultvalue, fieldorder, fieldvalue, valorder, '
'page_id, portfolio_id, template_id, template, template_type, isvisible '
'FROM dynamic_controls '
'WHERE portfolio_id=? AND page_id=? AND template_type=? '
'ORDER BY fieldorder, field_id, valorder, label, containerid'
WHERE query_id=74;

View File

@@ -1,45 +0,0 @@
-- Parameterized, base-table-only queries for /rundedupe.
UPDATE platform.application_query
SET query_text =
'select!C0L!SELECT '
'to_char(mo.cutoffon, ''YYYY-MM-DD HH24:MI:SS.US'') AS cutoff_key, '
'to_char(mo.cutoffon, ''DD-Mon-YYYY HH12:MI:SS AM'') AS cutoffon, '
'SUM(c.rv) + SUM(c.ov) + SUM(c.pv) AS totaddr, COUNT(*) AS totcase, '
'CASE WHEN mo.islocked <> ? AND mo.islocked > 0 THEN 1 ELSE 0 END AS islocked, '
'COALESCE(NULLIF(mo.lockedbyuser, ''''), ''None'') AS lockedby, '
'mo.islocked AS lock_owner_id '
'FROM main c JOIN main_operations mo ON mo.case_id = c.case_id '
'WHERE c.isdeleted = 0 AND mo.sdone = 0 '
'AND (mo.dedcutby IS NULL OR mo.dedcutby = 0) AND mo.cutoffby > 0 '
'AND (mo.earlier = 1 OR mo.negative = 1) '
'AND ((mo.earlierby IS NULL OR mo.earlierby = 0) '
'OR (mo.negativeby IS NULL OR mo.negativeby = 0)) '
'AND c.company_id = ? AND c.branch_id = ? '
'GROUP BY mo.cutoffon, mo.islocked, mo.lockedbyuser '
'ORDER BY mo.cutoffon DESC, mo.islocked',
ismigrated = true
WHERE query_id = 41;
UPDATE platform.application_query
SET query_text =
'select!C0L!SELECT '
'to_char(mo.cutoffon, ''YYYY-MM-DD HH24:MI:SS.US'') AS cutoff_key, '
'mo.islocked AS lock_owner_id, c.mvcode, c.applno, c.customername, c.apptype, '
'c.rv AS totrv, c.ov AS totov, c.pv AS totpv, '
'CASE WHEN mo.islocked <> ? AND mo.islocked > 0 THEN 1 ELSE 0 END AS islocked, '
'COALESCE(NULLIF(mo.lockedbyuser, ''''), ''None'') AS lockedby, '
'c.uuid::text AS uuid, '
'CASE WHEN mo.negative = 1 AND (mo.negativeby IS NULL OR mo.negativeby = 0) '
'THEN ''Y'' ELSE ''N'' END AS negative, '
'CASE WHEN mo.earlier = 1 AND (mo.earlierby IS NULL OR mo.earlierby = 0) '
'THEN ''Y'' ELSE ''N'' END AS earlier '
'FROM main c JOIN main_operations mo ON mo.case_id = c.case_id '
'WHERE c.isdeleted = 0 AND mo.sdone = 0 '
'AND (mo.dedcutby IS NULL OR mo.dedcutby = 0) AND mo.cutoffby > 0 '
'AND (mo.earlier = 1 OR mo.negative = 1) '
'AND ((mo.earlierby IS NULL OR mo.earlierby = 0) '
'OR (mo.negativeby IS NULL OR mo.negativeby = 0)) '
'AND c.company_id = ? AND c.branch_id = ? '
'ORDER BY mo.cutoffon DESC, mo.islocked, c.mvcode',
ismigrated = true
WHERE query_id = 42;

View File

@@ -1,89 +0,0 @@
-- Introduce the integer relationship without breaking legacy UUID-based writers.
ALTER TABLE public.main_operations
ADD COLUMN IF NOT EXISTS case_id integer;
UPDATE public.main_operations mo
SET case_id = m.case_id
FROM public.main m
WHERE mo.case_id IS NULL
AND m.uuid::text = mo.uuid::text;
DO $migration$
BEGIN
IF EXISTS (SELECT 1 FROM public.main_operations WHERE case_id IS NULL) THEN
RAISE EXCEPTION 'Cannot migrate main_operations.case_id: unresolved UUID rows exist';
END IF;
END
$migration$;
CREATE UNIQUE INDEX CONCURRENTLY IF NOT EXISTS ux_main_operations_case_id
ON public.main_operations (case_id);
CREATE OR REPLACE FUNCTION public.sync_main_operations_case_id()
RETURNS trigger
LANGUAGE plpgsql
AS $function$
BEGIN
IF NEW.case_id IS NULL
OR (TG_OP = 'UPDATE' AND NEW.uuid IS DISTINCT FROM OLD.uuid) THEN
SELECT m.case_id INTO NEW.case_id
FROM public.main m
WHERE m.uuid::text = NEW.uuid::text;
END IF;
RETURN NEW;
END
$function$;
DROP TRIGGER IF EXISTS trg_main_operations_case_id ON public.main_operations;
CREATE TRIGGER trg_main_operations_case_id
BEFORE INSERT OR UPDATE OF uuid ON public.main_operations
FOR EACH ROW EXECUTE FUNCTION public.sync_main_operations_case_id();
DO $migration$
BEGIN
IF NOT EXISTS (
SELECT 1 FROM pg_constraint
WHERE conrelid = 'public.main_operations'::regclass
AND conname = 'fk_main_operations_case_id'
) THEN
ALTER TABLE public.main_operations
ADD CONSTRAINT fk_main_operations_case_id
FOREIGN KEY (case_id) REFERENCES public.main(case_id)
ON UPDATE CASCADE ON DELETE CASCADE NOT VALID;
END IF;
END
$migration$;
ALTER TABLE public.main_operations
VALIDATE CONSTRAINT fk_main_operations_case_id;
DO $migration$
BEGIN
IF NOT EXISTS (
SELECT 1 FROM pg_constraint
WHERE conrelid = 'public.main_operations'::regclass
AND conname = 'ck_main_operations_case_id_not_null'
) THEN
ALTER TABLE public.main_operations
ADD CONSTRAINT ck_main_operations_case_id_not_null
CHECK (case_id IS NOT NULL) NOT VALID;
END IF;
END
$migration$;
ALTER TABLE public.main_operations
VALIDATE CONSTRAINT ck_main_operations_case_id_not_null;
ALTER TABLE public.main_operations
ALTER COLUMN case_id SET NOT NULL;
ALTER TABLE public.main_operations
DROP CONSTRAINT ck_main_operations_case_id_not_null;
-- Switch /rundedupe from the compatibility UUID relationship to the integer key.
UPDATE platform.application_query
SET query_text = replace(
query_text,
'JOIN main_operations mo ON mo.uuid::text = c.uuid::text',
'JOIN main_operations mo ON mo.case_id = c.case_id')
WHERE query_id IN (41, 42, 53, 446);

View File

@@ -1,36 +0,0 @@
-- Parameterized, tenant-scoped, base-table queries for /dodedupe.
UPDATE platform.application_query
SET query_text =
'select!C0L!SELECT DISTINCT c.portfolio_id AS value, p.portname AS label, '
'''portfolio.'' AS "group" '
'FROM main c '
'JOIN main_operations mo ON mo.uuid::text = c.uuid::text '
'JOIN portfolio p ON p.portfolio_id = c.portfolio_id '
'WHERE c.isdeleted = 0 AND mo.sdone = 0 '
'AND (mo.dedcutby IS NULL OR mo.dedcutby = 0) '
'AND ((mo.earlierby > 0 AND mo.earlier = 1) OR mo.earlier = 0) '
'AND ((mo.negativeby > 0 AND mo.negative = 1) OR mo.negative = 0) '
'AND (mo.earlier = 1 OR mo.negative = 1) '
'AND c.company_id = ? AND c.branch_id = ? '
'ORDER BY p.portname'
WHERE query_id = 446;
UPDATE platform.application_query
SET query_text =
'select!C0L!SELECT c.uuid::text AS document_case_id, '
'c.portfolio_id, c.mvcode AS mv_code, c.applno AS file_number, '
'c.customername AS customer_name, c.apptype AS application_type, '
'c.rv AS residence_visits, c.ov AS office_visits, c.pv AS property_visits, '
'to_char(c.receivedate, ''DD/MM/YYYY'') AS received_on, '
'CASE WHEN COALESCE(c.rv, 0) + COALESCE(c.ov, 0) + COALESCE(c.pv, 0) = '
'COALESCE(mo.rvdone, 0) + COALESCE(mo.ovdone, 0) + COALESCE(mo.pvdone, 0) '
'THEN ''Y'' ELSE ''N'' END AS done '
'FROM main c JOIN main_operations mo ON mo.uuid::text = c.uuid::text '
'WHERE c.isdeleted = 0 AND mo.sdone = 0 AND c.portfolio_id = ? '
'AND (mo.dedcutby IS NULL OR mo.dedcutby = 0) '
'AND ((mo.earlierby > 0 AND mo.earlier = 1) OR mo.earlier = 0) '
'AND ((mo.negativeby > 0 AND mo.negative = 1) OR mo.negative = 0) '
'AND (mo.earlier = 1 OR mo.negative = 1) '
'AND c.company_id = ? AND c.branch_id = ? '
'ORDER BY done DESC, c.applno, c.apptype'
WHERE query_id = 53;

View File

@@ -1,14 +0,0 @@
-- Scoped, parameterized query used by POST /checkdedupe.
UPDATE platform.application_query
SET query_text =
'select!C0L!SELECT CASE WHEN EXISTS ('
'SELECT 1 FROM main c JOIN main_operations mo ON mo.case_id = c.case_id '
'WHERE c.uuid::text = ? AND c.isdeleted = 0 AND mo.sdone = 0 '
'AND c.company_id = ? AND c.branch_id = ?) '
'THEN dedupebyuuid_with_user(?, ?, ''Y'', ?, ?, ?) ELSE ''failed:Access denied'' END AS result',
ismigrated = true
WHERE query_id = 43;
UPDATE platform.application_query
SET ismigrated = true
WHERE query_id IN (41, 42);

View File

@@ -1,170 +0,0 @@
BEGIN;
ALTER TABLE public.main
ADD COLUMN IF NOT EXISTS addedbyuser text,
ADD COLUMN IF NOT EXISTS lasteditedbyuser text;
ALTER TABLE public.main_operations
ADD COLUMN IF NOT EXISTS cutoffbyuser text,
ADD COLUMN IF NOT EXISTS allocatedbyuser text,
ADD COLUMN IF NOT EXISTS dedcutbyuser text,
ADD COLUMN IF NOT EXISTS earlierbyuser text,
ADD COLUMN IF NOT EXISTS negativebyuser text,
ADD COLUMN IF NOT EXISTS oprsendbyuser text,
ADD COLUMN IF NOT EXISTS lockedbyuser text;
ALTER TABLE public.caseedit_history
ADD COLUMN IF NOT EXISTS operationbyuser text;
CREATE OR REPLACE FUNCTION public.save_application_details_with_user(
p_application jsonb,
p_company_id smallint,
p_branch_id smallint,
p_user_id smallint,
p_user_name text
)
RETURNS TABLE(operation text, application_id integer, mv_code text, internal_uuid text)
LANGUAGE plpgsql
SECURITY DEFINER
SET search_path = public, pg_temp
AS $function$
DECLARE
v_result record;
BEGIN
SELECT * INTO STRICT v_result
FROM public.save_application_details(
p_application, p_company_id, p_branch_id, p_user_id);
UPDATE public.main
SET addedbyuser = CASE
WHEN v_result.operation = 'INSERT' OR addedbyuser IS NULL THEN p_user_name
ELSE addedbyuser
END,
lasteditedbyuser = CASE
WHEN v_result.operation = 'UPDATE' THEN p_user_name
ELSE lasteditedbyuser
END
WHERE case_id = v_result.application_id
AND company_id = p_company_id
AND branch_id = p_branch_id;
UPDATE public.main_operations
SET cutoffbyuser = CASE WHEN cutoffby = p_user_id THEN p_user_name ELSE cutoffbyuser END,
allocatedbyuser = CASE WHEN allocatedby = p_user_id THEN p_user_name ELSE allocatedbyuser END,
earlierbyuser = CASE WHEN earlierby = p_user_id THEN p_user_name ELSE earlierbyuser END,
negativebyuser = CASE WHEN negativeby = p_user_id THEN p_user_name ELSE negativebyuser END,
oprsendbyuser = CASE WHEN oprsendby = p_user_id THEN p_user_name ELSE oprsendbyuser END,
lockedbyuser = CASE WHEN islocked = p_user_id THEN p_user_name ELSE lockedbyuser END
WHERE case_id = v_result.application_id
AND company_id = p_company_id
AND branch_id = p_branch_id;
UPDATE public.caseedit_history
SET operationbyuser = p_user_name
WHERE uuid = v_result.internal_uuid
AND user_id = p_user_id
AND operationbyuser IS NULL;
RETURN QUERY SELECT v_result.operation::text, v_result.application_id::integer,
v_result.mv_code::text, v_result.internal_uuid::text;
END;
$function$;
CREATE OR REPLACE FUNCTION public.dedupebyuuid_with_user(
p_unique_id text,
p_operation integer,
p_to_be_processed text,
p_dedupe_check_time text,
p_user_id integer,
p_user_name text
)
RETURNS text
LANGUAGE plpgsql
SECURITY DEFINER
SET search_path = public, pg_temp
AS $function$
DECLARE
v_result text;
BEGIN
v_result := public.dedupebyuuid(
p_unique_id, p_operation, p_to_be_processed, p_dedupe_check_time, p_user_id);
IF v_result LIKE 'success:%' THEN
UPDATE public.main_operations
SET earlierbyuser = CASE WHEN p_operation = 1 THEN p_user_name ELSE earlierbyuser END,
negativebyuser = CASE WHEN p_operation = 2 THEN p_user_name ELSE negativebyuser END
WHERE uuid = p_unique_id;
END IF;
RETURN v_result;
END;
$function$;
UPDATE platform.application_query
SET query_text =
'procedure!C0L!select * from public.save_application_details_with_user('
'?::jsonb,?::smallint,?::smallint,?::smallint,?::text)',
ismigrated = true,
updated_at = clock_timestamp()
WHERE query_key = 'APPLICATION_SAVE';
DELETE FROM platform.application_query
WHERE query_id = 3092
AND query_key IS NULL;
UPDATE platform.application_query
SET query_text =
'select!C0L!SELECT to_char(mo.cutoffon, ''YYYY-MM-DD HH24:MI:SS.US'') AS cutoff_key, '
'to_char(mo.cutoffon, ''DD-Mon-YYYY HH12:MI:SS AM'') AS cutoffon, '
'SUM(c.rv) + SUM(c.ov) + SUM(c.pv) AS totaddr, COUNT(*) AS totcase, '
'CASE WHEN mo.islocked <> ? AND mo.islocked > 0 THEN 1 ELSE 0 END AS islocked, '
'COALESCE(NULLIF(mo.lockedbyuser, ''''), ''None'') AS lockedby, '
'mo.islocked AS lock_owner_id FROM main c '
'JOIN main_operations mo ON mo.case_id = c.case_id '
'WHERE c.isdeleted = 0 AND mo.sdone = 0 '
'AND (mo.dedcutby IS NULL OR mo.dedcutby = 0) AND mo.cutoffby > 0 '
'AND (mo.earlier = 1 OR mo.negative = 1) '
'AND ((mo.earlierby IS NULL OR mo.earlierby = 0) '
'OR (mo.negativeby IS NULL OR mo.negativeby = 0)) '
'AND c.company_id = ? AND c.branch_id = ? '
'GROUP BY mo.cutoffon, mo.islocked, mo.lockedbyuser '
'ORDER BY mo.cutoffon DESC, mo.islocked',
ismigrated = true,
updated_at = clock_timestamp()
WHERE query_id = 41;
UPDATE platform.application_query
SET query_text =
'select!C0L!SELECT to_char(mo.cutoffon, ''YYYY-MM-DD HH24:MI:SS.US'') AS cutoff_key, '
'mo.islocked AS lock_owner_id, c.mvcode, c.applno, c.customername, c.apptype, '
'c.rv AS totrv, c.ov AS totov, c.pv AS totpv, '
'CASE WHEN mo.islocked <> ? AND mo.islocked > 0 THEN 1 ELSE 0 END AS islocked, '
'COALESCE(NULLIF(mo.lockedbyuser, ''''), ''None'') AS lockedby, c.uuid::text AS uuid, '
'CASE WHEN mo.negative = 1 AND (mo.negativeby IS NULL OR mo.negativeby = 0) '
'THEN ''Y'' ELSE ''N'' END AS negative, '
'CASE WHEN mo.earlier = 1 AND (mo.earlierby IS NULL OR mo.earlierby = 0) '
'THEN ''Y'' ELSE ''N'' END AS earlier '
'FROM main c JOIN main_operations mo ON mo.case_id = c.case_id '
'WHERE c.isdeleted = 0 AND mo.sdone = 0 '
'AND (mo.dedcutby IS NULL OR mo.dedcutby = 0) AND mo.cutoffby > 0 '
'AND (mo.earlier = 1 OR mo.negative = 1) '
'AND ((mo.earlierby IS NULL OR mo.earlierby = 0) '
'OR (mo.negativeby IS NULL OR mo.negativeby = 0)) '
'AND c.company_id = ? AND c.branch_id = ? '
'ORDER BY mo.cutoffon DESC, mo.islocked, c.mvcode',
ismigrated = true,
updated_at = clock_timestamp()
WHERE query_id = 42;
UPDATE platform.application_query
SET query_text =
'select!C0L!SELECT CASE WHEN EXISTS ('
'SELECT 1 FROM main c JOIN main_operations mo ON mo.case_id = c.case_id '
'WHERE c.uuid::text = ? AND c.isdeleted = 0 AND mo.sdone = 0 '
'AND c.company_id = ? AND c.branch_id = ?) '
'THEN dedupebyuuid_with_user(?, ?, ''Y'', ?, ?, ?) '
'ELSE ''failed:Access denied'' END AS result',
ismigrated = true,
updated_at = clock_timestamp()
WHERE query_id = 43;
COMMIT;

View File

@@ -1,68 +0,0 @@
BEGIN;
ALTER TABLE public.main_operations
ADD COLUMN IF NOT EXISTS allocatedbyuser text,
ADD COLUMN IF NOT EXISTS oprsendbyuser text;
ALTER TABLE public.caseedit_history
ADD COLUMN IF NOT EXISTS operationbyuser text;
CREATE OR REPLACE FUNCTION public.save_application_details_with_user(
p_application jsonb,
p_company_id smallint,
p_branch_id smallint,
p_user_id smallint,
p_user_name text
)
RETURNS TABLE(operation text, application_id integer, mv_code text, internal_uuid text)
LANGUAGE plpgsql
SECURITY DEFINER
SET search_path = public, pg_temp
AS $function$
DECLARE
v_result record;
BEGIN
SELECT * INTO STRICT v_result
FROM public.save_application_details(
p_application, p_company_id, p_branch_id, p_user_id);
UPDATE public.main
SET addedbyuser = CASE
WHEN v_result.operation = 'INSERT' OR addedbyuser IS NULL THEN p_user_name
ELSE addedbyuser
END,
lasteditedbyuser = CASE
WHEN v_result.operation = 'UPDATE' THEN p_user_name
ELSE lasteditedbyuser
END
WHERE case_id = v_result.application_id
AND company_id = p_company_id
AND branch_id = p_branch_id;
UPDATE public.main_operations
SET cutoffbyuser = CASE WHEN cutoffby = p_user_id THEN p_user_name ELSE cutoffbyuser END,
allocatedbyuser = CASE WHEN allocatedby = p_user_id THEN p_user_name ELSE allocatedbyuser END,
earlierbyuser = CASE WHEN earlierby = p_user_id THEN p_user_name ELSE earlierbyuser END,
negativebyuser = CASE WHEN negativeby = p_user_id THEN p_user_name ELSE negativebyuser END,
oprsendbyuser = CASE WHEN oprsendby = p_user_id THEN p_user_name ELSE oprsendbyuser END,
lockedbyuser = CASE WHEN islocked = p_user_id THEN p_user_name ELSE lockedbyuser END
WHERE case_id = v_result.application_id
AND company_id = p_company_id
AND branch_id = p_branch_id;
UPDATE public.caseedit_history
SET operationbyuser = p_user_name
WHERE uuid = v_result.internal_uuid
AND user_id = p_user_id
AND operationbyuser IS NULL;
RETURN QUERY SELECT v_result.operation::text, v_result.application_id::integer,
v_result.mv_code::text, v_result.internal_uuid::text;
END;
$function$;
DELETE FROM platform.application_query
WHERE query_id = 3092
AND query_key IS NULL;
COMMIT;

View File

@@ -1,60 +0,0 @@
-- Parameterized, tenant-scoped Cut-Off workflow queries. Views and app_user joins are intentionally avoided.
UPDATE platform.application_query SET query_text =
'update!C0L!UPDATE main_operations mo SET cutoffon=?::timestamp, islocked=?, lockedbyuser=? FROM main m WHERE m.case_id=mo.case_id AND m.isdeleted=0 AND mo.sdone=0 AND (mo.cutoffby IS NULL OR mo.cutoffby=0) AND m.addedby<>0 AND m.company_id=? AND m.branch_id=? AND (mo.islocked=0 OR mo.islocked=?)', ismigrated=true WHERE query_id=17;
UPDATE platform.application_query SET query_text =
'select!C0L!SELECT m.portfolio_id, p.portname||'' <b>(''||count(*)||'')</b>'' portname, CASE WHEN sum(mo.allocation)<=0 THEN -1 ELSE 1 END allocation, CASE WHEN sum(mo.sms)<=0 THEN -1 ELSE 1 END sms, CASE WHEN sum(mo.telesheet)>=1 THEN 1 ELSE 0 END telesheet, CASE WHEN sum(mo.earlier)<=0 THEN -1 ELSE 1 END earlier, CASE WHEN sum(mo.negative)<=0 THEN -1 ELSE 1 END negative, CASE WHEN mo.islocked<>? THEN 1 ELSE 0 END islocked, coalesce(mo.lockedbyuser,'''') lockedby FROM main m JOIN main_operations mo ON mo.case_id=m.case_id JOIN portfolio p ON p.portfolio_id=m.portfolio_id WHERE m.isdeleted=0 AND mo.sdone=0 AND (mo.cutoffby IS NULL OR mo.cutoffby=0) AND m.addedby<>0 AND m.company_id=? AND m.branch_id=? GROUP BY m.portfolio_id,p.portname,mo.islocked,mo.lockedbyuser ORDER BY p.portname', ismigrated=true WHERE query_id=18;
UPDATE platform.application_query SET query_text =
'update!C0L!UPDATE main_operations mo SET allocation=CASE WHEN x.selected THEN x.allocation ELSE mo.allocation END,sms=CASE WHEN x.selected THEN x.sms ELSE mo.sms END,smsby=CASE WHEN x.selected AND x.sms<0 THEN x.user_id ELSE mo.smsby END,telesheet=CASE WHEN x.selected THEN CASE WHEN mo.telesheet=0 THEN 0 ELSE x.telesheet END ELSE mo.telesheet END,telesheetby=CASE WHEN x.selected AND x.telesheet<0 THEN x.user_id ELSE mo.telesheetby END,earlier=CASE WHEN x.selected THEN x.earlier ELSE mo.earlier END,earlierby=CASE WHEN x.selected AND x.earlier<0 THEN x.user_id ELSE mo.earlierby END,negative=CASE WHEN x.selected THEN x.negative ELSE mo.negative END,negativeby=CASE WHEN x.selected AND x.negative<0 THEN x.user_id ELSE mo.negativeby END,cutoffby=CASE WHEN x.selected THEN x.user_id ELSE mo.cutoffby END,cutoffbyuser=CASE WHEN x.selected THEN x.audit_user ELSE mo.cutoffbyuser END,islocked=0,lockedbyuser=NULL,batch=CASE WHEN x.selected THEN x.batch ELSE mo.batch END,cutoffon=CASE WHEN x.selected THEN mo.cutoffon ELSE NULL END FROM main m,(SELECT ?::boolean selected,?::smallint allocation,?::smallint sms,?::smallint telesheet,?::smallint earlier,?::smallint negative,?::integer user_id,?::text audit_user,?::text batch) x WHERE m.case_id=mo.case_id AND m.company_id=? AND m.branch_id=? AND m.portfolio_id=? AND mo.cutoffon=?::timestamp AND mo.islocked=? AND (mo.cutoffby IS NULL OR mo.cutoffby=0)', ismigrated=true WHERE query_id=26;
UPDATE platform.application_query SET query_text =
'update!C0L!UPDATE main_operations mo SET islocked=?, lockedbyuser=? FROM main m WHERE m.case_id=mo.case_id AND m.isdeleted=0 AND mo.sdone=0 AND mo.cutoffby>0 AND (mo.islocked=0 OR mo.islocked=?) AND coalesce(mo.allocatedby,0)=0 AND m.company_id=? AND m.branch_id=? AND mo.allocation=1', ismigrated=true WHERE query_id=27;
UPDATE platform.application_query SET query_text =
'select!C0L!SELECT m.portfolio_id,p.portname||'' <b>(''||count(*)||'')</b>'' portname,sum(m.rv) rv,sum(m.ov) ov,sum(m.pv) pv,CASE WHEN mo.islocked<>? THEN 1 ELSE 0 END islocked,mo.allocation,coalesce(mo.lockedbyuser,'''') lockedby FROM main m JOIN main_operations mo ON mo.case_id=m.case_id JOIN portfolio p ON p.portfolio_id=m.portfolio_id WHERE m.isdeleted=0 AND mo.sdone=0 AND coalesce(mo.allocatedby,0)=0 AND mo.cutoffby>0 AND m.company_id=? AND m.branch_id=? AND mo.allocation=1 AND (m.rv=1 OR m.ov=1 OR m.pv=1) GROUP BY m.portfolio_id,p.portname,mo.islocked,mo.allocation,mo.lockedbyuser ORDER BY p.portname', ismigrated=true WHERE query_id=28;
UPDATE platform.application_query SET query_text =
'select!C0L!SELECT m.portfolio_id,m.mvcode,m.applno,m.customername,m.apptype,m.rv,m.ov,m.pv,CASE WHEN mo.islocked<>? THEN 1 ELSE 0 END islocked,coalesce(mo.lockedbyuser,'''') lockedby,mo.allocation,m.rcolony,m.ocolony,m.pcolony,m.uuid,p."group" portgroup FROM main m JOIN main_operations mo ON mo.case_id=m.case_id JOIN portfolio p ON p.portfolio_id=m.portfolio_id WHERE m.isdeleted=0 AND mo.sdone=0 AND coalesce(mo.allocatedby,0)=0 AND mo.cutoffby>0 AND mo.islocked=? AND m.company_id=? AND m.branch_id=? AND mo.allocation=1 AND (m.rv=1 OR m.ov=1 OR m.pv=1) ORDER BY m.portfolio_id,m.applno,m.apptype', ismigrated=true WHERE query_id=29;
UPDATE platform.application_query SET query_text='procedure!C0L!SELECT CASE WHEN EXISTS (SELECT 1 FROM main m WHERE m.uuid::text=x.uniqueid AND m.company_id=x.companyid AND m.branch_id=x.branchid AND m.portfolio_id=x.portfolioid AND m.isdeleted=0) THEN allocatecase(x.uniqueid,x.selected,x.rv,x.ov,x.pv,x.rcolony,x.ocolony,x.pcolony,x.processedon,x.companyid,x.branchid,x.portfolioid,x.portgroup) ELSE ''error:Access denied'' END FROM (SELECT ?::text uniqueid,?::integer selected,?::integer rv,?::integer ov,?::integer pv,?::integer rcolony,?::integer ocolony,?::integer pcolony,?::text processedon,?::integer companyid,?::integer branchid,?::integer portfolioid,?::text portgroup) x', ismigrated=true WHERE query_id=30;
UPDATE platform.application_query SET query_text=
'update!C0L!UPDATE main_operations mo SET islocked=?, lockedbyuser=? FROM main m WHERE m.case_id=mo.case_id AND m.isdeleted=0 AND mo.sdone=0 AND mo.cutoffby>0 AND (mo.islocked=0 OR mo.islocked=?) AND coalesce(mo.telesheetby,0)=0 AND m.company_id=? AND m.branch_id=? AND mo.telesheet=1', ismigrated=true WHERE query_id=31;
UPDATE platform.application_query SET query_text=
'select!C0L!SELECT m.portfolio_id,p.portname||'' <b>(''||count(*)||'')</b>'' portname,sum(m.rtv) rtv,sum(m.otv) otv,sum(m.refv) refv,CASE WHEN mo.islocked<>? THEN 1 ELSE 0 END islocked,mo.telesheet,coalesce(mo.lockedbyuser,'''') lockedby,pf.tsformat outputformat,pf.tsfunction outputfunction FROM main m JOIN main_operations mo ON mo.case_id=m.case_id JOIN portfolio p ON p.portfolio_id=m.portfolio_id JOIN process_formats pf ON pf.portfolio_id=m.portfolio_id WHERE m.isdeleted=0 AND mo.sdone=0 AND coalesce(mo.telesheetby,0)=0 AND mo.cutoffby>0 AND m.company_id=? AND m.branch_id=? AND mo.telesheet=1 AND (m.rtv>0 OR m.otv>0) GROUP BY m.portfolio_id,p.portname,mo.islocked,mo.telesheet,mo.lockedbyuser,pf.tsformat,pf.tsfunction ORDER BY p.portname', ismigrated=true WHERE query_id=32;
UPDATE platform.application_query SET query_text=
'select!C0L!SELECT m.portfolio_id,m.mvcode,m.applno,m.customername,m.apptype,m.rtv,m.otv,m.refv,CASE WHEN mo.islocked<>? THEN 1 ELSE 0 END islocked,coalesce(mo.lockedbyuser,'''') lockedby,mo.telesheet,m.uuid FROM main m JOIN main_operations mo ON mo.case_id=m.case_id WHERE m.isdeleted=0 AND mo.sdone=0 AND coalesce(mo.telesheetby,0)=0 AND mo.cutoffby>0 AND mo.islocked=? AND m.company_id=? AND m.branch_id=? AND mo.telesheet=1 AND (m.rtv=1 OR m.otv=1) ORDER BY m.portfolio_id,m.applno,m.apptype', ismigrated=true WHERE query_id=33;
UPDATE platform.application_query SET query_text='update!C0L!UPDATE main_operations mo SET islocked=?, lockedbyuser=CASE WHEN ?>0 THEN ? ELSE NULL END,telesheeton=CASE WHEN ?>0 THEN ?::timestamp ELSE NULL END,telesheetby=? FROM main m WHERE m.case_id=mo.case_id AND m.uuid::text=? AND m.company_id=? AND m.branch_id=?', ismigrated=true WHERE query_id=34;
UPDATE platform.application_query SET query_text=
'update!C0L!UPDATE main_operations mo SET islocked=?, lockedbyuser=? FROM main m WHERE m.case_id=mo.case_id AND m.isdeleted=0 AND mo.sdone=0 AND mo.cutoffby>0 AND (mo.islocked=0 OR mo.islocked=?) AND coalesce(mo.oprsendby,0)=0 AND m.company_id=? AND m.branch_id=? AND mo.oprsend<>1 AND ((mo.allocation=1 AND mo.allocatedby>0) OR mo.allocation<>1) AND ((mo.telesheet=1 AND mo.telesheetby>0) OR mo.telesheet<>1)', ismigrated=true WHERE query_id=44;
UPDATE platform.application_query SET query_text=
'select!C0L!SELECT m.portfolio_id,p.portname||'' <b>(''||count(*)||'')</b>'' portname,sum(m.rv) rv,sum(m.ov) ov,sum(m.pv) pv,sum(m.rtv) rtv,sum(m.otv) otv,sum(m.refv) refv,CASE WHEN mo.islocked<>? THEN 1 ELSE 0 END islocked,1 oprsend,coalesce(mo.lockedbyuser,'''') lockedby FROM main m JOIN main_operations mo ON mo.case_id=m.case_id JOIN portfolio p ON p.portfolio_id=m.portfolio_id WHERE m.isdeleted=0 AND mo.sdone=0 AND coalesce(mo.oprsendby,0)=0 AND mo.cutoffby>=0 AND m.company_id=? AND m.branch_id=? AND mo.oprsend<>1 AND ((mo.allocation=1 AND mo.allocatedby>0) OR mo.allocation<>1 OR (m.rv=0 AND m.ov=0 AND m.pv=0 AND mo.allocation=1)) AND ((mo.telesheet=1 AND mo.telesheetby>0) OR mo.telesheet<>1) AND (m.rv=1 OR m.ov=1 OR m.pv=1 OR m.rtv=1 OR m.otv=1) GROUP BY m.portfolio_id,p.portname,mo.islocked,mo.lockedbyuser ORDER BY p.portname', ismigrated=true WHERE query_id=45;
UPDATE platform.application_query SET query_text=
'select!C0L!SELECT m.portfolio_id,m.mvcode,m.applno,m.customername,m.apptype,m.rv,m.ov,m.pv,m.rtv,m.otv,m.refv,CASE WHEN mo.islocked<>? THEN 1 ELSE 0 END islocked,coalesce(mo.lockedbyuser,'''') lockedby,1 oprsend,m.uuid FROM main m JOIN main_operations mo ON mo.case_id=m.case_id WHERE m.isdeleted=0 AND mo.sdone=0 AND coalesce(mo.oprsendby,0)=0 AND mo.cutoffby>0 AND mo.islocked=? AND m.company_id=? AND m.branch_id=? AND mo.oprsend<>1 AND ((mo.allocation=1 AND mo.allocatedby>0) OR mo.allocation<>1 OR (m.rv=0 AND m.ov=0 AND m.pv=0 AND mo.allocation=1)) AND ((mo.telesheet=1 AND mo.telesheetby>0) OR mo.telesheet<>1) AND (m.rv=1 OR m.ov=1 OR m.pv=1 OR m.rtv=1 OR m.otv=1) ORDER BY m.portfolio_id,m.applno,m.apptype', ismigrated=true WHERE query_id=46;
UPDATE platform.application_query SET query_text='procedure!C0L!SELECT CASE WHEN EXISTS (SELECT 1 FROM main m WHERE m.uuid::text=x.uniqueid::text AND m.company_id=x.companyid AND m.branch_id=x.branchid AND m.portfolio_id=x.portfolioid AND m.isdeleted=0) THEN sendtooperation(x.uniqueid,x.selected,x.processedon,x.userid,x.companyid,x.branchid,x.portfolioid) ELSE ''error:Access denied'' END FROM (SELECT ?::bpchar uniqueid,?::integer selected,?::bpchar processedon,?::integer userid,?::integer companyid,?::integer branchid,?::integer portfolioid) x', ismigrated=true WHERE query_id=47;
UPDATE platform.application_query SET query_text='insert!C0L!INSERT INTO app_documents (processtime,process,documenturl,branch_id) VALUES (?::timestamp,?,?,?)', ismigrated=true WHERE query_id=103;
UPDATE platform.application_query SET query_text=
'update!C0L!UPDATE main_operations mo SET islocked=?, lockedbyuser=? FROM main m WHERE m.case_id=mo.case_id AND m.isdeleted=0 AND mo.sdone=0 AND mo.cutoffby>0 AND (mo.islocked=0 OR mo.islocked=?) AND coalesce(mo.refsheetby,0)=0 AND m.company_id=? AND m.branch_id=? AND mo.refsheet=1', ismigrated=true WHERE query_id=216;
UPDATE platform.application_query SET query_text=
'select!C0L!SELECT m.portfolio_id,p.portname||'' <b>(''||count(*)||'')</b>'' portname,sum(m.refv) refv,CASE WHEN mo.islocked<>? THEN 1 ELSE 0 END islocked,mo.refsheet,coalesce(mo.lockedbyuser,'''') lockedby,pf.refformat outputformat,pf.reffunction outputfunction FROM main m JOIN main_operations mo ON mo.case_id=m.case_id JOIN portfolio p ON p.portfolio_id=m.portfolio_id JOIN process_formats pf ON pf.portfolio_id=m.portfolio_id WHERE m.isdeleted=0 AND mo.sdone=0 AND coalesce(mo.refsheetby,0)=0 AND mo.cutoffby>0 AND m.company_id=? AND m.branch_id=? AND mo.refsheet=1 AND m.refv=1 GROUP BY m.portfolio_id,p.portname,mo.islocked,mo.refsheet,mo.lockedbyuser,pf.refformat,pf.reffunction ORDER BY p.portname', ismigrated=true WHERE query_id=217;
UPDATE platform.application_query SET query_text=
'select!C0L!SELECT m.portfolio_id,m.mvcode,m.applno,m.customername,m.apptype,m.refv,CASE WHEN mo.islocked<>? THEN 1 ELSE 0 END islocked,coalesce(mo.lockedbyuser,'''') lockedby,mo.refsheet telesheet,m.uuid FROM main m JOIN main_operations mo ON mo.case_id=m.case_id WHERE m.isdeleted=0 AND mo.sdone=0 AND coalesce(mo.refsheetby,0)=0 AND mo.cutoffby>0 AND mo.islocked=? AND m.company_id=? AND m.branch_id=? AND mo.refsheet=1 AND m.refv=1 ORDER BY m.portfolio_id,m.applno,m.apptype', ismigrated=true WHERE query_id=218;
UPDATE platform.application_query SET query_text='update!C0L!UPDATE main_operations mo SET islocked=?, lockedbyuser=CASE WHEN ?>0 THEN ? ELSE NULL END,refsheeton=CASE WHEN ?>0 THEN ?::timestamp ELSE NULL END,refsheetby=? FROM main m WHERE m.case_id=mo.case_id AND m.uuid::text=? AND m.company_id=? AND m.branch_id=?', ismigrated=true WHERE query_id=219;
UPDATE platform.application_query SET query_text='select!C0L!SELECT CASE WHEN EXISTS (SELECT 1 FROM main WHERE uuid::text=? AND company_id=? AND branch_id=? AND isdeleted=0) THEN finalizepcases(?::text,?::text,?::integer,?::text) ELSE ''error:Access denied'' END result', ismigrated=true WHERE query_id=300;
UPDATE platform.application_query SET query_text=
'select!C0L!SELECT x.uuid,x.fmvcode,x.applno,x.customername,x.apptype,x.visit,x.addr,x.city,x.pincode,x.phoneno,x.notes,''ver''||lower(x.verifiercode) verifier,x.portname,x.product,x.contactperson,to_char(x.allocationon,''YYYY/MM/DD HH24:MI:SS'') addedon,x.inittype,x.requiredphoto FROM (SELECT m.uuid,m.applno,m.product,p.portname,m.mvcode::text||''R'' fmvcode,replace(m.customername,''&'',''and'') customername,m.apptype,concat_ws('' '',m.raddr1,m.raddr2,m.raddr3) addr,m.rcity city,m.rpincode pincode,'''' phoneno,m.specialinst notes,v.verifiercode,mo.allocationon,m.branch_id,m.company_id,CASE WHEN mo.resrequiredphoto IN (1,2) THEN 1 WHEN mo.resrequiredphoto=3 THEN 0 ELSE mo.resrequiredphoto END requiredphoto,''R'' visit,CASE WHEN mo.resrequiredphoto>2 THEN ''T'' ELSE ''A'' END inittype,m.contactperson FROM main m JOIN main_operations mo ON mo.case_id=m.case_id LEFT JOIN verifier v ON m.resiverifier=v.verifier_id JOIN portfolio p ON p.portfolio_id=m.portfolio_id WHERE m.rv=1 AND mo.resphotosheetby=0 AND m.resiverifier>1 AND mo.resrequiredphoto<>-1 UNION ALL SELECT m.uuid,m.applno,m.product,p.portname,m.mvcode::text||''O'',replace(m.customername,''&'',''and''),m.apptype,concat_ws('' '',m.companyname,m.oaddr1,m.oaddr2,m.oaddr3),m.ocity,m.opincode,'''',m.specialinst,v.verifiercode,mo.allocationon,m.branch_id,m.company_id,CASE WHEN mo.offrequiredphoto IN (1,2) THEN 1 WHEN mo.offrequiredphoto=3 THEN 0 ELSE mo.offrequiredphoto END,''O'',CASE WHEN mo.offrequiredphoto>2 THEN ''T'' ELSE ''A'' END,m.contactperson FROM main m JOIN main_operations mo ON mo.case_id=m.case_id LEFT JOIN verifier v ON m.offverifier=v.verifier_id JOIN portfolio p ON p.portfolio_id=m.portfolio_id WHERE m.ov=1 AND mo.offphotosheetby=0 AND m.offverifier>1 AND mo.offrequiredphoto<>-1 UNION ALL SELECT m.uuid,m.applno,m.product,p.portname,m.mvcode::text||''P'',replace(m.customername,''&'',''and''),m.apptype,concat_ws('' '',m.paddr1,m.paddr2,m.paddr3),m.pcity,m.ppincode,'''',m.specialinst,v.verifiercode,mo.allocationon,m.branch_id,m.company_id,CASE WHEN mo.prorequiredphoto IN (1,2) THEN 1 WHEN mo.prorequiredphoto=3 THEN 0 ELSE mo.prorequiredphoto END,''P'',CASE WHEN mo.prorequiredphoto>2 THEN ''T'' ELSE ''A'' END,m.contactperson FROM main m JOIN main_operations mo ON mo.case_id=m.case_id LEFT JOIN verifier v ON m.propverifier=v.verifier_id JOIN portfolio p ON p.portfolio_id=m.portfolio_id WHERE m.pv=1 AND mo.prophotosheetby=0 AND m.propverifier>1 AND mo.prorequiredphoto<>-1) x WHERE x.company_id=? AND x.branch_id=? ORDER BY x.fmvcode', ismigrated=true WHERE query_id=303;

Some files were not shown because too many files have changed in this diff Show More