|
@@ -25,6 +25,7 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
+import com.fasterxml.jackson.databind.ser.std.StdJdkSerializers;
|
|
|
import com.goafanti.common.bo.Error;
|
|
import com.goafanti.common.bo.Error;
|
|
|
import com.goafanti.common.dao.DemandCollectionMapper;
|
|
import com.goafanti.common.dao.DemandCollectionMapper;
|
|
|
import com.goafanti.common.dao.SkjtUserMapper;
|
|
import com.goafanti.common.dao.SkjtUserMapper;
|
|
@@ -277,4 +278,31 @@ public class DemandCollectionServiceImpl extends BaseMybatisDao<DemandCollection
|
|
|
return (Pagination<OutUserList>) findPage("findUserList","findUserCount",
|
|
return (Pagination<OutUserList>) findPage("findUserList","findUserCount",
|
|
|
map, in.getPageNo(), in.getPageSize());
|
|
map, in.getPageNo(), in.getPageSize());
|
|
|
}
|
|
}
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public int updateUserPassword( String account,String usedPassword, String newPassword) {
|
|
|
|
|
+ SkjtUser s;
|
|
|
|
|
+ if (TokenManager.hasRole(SkjtConstants.GLY)) {
|
|
|
|
|
+ s=skjtUserMapper.selectByAccount(account);
|
|
|
|
|
+ }else {
|
|
|
|
|
+ s=skjtUserMapper.selectByPrimaryKey(TokenManager.getAdminId());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (s!=null) {
|
|
|
|
|
+ String up=s.getPassword();
|
|
|
|
|
+ String np="";
|
|
|
|
|
+ Calendar c=Calendar.getInstance();
|
|
|
|
|
+ c.setTime(s.getCreateTime());
|
|
|
|
|
+ c.set(Calendar.MILLISECOND, 0);
|
|
|
|
|
+ s.setCreateTime(c.getTime());
|
|
|
|
|
+ s.setPassword(newPassword);
|
|
|
|
|
+ np=passwordUtil.getEncryptPwd(s);
|
|
|
|
|
+ if (np.equals(up)) {
|
|
|
|
|
+ SkjtUser us=new SkjtUser();
|
|
|
|
|
+ us.setId(s.getId());
|
|
|
|
|
+ us.setPassword(np);
|
|
|
|
|
+ skjtUserMapper.updateByPrimaryKeySelective(us);
|
|
|
|
|
+ return 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return 0;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|