|
|
@@ -78,6 +78,32 @@ class BizSupplierServiceImplTest
|
|
78
|
78
|
verify(mapper, never()).insertBizSupplier(any());
|
|
79
|
79
|
}
|
|
80
|
80
|
|
|
|
81
|
+ @Test
|
|
|
82
|
+ @DisplayName("修改保留账号分配字段")
|
|
|
83
|
+ void updatePreservesAccountFields()
|
|
|
84
|
+ {
|
|
|
85
|
+ BizSupplier db = sampleRow();
|
|
|
86
|
+ db.setId(3L);
|
|
|
87
|
+ db.setSupplierCode("03");
|
|
|
88
|
+ db.setAccountAssigned(TradePartnerAccountRules.ACCOUNT_ASSIGNED_YES);
|
|
|
89
|
+ db.setSysUserId(200L);
|
|
|
90
|
+ db.setAssignedLoginName("gys3");
|
|
|
91
|
+ when(mapper.selectBizSupplierById(3L)).thenReturn(db);
|
|
|
92
|
+ when(mapper.countBizSupplierByNameExcludeId(any(), eq(3L))).thenReturn(0);
|
|
|
93
|
+ when(mapper.countBizSupplierByIdentityNoExcludeId(any(), eq(3L))).thenReturn(0);
|
|
|
94
|
+ when(mapper.updateBizSupplier(any())).thenReturn(1);
|
|
|
95
|
+
|
|
|
96
|
+ BizSupplier in = sampleRow();
|
|
|
97
|
+ in.setId(3L);
|
|
|
98
|
+ in.setFeeMethod(SupplierRules.FEE_METHOD_PER_ACCOUNT);
|
|
|
99
|
+ assertEquals(1, service.updateBizSupplier(in));
|
|
|
100
|
+
|
|
|
101
|
+ verify(mapper).updateBizSupplier(argThat(r ->
|
|
|
102
|
+ TradePartnerAccountRules.ACCOUNT_ASSIGNED_YES == r.getAccountAssigned()
|
|
|
103
|
+ && Long.valueOf(200L).equals(r.getSysUserId())
|
|
|
104
|
+ && "gys3".equals(r.getAssignedLoginName())));
|
|
|
105
|
+ }
|
|
|
106
|
+
|
|
81
|
107
|
@Test
|
|
82
|
108
|
@DisplayName("修改禁止改编号")
|
|
83
|
109
|
void updateCodeImmutable()
|