Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- DIBAGIAN ADD NYA ---
- if (inputDto.getString("flgPkp").equals(GeneralConstants.YES)) {
- ValidationUtil.valDate(inputDto, "pkpDate");
- if (!inputDto.getString("nonActivePkpDate").equals(
- GeneralConstants.EMPTY_VALUE)) {
- ValidationUtil.valDate(inputDto, "nonActivePkpDate");
- }
- Dto partnerNpwpExtDto = new Dto();
- partnerNpwpExtDto.put("pkpDate", inputDto.getString("pkpDate"));
- partnerNpwpExtDto.put("nonActivePkpDate",
- inputDto.getString("nonActivePkpDate"));
- partnerNpwpExtDto.put("active", inputDto.getString("active"));
- partnerNpwpExtDto
- .put("tenantId", inputDto.getLong("tenantLoginId"));
- if (inputDto.getString("active").equals(GeneralConstants.YES)) {
- partnerNpwpExtDto.put("activeDateTime",
- inputDto.get("datetime"));
- partnerNpwpExtDto.put("nonActiveDateTime",
- GeneralConstants.SPACE_VALUE);
- } else {
- partnerNpwpExtDto.put("activeDateTime",
- GeneralConstants.SPACE_VALUE);
- partnerNpwpExtDto.put("nonActiveDateTime",
- GeneralConstants.SPACE_VALUE);
- }
- this.prepareInsertAudit(partnerNpwpExtDto,
- inputDto.getLong("userLoginId"),
- inputDto.getString("datetime"));
- this.prepareUpdateAudit(partnerNpwpExtDto,
- inputDto.getLong("userLoginId"),
- inputDto.getString("datetime"));
- inputDto.put("partnerNpwpExtDto", partnerNpwpExtDto);
- }
- --- DIBAGIAN EDIT NYA ---
- Dto inputDtoForExt = new Dto();
- inputDtoForExt.put("id", inputDto.getLong("id"));
- Dto partnerNpwpExtExistDto = isPartnerNpwpExtExistsById
- .execute(inputDtoForExt);
- if (partnerNpwpExtExistDto.getBoolean("exists")) {
- // edit pkp date
- if (inputDto.getString("flgPkp").equals(GeneralConstants.YES)) {
- ValidationUtil.valDate(inputDto, "pkpDate");
- if (!inputDto.getString("nonActivePkpDate").equals(
- GeneralConstants.EMPTY_VALUE)) {
- ValidationUtil.valDate(inputDto, "nonActivePkpDate");
- }
- } else if (inputDto.getString("flgPkp").equals(GeneralConstants.NO)) {
- ValidationUtil.valDate(inputDto, "nonActivePkpDate");
- }
- Dto partnerNpwpExtDto = partnerNpwpExtExistDto
- .getDto("partnerNpwpExtDto");
- partnerNpwpExtDto.put("pkpDate", inputDto.getString("pkpDate"));
- partnerNpwpExtDto.put("nonActivePkpDate",
- inputDto.getString("nonActivePkpDate"));
- partnerNpwpExtDto.put("active", inputDto.getString("active"));
- partnerNpwpExtDto
- .put("tenantId", inputDto.getLong("tenantLoginId"));
- if (partnerNpwpExtDto.getString("active").equals(
- GeneralConstants.YES)
- && inputDto.getString("active").equals(GeneralConstants.NO)) {
- partnerNpwpExtDto.put("nonActiveDateTime",
- inputDto.getString("datetime"));
- } else {
- if (partnerNpwpExtDto.getString("active").equals(
- GeneralConstants.NO)
- && inputDto.getString("active").equals(
- GeneralConstants.YES)) {
- partnerNpwpExtDto.put("activeDateTime",
- inputDto.getString("datetime"));
- }
- }
- this.prepareInsertAudit(partnerNpwpExtDto,
- inputDto.getLong("userLoginId"),
- inputDto.getString("datetime"));
- this.prepareUpdateAudit(partnerNpwpExtDto,
- inputDto.getLong("userLoginId"),
- inputDto.getString("datetime"));
- inputDto.put("partnerNpwpExtDto", partnerNpwpExtDto);
- } else {
- // add new pkp date
- if (inputDto.getString("flgPkp").equals(GeneralConstants.YES)) {
- ValidationUtil.valDate(inputDto, "pkpDate");
- if (!inputDto.getString("nonActivePkpDate").equals(
- GeneralConstants.EMPTY_VALUE)) {
- ValidationUtil.valDate(inputDto, "nonActivePkpDate");
- }
- Dto partnerNpwpExtDto = new Dto();
- partnerNpwpExtDto.put("id", inputDto.getLong("id"));
- partnerNpwpExtDto.put("pkpDate", inputDto.getString("pkpDate"));
- partnerNpwpExtDto.put("nonActivePkpDate",
- inputDto.getString("nonActivePkpDate"));
- partnerNpwpExtDto.put("active", inputDto.getString("active"));
- partnerNpwpExtDto.put("tenantId",
- inputDto.getLong("tenantLoginId"));
- if (inputDto.getString("active").equals(GeneralConstants.YES)) {
- partnerNpwpExtDto.put("activeDateTime",
- inputDto.get("datetime"));
- partnerNpwpExtDto.put("nonActiveDateTime",
- GeneralConstants.SPACE_VALUE);
- } else {
- partnerNpwpExtDto.put("activeDateTime",
- GeneralConstants.SPACE_VALUE);
- partnerNpwpExtDto.put("nonActiveDateTime",
- GeneralConstants.SPACE_VALUE);
- }
- this.prepareInsertAudit(partnerNpwpExtDto,
- inputDto.getLong("userLoginId"),
- inputDto.getString("datetime"));
- this.prepareUpdateAudit(partnerNpwpExtDto,
- inputDto.getLong("userLoginId"),
- inputDto.getString("datetime"));
- inputDto.put("partnerNpwpExtDto", partnerNpwpExtDto);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement